https://mail-attachment.googleusercontent.com/attachment/u/0/?ui=2&ik=47294a0a1b&view=att&th=13b676d4e9404f89&attid=0.1&disp=inline&safe=1&zw&saduie=AG9B_P9liKGPLjCr0q84vpJptjGa&sadet=1354650307311&sads=fhuGyhRN7b5_0gD2vU28kyKskjs
I cannot get the Motor Driver to operate correctly and I’m pretty sure I have it connected correctly. Any help will be appreciated!
This is my set up for the Motor Driver, since it is messy I will write out the connections as well.
Power Supply: 7.2 V
M1 IN1: LOW
M2 IN1: HIGH
M1 D2: PWM
M1 D1: GND
EN: HIGH
INV: VDD
SLEW: VDD
This is also the code I am using on the Arduino Uno:
int potpin = 1; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int pwmpin = 9;
int in1 = 7;
int in2 = 4;
int en = 12;
void setup()
{
Serial.begin(9600);
pinMode(en,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(in1,OUTPUT);
pinMode(pwmpin,OUTPUT);
}
void loop()
{
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
digitalWrite(en,HIGH);
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 254); // scale it to use it with the servo (value between 0 and 180)
Serial.println(val);
analogWrite(pwmpin,val);
delay(15); //
}
I have tested the PWM to see if it was outputting correctly using an oscillator and it was.
Hello, Jeff.
I am sorry you are having trouble with the Dual MC33926 Motor Driver Carrier.
The link at the top of your post only returned a 404 error.
Could you please describe in what way the motor driver is not operating correctly? What do you expect your system to do and what does it actually do?
How are you power the motors? You did not mention anything connected to VIN. Also, you will need to make sure all the grounds in your system are connected. Please provide a new list with all of your connections.
Are you trying to drive motor 1? You wrote “M2 IN1” but I’m pretty sure you meant “M1 IN2”. It would be a good to post some pictures showing all of your connections so we can double check them. You can use the “Upload attachment” button" while writing your reply.
–David
Sorry I wasn’t sure if that link would work or not.
The motor isn’t even getting any voltage or running.
I have the VIN by the motor outs set at 7.2V and the VIN on the other side hooked up to 7.2V as well. I also have VDD only hooked up to the default jumpers of SLEW and INV. Do you have to have the GND of all the default jumpers connected? If so that could be one of the problems.
M1 IN1: LOW
M1 IN2: HIGH
M1 D2: PWM
M1 D1: GND
EN: HIGH
INV: VDD default jumper
SLEW: VDD default jumper
VIN: 7.2V
GND
In the picture it may look like power and ground are connected to the same row but it’s just the way the picture was taken.
I’m not sure the picture was visible to you or not, just re-posting it just in case.
Made a few changes but still is not working. Do not currently have a picture but will send one later.
M2 D1: GND default jumper
M1 IN1: LOW
M1 IN2: HIGH
M1 D2: PWM
M1 D1: GND default jumper
M1 FB: GND through resistor
M1 SF: HIGH from arduino
EN: HIGH from arduino
INV: VDD default jumper
SLEW: VDD default jumper
VIN: 7.2V
GND
VDD: 3.3V from Arduino Uno
Here is the code I am using:
int potpin = 1; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int pwmpin = 9;
int m1IN1 = 7;
int m1IN2 = 4;
int en = 12;
int m1SF = 2;
void setup()
{
Serial.begin(9600);
pinMode(en,OUTPUT);
pinMode(m1SF,OUTPUT);
pinMode(m1IN2,OUTPUT);
pinMode(m1IN1,OUTPUT);
pinMode(pwmpin,OUTPUT);
}
void loop()
{
digitalWrite(m1IN1,LOW);
digitalWrite(m1IN2,HIGH);
digitalWrite(m1SF,HIGH);
digitalWrite(en,HIGH);
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 254); // scale it (value between 0 and 180)
Serial.println(val);
analogWrite(pwmpin,val);
delay(15);
}
You should just leave the FB pins disconnected for now. There is already a resistor to ground on the board.
You should also leave the SF output pins disconnected and it would be informative to measure the voltage on them with a multimeter.
At first glance it looks like the datasheet doesn’t forbid it, but it is unusual to provide 3.3 V to the driver’s VDD while providing 5 V as the high level to all of the logic inputs. Please supply 5V to VDD.
Also, I recommend simplifying your code even more in case the problem is there. You don’t need to use PWM (analogWrite) to just make the motor drive at full speed. So the code should just set some outputs as high or low in the setup() function and do nothing else.
When you post a picture, please post it in the largest resolution possible. Also, please provide a close-up of the driver so we can examine your soldering.
–David
I disconnected the FB and SF pins and I connected it to the 5V from the Arduino Uno and it still did not work. I then tried to run it without PWM and 100% forward by setting it up like page 16 on the datasheet and it still did not work. I feel like using a shield would probably be the the best option for me to get but I have already spent 30 dollars on this one.
I took a picture of the soldering like you asked but it was taken by the iPhone and it tried to keep focusing so this was the best I could get of a picture of the soldering. It’s also too big for the page but I think if you copy the image URL it will show up completely in a separate tab.
Hello. Sorry for the delayed reply!
Earlier, you listed these connections:
EN: HIGH from arduino
INV: VDD default jumper
SLEW: VDD default jumper
However, I noticed that in your pictures you didn’t actually solder a pin to EN, INV, or SLEW. Instead, you soldered pins to the VDD connection points that are next to EN, INV, and SLEW. You need to carefully follow the lines that are drawn on the back of the board to see which pin is which. Also, all the I/O pins are on the edge of the board. INV and SLEW won’t help you get the motor running so don’t worry about those for now. Please make sure you drive EN high.
–David