"Real Time Control" with roboclaw 2x7

General discussion of using Roboclaw motor controllers
Posts: 5
Joined: Wed May 24, 2017 3:37 am

"Real Time Control" with roboclaw 2x7

Postby dudlee » Mon Dec 03, 2018 2:22 am


I would need to control several (12 at this moment) dc motors real-time with closed loop (I mean that I would need to sample the motors' encoders and update the commmands at least 1kHz )and I was wondering if roboclaw can make it, or at least i want to know what is the fastest method to control the roboclaw.
As far as I know in serial mode the highest communication speed is about 1ms so ideally i could send commands to roboclaw 1000 times a minute but this is very ideal case i think.(I think I could reach 500Hz but I would need 1khz)
Or RC mode?
I was thinking what if i would use analog mode just to send analog signal 0-2v or so to roboclaw.
My idea know is that i will buy some analog/digital DAQ board that has several analog outputs to send the computed voltages to roboclaw (or to several roboclaws) which will then move the motors according to that signal, then read the encoders on the DAQ board DI pins.
1. My question is that do you have any data that what is the transition time of the analog mode of the roboclaw, so what is the time it takes to see the changes on pwm output of the FET when analog input changes?
2. what is the fastest way/method I can use to control my dc motor in "real-time"?

Thank you!

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

Re: "Real Time Control" with roboclaw 2x7

Postby Basicmicro Support » Mon Dec 03, 2018 10:25 am

Roboclaws can handle closed loop themselves, however 1khz is not realistic with most DC motors. Motors have a mechanical time constant. This is the time it takes for the motor to do something(like start moving once current is applied, or to accelerate to a new speed). This time constant on most motors will be upwards of 100ms. A 1khz control loop will only be usefull on a very special motor with extremely low mechanical time constant. If you have that kind of motor you probably need a specialized motor controller as well and if you dont have that kind of motor the Roboclaws 300hz Loop rate should be more than sufficient.

The internal motor control loop updates at 300hz so no matter the command input rate(analog, RC or packet serial) the maximum update rate is 300hz.

I recommend packet serial in any case. RC mode limits functionality and analog mode is suseptible to noise(simply put you cant not have some noise when using analog signals).

But you need to look at your application very carefully. Servo motors with true 1khz accuracy are rare to the point of non-existant. If you actually need that kind of control I think you need to be looking at galvonometers, not dc motors.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests