1
\$\begingroup\$

I am working on an underwater ROV. I am running four 12V DC motors using an Arduino Uno and four N-type logic level MOSFETs to control the speed of each motor individually. There are also four 12V relays for each motor to change the direction of the motor when needed. The relays are turned on using the Arduino through a standard transistor circuit. I have a 7 inch motor and a car reverse camera connected to the system. The system is powered through a bench power supply at 12V, 10A.

When I am running two motors at full speed, the system is fine, although I see some noise on the monitor. If I switch the relays to turn the motors counterclockwise while the two motors are running clockwise, as soon as I switch the direction of the motor the voltage drops for a fraction of a second and the monitor turns off for a couple of seconds before turning back on. When I start the motors in reverse, everything seems fine.

Why does that happen? Why is there a voltage sag of almost 1.5V - 2V as soon as the polarity of the motors is changed? Is it because of the magnetic field inside the motor that takes a while to run in reverse which in-turn takes a lot of current? I am just guessing, I need to be educated on that and what I can do to fix it.

Also, there are horizontal lines that appear on the monitor when one motor turns on and it gets worse when all four motors are on. Is there an easy fix for this?

Please let me know if there is more information required.

\$\endgroup\$
6
  • \$\begingroup\$ What is your dead time? The time when all the switches are OFF so that you are sure you aren't shorting the power rails? This is called shoot through and if the dead time isn't long enough it could cause similar behaviour to what you're seeing. \$\endgroup\$
    – Puffafish
    May 9, 2022 at 7:20
  • \$\begingroup\$ @Puffafish, when the dead time is more than a couple of seconds then then there is no issue. I think you are right. Shoot through is an issue I reckon. Is there a way to fix it? \$\endgroup\$ May 9, 2022 at 7:22
  • \$\begingroup\$ You can delay then electronically brake the motor before the reversal. The braking involves shorting the motor terminals together. You'd need an H-bridge driver instead of mechanical relays, which is a low cost part you can get on a demo board. Try some Internet searches, you'll get a lot of information on this. \$\endgroup\$
    – TonyM
    May 9, 2022 at 7:27
  • \$\begingroup\$ @TonyM, Sure I have tried that, which works, but it will be programmed by high school students that may not consider adding delays. Isn't there any other way? I googled and I couldn't find much. Maybe someone knows something that not many people know. \$\endgroup\$ May 9, 2022 at 7:30
  • 1
    \$\begingroup\$ Reversing the motor at full speed is the perfect way to draw a high peak current for a short time. All the rotating masses have to be stopped and started in opposite direction fast, this could not be done without a lot of power. During your bench test the motors don't have to drive a propeller in water, so you have to expect much more current when operating in water. An independent battery for the camera is highly recommendet. \$\endgroup\$
    – Uwe
    May 9, 2022 at 14:58

3 Answers 3

2
\$\begingroup\$

Abruptly reversing a spinning DC motor can (and does) lead to big spikes of current, mechanical stress, and double voltage over the motor.

To reverse the motors you should first ramp down the PWM to zero - the motor should follow reducing speed; then wait a little, switch the relay, and then ramp up the PWM again.

\$\endgroup\$
1
\$\begingroup\$

The induced voltage in DC motors is the reason why the motor draws less current than the input voltage/coil resistance. The induced voltage is proportional to the r.p.m and it's like a voltage source in series with the coil resistance, but opposite to the input voltage.

When you suddenly change the input voltage polarity the induced voltage is to the same direction as the new input voltage, so the current is more than the input voltage/coil resistance - your motor draws more than when starting.

