Rover 5 motor not working in low

Hey all,

I have recently started my luck at integrated circuits and electronics, and my first project is to make a Dagu rover 5 powered by a 4 motor controller and an arduino uno. for some reason one of the motors only works when I have it in HIGH output mode. I don’t know if I did something wrong with the coding or if it is the motor that doesn’t work. this is my coding: (I’m currently working on debugging mostly void backwards and void forwards)

const int E1 = 9;  //M1 Speed Control //PWM input, green
const int E2 = 10; //M2 Speed Control
const int E3 = 11;  //M3 Speed Control
const int E4 = 6;  //M4 Speed Control
const int M1 = 12;  //M1 Direction Control //digital input, yellow
const int M2 = 4; //M2 Direction Control
const int M3 = 8;  //M3 Direction Control
const int M4 = 2;  //M4 Direction Control

void setup()
{
  pinMode(E1, OUTPUT);
  pinMode(E2, OUTPUT);
  pinMode(E3, OUTPUT);
  pinMode(E4, OUTPUT);
  pinMode(M1, OUTPUT);
  pinMode(M2, OUTPUT);
  pinMode(M3, OUTPUT);
  pinMode(M4, OUTPUT);
}

void loop()
{
  straight();
  delay(4000);
  
  stop();
  while(true){}
}

void slowleft()
{
  analogWrite  (E1, 255);
  analogWrite  (E2, 0);
  analogWrite  (E3, 255);
  analogWrite  (E4, 0);
  digitalWrite (M1, HIGH);
  digitalWrite (M3, HIGH);
  digitalWrite (M4, HIGH);
  digitalWrite (M2, HIGH);
}

void slowright()
{
  analogWrite (E1, 0);
  analogWrite (E2, 255);
  analogWrite (E3, 0);
  analogWrite (E4, 255);
  digitalWrite(M2, HIGH);
  digitalWrite(M4, HIGH);
}
void fastleft()
{
  analogWrite  (E1, 255);
  digitalWrite (M1, HIGH);
  analogWrite  (E2, 255);
  digitalWrite (M2, HIGH);
  analogWrite  (E3, 255);
  digitalWrite (M3, HIGH);
  analogWrite  (E4, 255);
  digitalWrite (E4, HIGH);
}
void fastright()
{
  analogWrite  (E1, 255);
  digitalWrite (M1, LOW);
  analogWrite  (E2, 255);
  digitalWrite (M2, LOW);
  analogWrite  (E3, 255);
  digitalWrite (M3, LOW);
  analogWrite  (E4, 255);
  digitalWrite (E4, LOW);
}
void straight()
{
  analogWrite  (E1, 255);
  digitalWrite (M1, LOW);
  analogWrite  (E2, 255);
  digitalWrite (M2, LOW);
  analogWrite  (E3, 255);
  digitalWrite (M3, HIGH);
  analogWrite  (E4, 255);
  digitalWrite (E4, LOW);
}
void backwards()
{
  analogWrite  (E1, 255);
  digitalWrite (M1, HIGH);
  analogWrite  (E2, 255);
  digitalWrite (M2, HIGH);
  analogWrite  (E3, 255);
  digitalWrite (M3, LOW);
  analogWrite  (E4, 255);
  digitalWrite (E4, HIGH);
  delay (6000);
}
void stop()
{
  analogWrite  (E1, 0);
  analogWrite  (E2, 0);
  analogWrite  (E3, 0);
  analogWrite  (E4, 0);
}

Thanks all for the help! :sunglasses:

It would be nice to know how you wired it all up and what motor controller you are using.

What happens if you temporarely swap motors. Does the problem follow the motor or the controller?

How about if you swap control signals to the motor controller. Does the problem stick with the IO port of the motor controller?

Well it is wired through the Dagu 4 motor controller https://www.sparkfun.com/products/11593 and I have the direction output doing to a digital pin on my uno, the pwm going to pwm, and the current to positive and obviously ground to ground. The controller is an arduino uno

okay sky sweeny I tried what you asked. I tried switching the motors and the control signals to the controller. it doesn’t seem to make a difference. the problem still exists. when I switch the white wires going to the motor controller the problem seems to stick to the channel 4 port on the motor controller. does that mean that there is something wrong with the controller?