BS2sx simultaneous 3 DC brished motor control
mrbillhol
Posts: 2
I want to simultaneously control 3 DC brushed motors (with an external H bridge) with a single BS2sx. There is only one PWM output. Using the PAUSE command in conjunction with PULSEOUT (for 2 more PWM channels) seems to stop all program execution until it times out. While it is timing out, the 2nd motor PWM code is paused. Is it possible to simultaneously control 3 DC brushed motors (not RC synchro motors)? In other words, all three DC brushed motors need to be in motion and controlled simultaneously
Comments
A cheap solution to an external controller would be to use something like a 555 timer to generate the PWM signal and control that with a digital pot. The BS2sx could certainly provide the direction / on-off signal for the H-Bridge as well as control the digital pot. The external circuitry would "chop" the signal from the BS2sx with the signal from the 555 timer to provide speed control
" The Parallax HB-25 Motor Controller is our single best solution for DC motor control. This module is dependable and highly-compatible with any microcontroller that can generate a servo compatible pulse. In the simplest sense the HB-25 allows a DC Motor to be controlled much like a Continuous Rotation Servo. While the signals are compatible, the HB-25 does not require refreshing as a servo does; a single pulse can maintain the output."
Depending on what else the BS2sx has to do, it can probably update the HB-25's fast enough that the motors will appear to change speed simultaneously.
There are also other motor controls on the market that allow a single serial instruction to change the speed of multiple motors at once.
Cheers,
What I'm getting at is if the freq is low enough, your MIGHT be able to hard code your own PULSOUT instruction, something like:
'setup the motor #1(x), #2(y) and #3(z) output frequencies
x=1
y=2
z=1
main:
OUT1 = 1
pause x
OUT1 = 0
OUT2 = 1
pause y
OUT2 = 0
OUT3 = 1
pause z
OUT3 = 0
GOTO main
It won't control three truly simultaneous but it might appear that way.... I wonder if it'll work?