I copied and pasted your example code from the packet serial motor encoder read sample within your arduino library into my library sketch. I have had no problem moving the motors, turning, etc .. but moving on I wanted to start reading encoder data.
The output of the sample code you provide dumps: Encoder1:invalid Encoder2:invalid Speed1:invalid Speed2:invalid
I used your sample code because I noticed when using my code, derived from your samples, I was getting "0" ticks from the encoder when the wheels were moved.
I have a 2x7A w/ Pololu 37D 50:1 motors w/ the encoders. When using your studio software I can command the motors within the PWM screen and they'll move forward/back... and the encoders count the correct direction and appear to read properly. I did make some tweaks where I could have just flipped some motor wires but figured since the software allows for inverting... see my screen shot attached.
Additionally, and likely related. Tuning in the "velocity" settings rocks the motors back and forth a few times then they just go high speed in reverse forever. In the PWM settings attempting a tune there also runs the motor at full speed for ever. I'm guessing this is related.
Please see my screen shot attached.
ultimately I don't care to tune if I can't, I would really like the grab encoder ticks though.
- rc_issue1.png (219.46 KiB) Viewed 675 times