Questions about regenerative braking

General discussion of using Roboclaw motor controllers
Post Reply
danbu
Posts: 2
Joined: Tue Jan 30, 2018 12:37 pm
Questions about regenerative braking

Post by danbu »

Hello,

I am working on a project and wish to validate if a Roboclaw 2x15 can handle the requirements and recharge my batteries. The main question boils down to the following : If one of the motors is drawing current to turn counter-clockwise to create motion and the other is not drawing power yet rotating freely twice as fast clockwise thanks to an external mechanical force, how does the roboclaw handle the power distribution? Does it only draw the missing current from the battery ?

How does one apply varying degrees of "regenerative braking" programmatically to one of the motors ? Or one motor at say 5% and the other at 50%

Does is make any difference if regenerative braking is applied to a motor turning clockwise and the other counterclockwise to recharge the batteries ?

My hardware :

1 Raspberry Pi 3
Roboclaw 2x15 (USB connection to RPi for control and 5v supply to Rpi)
1 TP-Link CPE510 Wifi antenna (connected to batteries)
1 Adafruit Ultimate GPS
2x 2200mAh LiPo (3s) connected in series (giving approximately 24v)
2x brushed DC motors with the following specifications:
- Model: XD - 3420
- Voltage:12v/24v, Electric current:1A-2A, Power : 30W
- Speed: 3000/6000rpm
- Torque:1kg/2kg 0.1/0.2N.M

My setup:

When my unit is stationary each DC motor is turning thanks to an external force (a wire loops through each motor shaft). One motor turns clockwise and the other counter-clockwise. If I wish to move my unit I send a command to the roboclaw to turn one of the motors 'faster' than the rotation given by the wire. The other option would be to apply braking (which I'm not quite sure of how to do it) to the other motor to obtain a similar movement/direction.

My goal is to maximise the use of the energy supplied by the wires and draw the least amount of current from the batteries when motion is required. When the unit is stationary, batteries recharge.

I am using Python code to manage the motors through the roboclaw.

Any help, examples or documentation explaining how to best configure and use the roboclaw under such conditions will be greatly appreciated.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Questions about regenerative braking

Post by Basicmicro Support »

1. Regeneration is inherant to h-bridges and most motor controllers are regenerative(eg excess energy will go back to the battery.

2. If you are controlling your motors using duty(pwm or voltage control) when one motor slows down the voltage on the main rail will start to rise which will cause the other motor to speed up(assuming the other motors duty percent did not change). Most if not all energy from regen in one motor will go to the other motor in this case.

If only one motor is running and it slows down, that energy will still cause the main voltage rail to rise. When that voltage gets high enough the battery will start to charge. Usually the rise is very small since the battery will start to charge as soon as the voltage gets above the battery voltage.

3. There are three kinds of braking. Regenerative(where slowing down the motor causes more energy to go back onto the power rail), dynamic breaking( where energy is pulled from the power rail(happens if you drive the motor backwards against the external force of motion) and resistive braking(when you short the motor leads together(all energy is disipated as heat in the mosfets and motor windings).

The roboclaw will be in regenerative or dynamic braking in all cases except when the motor duty is 0%. Then it is in resistive braking(what most people actually call "braking".

If you slow down by lowering the PWM duty but dont go into reverse you are usually in regen. Note regen only starts when the main rail voltage has risen above the battery voltage + a little bit(eg the point when the battery starts to recharge). Before that point your are disipating that energy through resistance(or potentially in the second motor if it is running).

If you are braking and need to brake faster than regenerative or normal braking then you have to push the motor in reverse from the current motion(eg dynamic braking), however this has the problem that if you dont have a way to measure the motor shaft speed you wont know when you have stopped and started to move in reverse so most people that arent using encoders do not use dynamic braking.

With Velocity control the type of braking is handled automatically. If you ask the controller to stop super fast it will go into dynamic braking(until the motor stops), if you ask it to stop fast but not too fast it will go into regen(and charge your battery some), if you ask it to stop slowly the regen energy will be disipated in the loses of the system.
danbu
Posts: 2
Joined: Tue Jan 30, 2018 12:37 pm
Re: Questions about regenerative braking

Post by danbu »

Thanks for the quick and thorough reply. It allowed me to progress in my project and test out a few configurations.

Post Reply