| Electronics > Projects, Designs, and Technical Stuff |
| DC motor driver problems |
| << < (3/3) |
| Yansi:
470uF is not out of USB spec, if you use a suitable soft-start circuitry, to pre-charge the cap. (I'd use a high side PMOS switch and a resistor crossing it). |
| Doctorandus_P:
It seems you went through quite a learning curve in only just a few hours. Big capacitors directly on the USB bus are bad because of very high surge currents through the connector at the moment they are not properly mated yet. Just take a regular power supply with banana cables and put it's output voltage directly to a big cap. Currents can be so high that a (very small part) of the metal melts and the banana plug welds to the capaitor wire. On the other hand. Big buffer caps are good for motor drivers. A simple option is to add a small P-channel MOSfet in the 5V USB line and switch it very slowly with an RC on the gate. Just extending the charge time of the bulk Elco to 10ms or so makes a significant difference, but ideally you should keep the charge current within the USB spec. If this MOSfet switch is under uC controll you can also turn it on only after the connectors are properly mated. With these precautions you can easily put extremely big capactiors on an USB bus. Or you put a resistor between the Raw USB input and your buffer elco's (Few 100 Ohm) and turn the MOSfet on to short that resistor once your Bus voltage has risen far enough. (See ADC below). A big bulk capacitor also flattens the voltage peaks when the motor is braked. Your motor has an encoder, and apparently you are already monitoring it's speed. With a properly implemented PID control there will be no more high current spikes or abrupt braking, and no need to add more hardware to mitigate this. But during testing, or when the PID controller fails and the brake energy is so high that it can be problematic a very common way is to add a brake resistor with a (MOSfet) switch over the Bulk capacitor. These brake resistors are very common with high power 3-phase inverters of multiple kW. Just typing "brake resistor" into Ali gives a whole lot of hits: https://www.aliexpress.com/wholesale?SearchText=brake+resistor With a small motor a beefy Zener is good enough. Other options can be based on a TL431, a power transistor and a resistor, or you can measure the bus voltage with the ADC of your uC and turn on the brake resistor if needed in software. |
| Siwastaja:
As others have explained, your motor driver is working as a boost converter, converting the low motor back-EMF voltage to your 5V bus voltage. With little load on the 5V bus, it starts to rise. The right and easy way to deal with this is to sense the DC bus voltage with your microcontroller (or whatever is driving the signals), for example by connecting a resistor divider to the ADC input, if available, or just any comparator circuit. When you detect over-voltage (e.g., over 5.5V), disable the motor driver EN signal: this stops the regeneration and lets the motor coast freely. Adding some electrolytic capacitance on the DC bus slows down the voltage rise so that the requirements for your safety circuit reaction speed are relaxed. The combination of high-capacitance, high-ESR (i.e., electrolytic), and small-capacitance, low-ESR, low-inductance (i.e., ceramic) local bypassing, is highly recommendable anyway. There is still one caveat: if there is an external force that drives the motor quickly enough (actually quicker than it would rotate with your 5V supply at 100%!) - then it will still generate voltage which gets to your DC link through the freewheeling diodes. Often this is not a problem since it doesn't happen with just inertia, but bear this in mind if the user is capable of rotating the motor quickly. Very relevant in vehicles that may go downhill, for example. |
| gaminn:
--- Quote from: Doctorandus_P on February 07, 2019, 01:17:53 pm ---A simple option is to add a small P-channel MOSfet in the 5V USB line and switch it very slowly with an RC on the gate. Just extending the charge time of the bulk Elco to 10ms or so makes a significant difference, but ideally you should keep the charge current within the USB spec. If this MOSfet switch is under uC controll you can also turn it on only after the connectors are properly mated. With these precautions you can easily put extremely big capactiors on an USB bus. --- End quote --- I will probably do it this way as this solution seems to be the cheapest and from what I tested I can see it helps enough. --- Quote from: Siwastaja on February 07, 2019, 01:41:03 pm ---When you detect over-voltage (e.g., over 5.5V), disable the motor driver EN signal: this stops the regeneration and lets the motor coast freely. --- End quote --- This is not possible - I can't leave motor out of control. My device then wouldn't work as intended. I just have to eliminate the overvoltage, it can't happen --- Quote from: Siwastaja on February 07, 2019, 01:41:03 pm ---There is still one caveat: if there is an external force that drives the motor quickly enough (actually quicker than it would rotate with your 5V supply at 100%!) - then it will still generate voltage which gets to your DC link through the freewheeling diodes. Often this is not a problem since it doesn't happen with just inertia, but bear this in mind if the user is capable of rotating the motor quickly. Very relevant in vehicles that may go downhill, for example. --- End quote --- Fortunately, this can't happen during normal operation of my device. |
| VanitarNordic:
try to build this circuit |
| Navigation |
| Message Index |
| Previous page |