the position control on roboclaw 2X30A

Questions about using encoders with the Roboclaw product line
gc967
Posts: 9
Joined: Sun Nov 03, 2019 8:39 pm

Re: the position control on roboclaw 2X30A

Post by gc967 » Wed Nov 20, 2019 3:37 pm

Basicmicro Support wrote:
Wed Nov 20, 2019 8:49 am
Only the Position setting needed to be changed. Changing the other types may have broken something else. I recommend you download the labview driver again and modify JUST the Position value type. U32 or I32 is fine.
thanks for your advice. Yesterday, I tied to test the encoder count of our motor and I found that the count value from the motor controller was much larger than that set in our motor encoder.

our motor's encoder value is 502 pulse per circle. However, the pulse showed in test program is nearly 4000000.Image I think that is the problem which lets the motor always rotate.

As a result, how can I set the pulse values?

thanks again
Attachments
encoder count2.PNG
encoder count2.PNG (8.49 KiB) Viewed 48 times
encoder count.PNG
encoder count.PNG (17.92 KiB) Viewed 48 times
program to test the encorder.PNG
program to test the encorder.PNG (13.94 KiB) Viewed 48 times

gc967
Posts: 9
Joined: Sun Nov 03, 2019 8:39 pm

Re: the position control on roboclaw 2X30A

Post by gc967 » Wed Nov 20, 2019 3:38 pm

Meanwhile, this is my test program file.
Untitled 7.zip
(10 KiB) Downloaded 7 times

User avatar
Basicmicro Support
Posts: 1280
Joined: Thu Feb 26, 2015 9:45 pm

Re: the position control on roboclaw 2X30A

Post by Basicmicro Support » Thu Nov 21, 2019 10:07 am

You need to look at your actual encoder pulses. They must be extremely noisy to produce such a high pulse count. Use a scope to look at the encoder pulse signal while running the motor at a known power(use PWM Settings to run the motor). The encoder pulses should be square waves with no unexpected spikes.

Or your math is off. For example if you have a 100 line encoder, that is 400 counts per rotation and if you have a 50:1 gear ratio that is 50 * 400 = 20000 counts per rotation of the output shaft.

Post Reply