I hope this is the correct area, I am trying to isolate a hiccup I think may be related to the dagu 4 motor controller card (red).
I am using it on the Rover 5, 4 motor version. Channel 1 and 2 are the right and left front motors, channels 3 and 4 are the rear right and left motors (Channel 1+3 = Right front/rear). The motor power supply is direct from a 7.2 NiMh Batt. The motor Logic is from a 5v regulated supply from the Mega2560.
The problem I am trying to isolate is when the code switches the motors to reverse. My rear 2 motors stop running if the speed is set to 120.
I rewrote the code to experiment with this annomily, only. The rear two motors will not come on with the speed setting of up to 127, but as soon as I hit 128, they start turning (just (+1) above the halfway mark to the max speed of 255)
The only thing I can think of, When I decided to use this board with this platform, I had to reverse the wiring on the rear motors in order to get all 4 to go in the same direction.(required for this motor controller or else would require connecting both left motors/right motors to only 1 channel for each side) So would my front 2 motors, cut out if the forward speed is set below 128? I haven't tested that yet....(the coils on the motor leads have anything to do with it? that is the only wiring difference I can see between the front and rear)
I can't find anything on the motor control or the rover about this... can someone point me toward more info? Do I have something set wrong? Here is the code I used to test the minute settings... I don't see anything wrong with it.
Thank you all!
Ed
//Front Motors setup. Original 2 motors.
#define MOTOR_RF 4 //motor Right Front pin4 (right front pwm/speed signal)
#define DIRECTION_RF 5 //motor Right Front direction pin5 (right front forward/rev)
#define MOTOR_LF 6 //motor Left Front pin6 (left front pwm/speed signal)
#define DIRECTION_LF 7 //motor Left Front direction pin7 (left front forward/rev)
//rear motor setup ** make sure 4 motor control pins are reversed!
#define MOTOR_RR 14 //motor Right Rear pin14 (right rear pwm/speed signal)
#define DIRECTION_RR 15 //motor Right Rear direction pin15 (right rear forward/rev)
#define MOTOR_LR 16 //motor Left Rear pin16 (left rear pwm/speed signal)
#define DIRECTION_LR 17 //motor Left Rear direction pin17 (left rear forward/rev)
void setup()
{
pinMode (MOTOR_RF, OUTPUT); //Front right
pinMode (DIRECTION_RF, OUTPUT); //Front right
pinMode (MOTOR_LF, OUTPUT); //Front left
pinMode (DIRECTION_LF, OUTPUT); //Front left
pinMode (MOTOR_RR, OUTPUT); //rear right
pinMode (DIRECTION_RR, OUTPUT); //rear right
pinMode (MOTOR_LR, OUTPUT); //rear left
pinMode (DIRECTION_LR, OUTPUT); //rear left
}
void loop(){
analogWrite (MOTOR_RF, 128); analogWrite (MOTOR_RR, 128);//speed Motor Right(front/rear)
analogWrite (MOTOR_LF, 128); analogWrite (MOTOR_LR, 128);//speed Motor Left(front/rear)
digitalWrite (DIRECTION_RF,0); digitalWrite (DIRECTION_RR, 0);//direction reverse for Motor Right Front
digitalWrite (DIRECTION_LF,0); digitalWrite (DIRECTION_LR, 0);//direction reverse for Motor Left Front
}