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.
- NI's Encoder Measurement: How-To Guide
- NI's Quadrature Encoder Fundamentals
- Encoder Measurments: How-To Guide
- see Figure 5. X1 Encoding for how signal looks
- fpga4fun see Quadrature Decoder
- fpga = field programable gate array
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