is the vnh5019 4 quadrant compatible? So what happens when the motor goes into generator mode?
And what different effect has low or high braking?
The “Truth table in normal operating conditions” on page 14 of the VNH5019 datasheet details the ways the H-bridge can be configured in normal operation. If that does not answer your questions, can you be more clear about what you are trying to do?
thanks for the quick reply.
So with the vnh5019 it is possible to have the motor in generator mode, so should be when it is in breaking mode, right? How is the vnh5019 handling the current coming from the motor?
It looks like you might be mixing a few concepts with imprecise words like “compatible”, so I’ll try to briefly go through some basics that might clear things up.
A quadrant is just a combination of which direction you are applying torque and which direction the motor is going. If you can apply power in both directions and you can physically spin the motor both directions independent of which direction you connected power, you have four possible combinations.
The VNH5019 is just an H-bridge motor driver, and therefore, like any H-bridge, it can apply voltage in both polarities to a DC motor, independent of which direction the motor happens to be turning. Therefore, any H-bridge and DC motor can be configured to operate in any of the four quadrants.
H-bridge motor drivers generally have to give you at least one more state besides applying power in forward and reverse directions, so that it’s possible to stop the motor, and most give you at least two more: “brake” and “coast”. In “coast” mode, the motor is effectively disconnected; in “brake” mode, the leads are shorted together, either by making them both low or both high, and the two options are basically the same from the perspective of the motor. You can easily compare the two states with any motor by leaving it disconnected and shorting its leads together while you try to spin it. When you have the motor leads shorted, the motor generates power that is dissipated in the motor windings and leads (and inside the motor driver, if you are shorting them through the motor driver).
While any H-bridge motor driver will give you operation in all four quadrants, they can vary widely in how much control you have, with the main factor being how quickly you can switch back and forth between various modes. You might also want good current sensing so you can control the level of braking that you are applying, and then in your overall system, you might want sensors on your motor to know how it’s actually turning.
Let’s consider an example where you have a 12V supply, applying power “forward” gives the motor +12 V and makes your motor spin “clockwise”, and the motor spins at about 12,000 RPM at 12V. If you switch to “coast” mode, the motor will slow down just from friction, and if you externally spin the motor at any speed less than 12k RPM, the motor will generate some voltage from 0 to 12V, proportional to the speed you are spinning it, but no current will flow.
If you now switch to “brake”, you are applying 0V to the motor leads, and since you have a closed circuit, current will flow proportionally to the speed you are spinning the motor at. That means that as the motor slows down, you will be braking, or resisting its spinning, less and less. You can also switch to “reverse”, or apply -12V to the motor. If you are still forcing the motor to spin clockwise at 12k RPM, you will be braking twice as hard as if you went into brake mode and only put 0V on the motor. (With the small DC motors we typically use on little robots, this condition would quickly destroy the motor.) If you are not forcing the motor to keep spinning clockwise when you apply the -12V, the motor will very abruptly slow down (this is quadrant 2 or 4 operation, where the motor direction is opposite from which way you are electrically trying to make it go, i.e. it is braking hard), switch directions, and then accelerate to 12k RPM counterclockwise (this is quadrant 1 or 3 operation, where the motor is spinning in the same direction you are trying to make it go). Notice that from the perspective of the H-bridge motor driver, it doesn’t know or care what quadrant you are in. You can only know that from additional sensors measuring what the motor is actually doing and the current that is actually flowing.
If you really care about good four-quadrant control, you probably want to have smooth, good control of your braking. For instance, you might want to apply 9V to the motor when it is spinning at 12k RPM, and gradually lower that voltage as the motor slows down so that you constantly have 3V difference between what you are applying to the motor and the voltage it would naturally be at given its speed at that moment. The H-bridges we use for motor drivers are not designed to give you some analog voltage like 9V out. Instead, we switch rapidly between the options we do have, which are forward, reverse, brake, and coast. So to approximate outputting 9V to do a gentle braking on the motor spinning at 12k RPM, we can switch between 75% at 12V (forward) and 25% at 0V (brake), or switch between 87.5% at 12V and 12.5% at -12V (reverse). We need to be able to switch fast enough for this to average out well. Exactly what is fast enough depends a lot on your application. You can imagine that if the minimum time you can be in reverse is one second, and you are flipping a switch between full forward and full reverse every few seconds, you are going to get some very jerky motion.
It is in this sense that the VNH5019 is not particularly well-suited for four-quadrant control. It is relatively slow at switching directions, or between power and braking. It can support 20kHz PWM while switching between power and coasting, which means the switching has to happen on the order of a few microseconds. With the VNH5019, switching among braking, forward, and reverse takes more like a millisecond (about a thousand times slower).
People also interested in this topic are often also interested in regenerative braking. That is a much more complicated topic than the basics of the four quadrants of operation I just discussed, but I’ll mention a few specific examples that I hope will make the picture more complete.
Remember how I said “if you externally spin the motor at any speed less than 12k RPM” in the coasting example earlier? Well, if you force the motor to spin faster than 12k RPM, it will generate more than 12V. And in that case (because of extra diodes we have across the MOSFETs), coast mode effectively puts 12V on the motor leads. Let’s say you spin the motor at 15k RPM, and it generates 15V. That would then get applied to your 12V power supply, and if that’s a battery, it would charge it. You would have about 3V equivalent of braking in that scenario; switching to brake mode would give you 15V equivalent of braking, and switching to reverse would give you 27V equivalent of braking.
We don’t usually get the motor spinning faster than it would go when we give it full power. (That could happen from something like a robot rolling away really fast on a long, steep hill.) In typical cases, the motors generate less than our supply battery, so to capture the energy from braking into a battery, we would need to be able to convert that lower voltage into a higher voltage, which is why any meaningful regenerative braking gets complicated fast.
Jan, thanks for the awesome reply. That cleared out some things for me. So if the motor is operated in generator mode, than looking from the driver towards the power supply, current will flow in the direction of the power supply. So would I need some kind of chopper or diode for this kind of occurence?
I am not sure what you mean by “operating a motor in generator mode”, and I suspect it’s not clear to you, either. I also do not know whether you “need some kind of chopper or diode for this kind of occurence”; that is up to your power supply and application. Just think about the basics:
If you externally mechanically spin the motor faster than it would spin just from applying your supply voltage, it will generate a higher voltage. If you connect that higher voltage to something (such as your lower-voltage supply), current will flow from the motor into the supply. If you do not want that to happen, a diode would prevent that (I don’t know what you mean by “chopper”).
If you use the brake mode to put 0V across the motor, the motor will be a generator, but that current will only flow in the loop consisting of the motor and the motor driver, and nothing will go back to the power supply.
By the way, if you are considering putting a diode from your power supply to a motor driver, you should be aware that there are also inductive effects that would normally send current into the supply (basically, unintended regenerative braking that you are likely to encounter sometimes). If you put in that diode, the current cannot go into the supply, and you can end up with much higher voltage spikes on your supply line (it’s easy to get 40V spikes with a 12V motor that is never spinning faster than it would at 12V), so you should make sure to protect your electronics, including your motor driver, from those spikes.