Hello Arduino world,
I need some help on a PWM motor controller that I want to use for a project. Specifically it is the PWM Motor Controller 3A 12-55V from Superdroid Robots. I have the motor inputs figured out and I am testing with a 12 volt battery, using a 24v motor (it just runs slower).
In the testing phase, I hooked a potentiometer to run the motor one direction, varying the speed.
Hookup: Arduino:
Pot center Analog – 0
Pot lead (L) 5v
Pot lead (R) Ground
Motor driver board
Pin G Ground
Pin P (PWM) PWM – 3
Code:
int potpin = A0;
int val;
void setup() {}
void loop() {
val = analogRead(potpin);
val = map(val, 0, 1023, 0, 225);
analogWrite(3, val);
delay(15);
}
Everything worked great with no problems…but as I move forward I am having problems and my searches have me going in circles.
There are 4 IO pins on the motor controller board.
D-direction (0V and 5V will change the direction of the motor)
P-PWM (used in test)
B-brake (0V to the brake will turn the brake off, 5V will turn it on.)
G-Ground (used in test)
I was able to put 5v on the direction pin and the motor would change direction.
I was also able to put 5v on the brake pin and the motor would stop.
Easy enough to add some switches and use the brake and direction feature of the motor controller, but both the break and direction changes are to abrupt.
In a book I have it discuses; “Bi-directional Analog control: Uses a 0-5v analog (or PWM) signal to determine the speed and direction of a motor. In this mode, the center position of 2.5v is considered Neutral. Below 2.5v spins the motor proportionally in Reverse with a0v value yielding 100% Reverse. Above 2.5v spins the motor Forward with a 5v value yielding 100% Forward—this is called “Analog.” “
So I am looking for some help ---- use a potentiometer with my motor controller, for speed control and forward/reverse, as well as using the break input as a kill switch but have the motors slow down to 0,
Thanks
Chris