How to fit Encoder on Roboclaw?

Questions about using encoders with the Roboclaw product line
Post Reply
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: How to fit Encoder on Roboclaw?

Post by Basicmicro Support »

You have to use one of the Speed commands if you want the Roboclaw to adjust the speed for you. The PWM/Duty cycle commands do not use the feedback information. You could get complex and read the encoder speeds and then calculate what to change the PWMs to get them to run at constnat speed all the time but that would just duplicate the PID function built into the Roboclaw.

If you use the speed commands you must setup the Velocity PID values for the Roboclaw. The easiest way to do that is to use IonMotion. Please read the section on auto tuning in the manual. Then open IonMotion, make sure the encoders increase in value when you move the motors forwarding(use the PWM settings window and slide the motor slider up to tell it to go forward). If the encoder decreases instead if increasing you need to swap the motor wires(or swap the encoder wires if you are using a quadrature encoder). Then you can go to the Velocity Settings tab and click the Auto Tune button for the motor you are working on. After tuning is done you can test it using the Sliders in the Velocity Settings window. Check that the speed you set is the speed it runs at(within some reasonable amount). Change the load on the wheels to make sure the Roboclaw properly compensates for that(up to the power limit of the motor, beyond that the roboclaw wont be able to compensate for the load).

After you are satisified with the settings go to the Device manu and click Save Settings to save them to the roboclaws non-volatile memory.

Post Reply