Arduino Mega 1280 + Dual MC33926 Motor Controller doesn't wo

Arduino Mega 1280 + Dual MC33926 Motor Controller doesn’t work.

Hi folks,

maybe you can help at my problem.

If I connect the DC-Motor directly to the Power Source (12V, enough Ampere), the motor runs fine.

But I bought this controller to control the motor with the Arduino Mega. Unfortunately, it doesent work. The Arduino Power LED works normal and also the Motor controller keep cool, but nothing happens :frowning:

Maybe I messed up the connections or I have a mistake in my code? I paint the scheme for better understanding.

This is the scheme:

This is the program code:

int M1IN1 = 7;
int M1IN2 = 5;


void setup() {
pinMode (M1IN1, OUTPUT);
pinMode (M1IN2, OUTPUT);
}

void loop() {
digitalWrite (M1IN1, HIGH);
digitalWrite (M1IN2, LOW);
}

If you need any further information, please ask.

Thanks,

Sambo

Edit: The green checkmark means, that i wired the two ports next to each other.

Hi,

M1/D1 is still in its default state, which will disable that channel. Can you also try jumpering M1/D1 to its default-setting pin.

- Ryan

I don’t know why but after i “jumpered” (that means i wired the two ports next to each other, that is jumpering, or?), the motor runs :smiley: I feel the force to control motors, this is awesome :laughing:

At the moment, the one motor runs so slowly, i don’t need to change the speed, so on and off is all I need.

Now I have a second motor.
The other motor(motor 2) is unfortunately a little bit too fast. I would appreciate it, if you could get me on the right track, which pin I have now to jumper so that this works.

My Scheme2:

My Code2:

(Motor 1 is off in this configuration,
motor 2 runs from 0 to 200 and back to 0. Then it waits 2 seconds.)

int M1IN1 = 30;
int M1IN2 = 31;
int M2D2 = 7;
int M2IN1 = 22;
int M2IN2 = 24;


void setup() {
pinMode (M1IN1, OUTPUT);
pinMode (M1IN2, OUTPUT);
pinMode (M2D2, OUTPUT);
pinMode (M2IN1, OUTPUT);
pinMode (M2IN2, OUTPUT);
}

void loop() {
digitalWrite (M1IN2, LOW);
digitalWrite (M1IN1, LOW);
digitalWrite (M2IN1, HIGH);
digitalWrite (M2IN2, LOW);
for (int speeed = 0; speeed < 200; speeed++) {
  analogWrite(M2D2, speeed);
  delay(5);
}

for (int speeed = 200; speeed >= 0; speeed--) {
  analogWrite(M2D2, speeed);
  delay(5);
}
delay(2000);
}

Thanks,

Sambo

Are you saying it is changing speed to fast, or that it is going too fast at the top speed? To fix the first, increase the delay to something more than 5; to fix the second, decrease the top speed to something less than 200.

- Ryan

Hi Ryan,

thank you for your answer. No, I hat the problem that the second motor didn’t run at all.

But after I solderes some wires (before there weren’t fixated) and double checked all, it worked. The code works fine, too.

So I think the topic could marked as solved, everything works fine now :smiley:

Sambo