As already said by others you can brake electrically and switch the reversed voltage later. Turn the input DC at first off and direct the motor (it's as well a generator) energy to a braking load - a short circuit is very effective, the motor resistance dissipates the rotational energy. Turn the reversed DC voltage ON when the motor has stopped (=no induced voltage).

High power systems prefer to use electronics which save energy by charging a battery with the braking energy. The braking energy is not only in the motor, it's in the moving mass of the whole moving vehicle.

\$\endgroup\$
6
  • \$\begingroup\$ Thanks for this instant knowledge. Since, i am using only one relay, I cannot brake the motor. Is there any other suggestion? \$\endgroup\$ May 9, 2022 at 7:58
  • 1
    \$\begingroup\$ You must add or change something to change the effect. One possibility is a current limiter. Another easy way is to use 2 relays to reverse the polarity and turn them at a little different times - the braking short circuit appears in the intermediate time assuming the moving blades inside the relays are connected to the motor. Reveal some possibilities for the changes. We cannot guess what you see. A schematic of the existing system would remove the ambiguity of the text-only description you gave. \$\endgroup\$
    – user136077
    May 9, 2022 at 8:20
  • \$\begingroup\$ You are right. Apologies. I will update the question with a schematic soon. \$\endgroup\$ May 9, 2022 at 8:24
  • \$\begingroup\$ @user287001 no.When current inside a inductor tends to change , the inductor behaves like a current source which makes current grow up progressively. \$\endgroup\$
    – Jun Seo-He
    May 9, 2022 at 8:29
  • 1
    \$\begingroup\$ The effect of the inductance is another thing. It's measurable but not dominant. The current changes despite the inductance so rapidly that it has well time to grow higher than input voltage/coil resistance. Questioner's observation of high current proves it empirically. \$\endgroup\$
    – user136077
    May 9, 2022 at 8:45
1
\$\begingroup\$

As explained by user287001, when you reverse the polarity of the motor, it acts as a generator, but its polarity is opposite to the power supply voltage, so it will draw a lot more current than even its starting current. You can think of this "generator" as connecting a battery to your power supply, but with the wrong polarity.

On the left, the FET is ON, and the motor is powered (I drew it as a voltage source with internal resistance and inductance). Current flows according to the red arrows.

enter image description here

In the second schematic, the relay just reversed the motor polarity, so the voltage source polarity and inductor polarity are also inverted on the schematic. Due to the motor inductance, which has been flipped around, current reverses. This isn't a problem, if the FET is ON it'll go through the FET, otherwise it'll go through the body diode. This lasts a very short time.

Schematic 3: Once the inductance is discharged, the motor is still a generator, but its polarity is now opposite to the power supply. Therefore, current will be much larger than the motor starting current. When a motor acts as generator, the output voltage is roughly proportional to rpm, so the faster it goes, the more trouble you'll have when reversing polarity. In addition, the motor gets close to double the usual voltage and current, so if the power supply doesn't wimp out, it'll deliver double the torque... and the torque will change sign very fast... which means some fasteners designed for the nominal torque may just give up. Basically, reversing polarity on a motor running at full rpm can have some pretty spectacular effects, like the machine jumping off the floor and throwing some spare parts around.

Schematic 4: if you set PWM to zero (turning off the MOSFET) however, the polarity of the motor-generator's output voltage is such that it will be shorted by the diode.

So, you can't switch polarity and apply full power on a dime. You could reverse polarity and set PWM to zero at the same time, then wait for a while until the energy stored in the motor's rotational inertia is dissipated in both the diode and the motor's winding resistance. Make sure the diode can withstand this, otherwise it will fry. Then, wait for the motor to slow down. Once it has slowed down enough, you can then ramp up the PWM to start it in the other direction. The diode provides a convenient way to short the motor to slow it down faster, but it will do so only if the relay reverses the polarity and the FET is OFF. If the relay is not reversed and the FET is OFF, the motor will simply coast. So depending on the relay position, you either get braking or coasting.

An option would be to use a MOSFET driver with an integrated RS latch and comparator, like MCP1630, or other similar scheme. Basically, a current sense resistor in the MOSFET source monitors motor current, and turns off the FET when it exceeds a set value, which shortens the PWM cycle and ensures current never goes above the maximum that your power supply or battery can tolerate.

Otherwise you'll have to use fixed delays in your code, or monitor the motor current in some way, to ensure enough delay between reversing the polarity and turning the MOSFET ON again.

So if you want to be able to reverse direction quickly with your ROV, it all depends on the inertia of the motors and propellers. More inertia means you'll have to wait for longer.

Since this is an underwater ROV, the water itself could load the motors enough to slow them down, which would allow quicker change of polarity. But the opposite could also be true, if the ROV is advancing and the motors are powered down, its speed through the water may force the propellers to turn, and then your motor may not slow down as quickly as you want. I have no idea which of the two will win. Testing on a bench in air won't answer that question either.

So I guess you'd need to run a test in water: go full speed, revrese the relay and set PWM to zero, shorting the motors with the diodes, and time how long it takes for them to go from full RPM to something easier to turn around, like 25% rpm. See if that delay is okay, if it's not too long to feel sluggish to the operator.

Another option would be to use a H-bridge. In this case, the motor's inductance is exploited to turn the H-bridge into a boost converter when it acts as a generator during braking, which recovers the energy into your battery. However, this needs a smart control algo to adjust the PWM. Not rocket science, but not 2 lines of code either.

I guess that's why variable pitch propellers are popular...

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.