Thursday, February 16, 2012

Feb.16 Tacho Motor Encoder

Need interrupts to count the degrees from the tachometer in the motor.
If I understand right this is typically done by quad-code, 
where the signal changes indicated how much the motor has turned. 
Following are just good references found for now. 
The links will be needed for references if really help:
googled "quad-code for beginners" since that what I am.
Reviewing existing motor code:
motorAvrSetPwrBrake(cyg_uint32 pa_nOutputPort, cyg_int32 pa_nPercent, int pa_nBrake)
  • pa_nPercent is:
    • passed in as 32 bits, but ...
    • assigned to a 8 bit variable
    • sizes should match
  • ditto for   pa_nBrake
  • Also check for motor power between -100 and 100 should be in avr code. If in FB code, a new FB code could forget the check and bad data be sent.

No comments:

Post a Comment