ARDUINO PWM

Reloadron

Joined Jan 15, 2015
7,891
A motor on start can briefly draw 10X or more its normal run current. You mention a 1.6 amp load under normal run conditions with a locked rotor around 25 amps. Using a 10 amp bridge I would try using a 10 amp fuse inline for each motor. See what that gets you.

The program part all depends on what you want your motors to do. The H Bridge will respond to whatever the Arduino tells it to do.

Ron
 

KeithWalker

Joined Jul 10, 2017
3,608
On an Arduino, a digital output can be set by using "digitalWrite". Writing HIGH to a pin sets it to +5V. Writing a "LOW" sets it to 0. Some of the digital pins of an arduino support Pulse Width Modulation (PWM). By using "analogWrite" you can set the on-off ratio of a digital pin that has PWM capability. 0 is off and 255 is fully on. Any number in between will set the on/off ratio of pulses that the pin will output.
For a soft start, a loop can increment the analogWrite from 0 to 255, with a small delay between steps. This will avoid having large inrush currents when the motor starts.
There are some very good tutorials on-line that explain PWM, with example programs.
 

Thread Starter

beatsal

Joined Jan 21, 2018
425
On an Arduino, a digital output can be set by using "digitalWrite". Writing HIGH to a pin sets it to +5V. Writing a "LOW" sets it to 0. Some of the digital pins of an arduino support Pulse Width Modulation (PWM). By using "analogWrite" you can set the on-off ratio of a digital pin that has PWM capability. 0 is off and 255 is fully on. Any number in between will set the on/off ratio of pulses that the pin will output.
For a soft start, a loop can increment the analogWrite from 0 to 255, with a small delay between steps. This will avoid having large inrush currents when the motor starts.
There are some very good tutorials on-line that explain PWM, with example programs.
"This seems the solution for me - just not sure of the arduino program part"
In my previous post, I referred to your relay solution you had sketched some time back. Not sure how to program this in Arduino i.e. how to program from forward to reverse. I am using the Dafurui which does not have reverse - only forward which works fine - hence have to modify the Arduino program for this i.e. F and R.
 

Reloadron

Joined Jan 15, 2015
7,891
First thing to consider is if you wanted a forward / reverse motor controller you wanted an H-Bridge design.

Next if you wanted along the lines of a L298 you wanted something like this one.

What I see you having is a MOSFET switch which is only capable of driving a motor in a single direction. You can add a DPDT relay to the output of what you have to change direction but then you have your uC (Arduino) driving your MOSFET switch as well as your DPDT relay. Motors do not like going from FWD to REV less a direction change pause.

Your Arduino can only supply about 20 mA on any digital out pin so any relays you drive will likely require a driver transistor.

So your MOSFET switch output will run to a DPDT relay and that relay will be driven by a transistor. You will need a DPDT relay capable of handling your current and DC current not AC current.

Ron
 

KeithWalker

Joined Jul 10, 2017
3,608
To revers a motor you need to add the reversing relay circuit that I posted,connected to a digital output pin on the Arduino. To energize the reverse relay use a "digitalWrite" to make the pin "HIGH" and a "LOW" to de-energize it. Make sure that the motor has completely stopped before either opening or closing the relay contacts by introducing a delay after stopping the motor. The circuit I suggested, using a power MOSFET with a reversing relay works well if you do that and use a soft start.
 
Top