How to control current for a Brushed DC motor ?  - Page 1
Forum section: electronics / projects

author: learnfromfailures
author_rank: Contributor
timestamp: August 24, 2021, 11:42:09 pm
content: I'm designing a FPGA controlled DC brushed motor with 28V, inrush current 30 Amps and Stall current 25 amps. I'm need to design a current controller. I don't know how can I control just the current with PWM. I have an option to use specialized IC DRV8701 instead, I want to control using FPGA Software.

author: moffy
author_rank: Super Contributor
timestamp: August 25, 2021, 01:59:50 am
content: Your question is lacking a little detail.1. Do you need bidirectional drive for the motor? e.g. forward and reverse. If you do then you need a full H bridge like the DRV8701.2. Do you need to control the current for dynamic reasons e.g. controlling acceleration, or do you just need to limit it to a safe value? The first reason is more complex than the second.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 25, 2021, 02:09:46 am
content: If you want to run the motor in one direction, then a beefy N-channel MOSfet with a suitable gate driver is sufficient.For control of the current, If you want to get accurate, you have to measure it. Simplest way is a shunt resistor, with some kind of amplifier, form LM358 to the INA shunt amplifiers.Then use a PID loop, to increase the PWM if current is too low, and decrease PWM if current is too high.And how could inrush current be different from stall current?Inrush current is during startup when the motor is stalled.DRV8701 is an H-bridge Gate driver, and seems a suitable choice if you want to turn the motor in two directions.With DC motors, current corresponds with torque, while voltage corresponds with speed.If you have a stalled motor, then it will use lots of current to generate a lot of torque to bring the motor up to speed if you use a 100% PWM.DC motors are pretty simple first order systems (If you neglect coil inductance, which works at a few orders of magnitude higher frequencies, but does smoothe out the current generated by the PWM signal.If you have an 28Vdc motor with a stall current of 30A, then it's internal resistance is 28/30 is approx 1 Ohm. It's that simple. When the motor starts turning, it starts acting as a dynamo (EMK) and the generated voltage results in less current.If the motor is friction less (which motors with brushes never are) then without any other load and 28Vdc applied, it will have 0A and generate 28V of EMK. This is idealized of course. In real life the motor will have friction, and thus need torque and thus current to overcome that friction.Have a close look at a datasheet of a DC motor. The relationships between voltage & RPM and Current & Torque are (very close to) linear.If you have a simple application, or don't need much accuracy, then just "slowly" changing the PWM duty cycle is enough. This results in a slow (average) voltage change, which results in a small torque needed to overcome motor inertia and thus a low current.

author: Benta
author_rank: Super Contributor
timestamp: August 25, 2021, 09:09:43 am
content: Quote from: learnfromfailures on August 24, 2021, 11:42:09 pmPlease explain why you need to "control current"? Normally it's enough to just limit current.

author: langwadt
author_rank: Super Contributor
timestamp: August 25, 2021, 10:18:03 am
content: Quote from: Benta on August 25, 2021, 09:09:43 amservos often have current control because torque is proportional to current

author: Benta
author_rank: Super Contributor
timestamp: August 25, 2021, 04:27:19 pm
content: I was asking the OP, not you.

author: learnfromfailures
author_rank: Contributor
timestamp: August 25, 2021, 06:27:35 pm
content: Quote from: Benta on August 25, 2021, 04:27:19 pmWhen I have a stalled motor with load I need to provide the charge thus, current for it to move. The load is 650lb so initially I thought I can generate a PWM and average out the current by changing the freq. The duty cycle or the ratio of "on" time to the switching period can be adjusted to change the average current. I don't know how can current limiter help with this ?

author: learnfromfailures
author_rank: Contributor
timestamp: August 25, 2021, 06:29:02 pm
content: Quote from: moffy on August 25, 2021, 01:59:50 amFor bidirectional drive for the motor, I have already have FETs to make an H bridge. I don't need to control the spread or acceleration.

author: learnfromfailures
author_rank: Contributor
timestamp: August 25, 2021, 06:37:16 pm
content: Quote from: Doctorandus_P on August 25, 2021, 02:09:46 amThat is what I'm was wondering, how can I provide that much charge/current to the motor so it can start moving. My initial thought was to have a current loop then switch voltage using PWM with varying duty cycle to average out the current. To be honest, I lack confidence in this idea, I don't know if averaging current over time would be enough for the motor to come out of stall state. I took a course in control theory in my undergrad, it is been a while now.Now, If I provide 100% duty cycle then current will start to rise again and could go to that level. It will work but, it beats the whole purpose of having feedback loop.

author: Benta
author_rank: Super Contributor
timestamp: August 25, 2021, 07:26:29 pm
content: You're thinking about this backwards.A DC motor will spin up until the back EMF (rpm dependent) matches the applied voltage. It will try to do this always.To achieve this equilibrium, it will pull current as needed, depending on the mechanical load. There is no way way you can "force" a DC motor to consume current.The applied voltage can be variable, either linearly or through PWM, but this just controls the desired motor rpm.If your mechanical load is too large for the motor to reach desired rpm, your motor is too small. Period.No amount of "magic PWM" or other snake oil will change that fact. It's physics.Now, if you're trying to lift something heavy, a gearbox might be the solution as simultaneous "rpm divider" and "torque multiplier".

author: learnfromfailures
author_rank: Contributor
timestamp: August 25, 2021, 08:15:51 pm
content: Quote from: Benta on August 25, 2021, 07:26:29 pmI can't change the motor not even the gearbox.Quote from: Benta on August 25, 2021, 07:26:29 pmMotor has an inductive load, coils, and you charge that slowly with time, that is averaging current over time. The operation of an inductive load usually involves a current that is either increasing or decreasing but never constant. The integral of the current with respect to time over a period will give you an average value. The magnitude of the current ripple can be controlled by adjusting the switching frequency or period. The duty cycle or the ratio of "on" time to the switching period can be adjusted to change the average current.

author: Benta
author_rank: Super Contributor
timestamp: August 25, 2021, 08:32:39 pm
content: Quote from: learnfromfailures on August 25, 2021, 08:15:51 pmYes. And?The inductive component of a DC motor is miniscule compared to the back EMF and the mechanical parameters. It helps smoothing when using PWM to vary the applied voltage (compared to just varying the voltage linearly), that's all.Set your PWM to 100% and we're back to square one: DC supply.In other words: PWM will let you reduce the applied voltage to the motor (thereby reducing rpm). It will never be able to increase it.And again: current drawn by the motor is proportional to mechanical load (mechanical load also being inertia when spinning up). Nothing else.

author: moffy
author_rank: Super Contributor
timestamp: August 26, 2021, 12:20:58 am
content: I have just designed something simpler but perhaps applicable. I am driving a DC spindle motor (one direction only) with a PWM signal, controlled by a pot, but it also has to have a fixed current limit to reduce the on time of the PWM signal if the maximum current is reached. Normal operation is to turn the pot to set the desired speed, this sets the PWM ratio, ON to total period. If the maximum current is exceeded at any point, the ON time is reduced, on a cycle by cycle basis to limit the current to a safe maximum.With PWM in this case, there is no need to change frequency, only duty cycle. Do you want something like this but bidirectional?If you are moving heavy loads with a DC motor then you need to control the current to limit the maximum acceleration, unless if maximum acceleration is always safe.

author: Benta
author_rank: Super Contributor
timestamp: August 26, 2021, 02:23:35 pm
content: Quote from: moffy on August 26, 2021, 12:20:58 amThis a quite standard way of current limiting a motor, and pay attention to what's actually happening: you are reducing the applied voltage to limit the current.No matter how you turn this around, a DC motor is a voltage controlled device.

author: EPAIII
author_rank: Super Contributor
timestamp: August 26, 2021, 11:44:01 pm
content: "Motor has an inductive load..." Most motors have MECHANICAL loads. They are trying to move someTHING, not push current through an inductor. Is this a motor-generator set? Saying that the motor IS an inductive load would make more sense if that is the case, but the load would still be of a MECHANICAL nature.I do not think you are looking at this properly. It is TORQUE that is proportional to current in a motor. The more current, then the greater the torque. To my mind one of the greatest advantages of using pulse width modulation to drive a DC motor is that it can generate almost full torque during the period that the pulses are on. This is, of course, subject to the time that the inductance of the motor's coils allows the full current to flow through them. But a DC motor can be run at very low speeds with full or almost full torque with pulse width modulation. It is not the peak current that is limited, but the average current and there IS a very big difference.As others have said, if your motor stays stalled with full width (100%) pulses, then pulse width modulation is incapable of producing any greater torque and your motor will stay stalled. Sorry, but you simply need a bigger motor or some other changes in how the mechanical load is connected to it.As for limiting the current, in my experience that means limiting the peak current that occurs when those pulses are long enough to allow it to build to that level. And, IMHO, the main reason for adding current limiting would be to prevent over heating and smoke. The best way to do it would be in the power that is supplied to the current amplifying devices, whatever they may be. They simply can not output more current than the power supply can produce.But once again, if your controller is operating with a 100% duty cycle and your motor is stalled, no amount of current control (reduction) is going to start that motor. Winding a rope around a pulley on it's shaft and pulling it would be a better solution. And YES, that has been done. I do not recommend it, but it has been done.Quote from: learnfromfailures on August 25, 2021, 08:15:51 pm

author: moffy
author_rank: Super Contributor
timestamp: August 29, 2021, 12:08:43 pm
content: Quote from: Benta on August 26, 2021, 02:23:35 pmSorry Benta,, the explanation was not for you but for the fellow trying to get advice, so I pitched the explanation at his level. With regards to "pay attention to what's actually happening" I have a fair idea as I have worked on diesel electric locomotive DC motors, 600kw and others for several years. I have even designed, constructed and installed Parallel Hopkins Test Beds for said motors, with about 600kw of power supplies, High Voltage, Booster and Field where you run two motors of the same type, mechanically coupled, one as a motor the other as a generator and you use the supplies (apart from the Field) to only supply the losses. Lots of real life modelling and testing involved, plenty of potential for instabilities, and a good understanding required for success, and yes the test beds were successful and tested several hundred motors over a number of years.