Page 1 of 1

Load Balancing

Posted: Wed Mar 23, 2022 11:28 am
by imarocktscientst
I need to perform load balancing (as in electrical load) with two motors controlled by a RoboClaw 2x15A. Is there a way to read the duty commanded by RoboClaw's speed or position PID?

I want roboclaw to control the speed of the motors but if I just send SpeedAccel commands to the controller, one motor tends to do most of the work while the other just keeps pace.

Here's what I think I want to do (if there is a better alternative, I'd be happy to hear it):
1. Send a SpeedAccelM1 command
2. Immediately read the commanded M1 duty
3. Send a DutyAccelM2 command using the M1 duty from (2.)
4. (Possibly) implement an external PID control that monitors the current drawn by each motor and adjusts the M2 duty to balance the load (account for variations in motor performance).

Thanks

Re: Load Balancing

Posted: Thu Apr 14, 2022 3:57 pm
by Basicmicro Support
GETPWMS command 48. Returns m1 duty(2 bytes), m2 duty(2bytes), CRC16(2 bytes).

M1 and M2 Duty are a digital percentage(+-32767 = +-100 percent).

If you send a Duty command you will override the speed control(eg PID stops running). So you can't do it that way.

You can possibly adjust the speed of the high and/or low duty motor to get the load to adjust between the two.

Tweaking the PID settings on each motor may also do the job. Most likely one motor is tuned a bit tighter than the other motor. However changing those values on the fly may be more of a pain than just tweaking the "speed" of each motor slightly.