Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: rbtying on September 21, 2010, 11:34:04 PM
-
I've been having some issues with powering my robot's microcontrollers recently. Currently the setup is as such:
11.1V LiPo -> Motor Vin & GND
7.4V LiPo -> Arduino Mega barrel jack (Vin/GND)
Arduino Vcc -> ATMega328 Vcc -> SN745510 Vcc1
Arduino GND -> ATMega328 GND -> SN745510 GND
The problem is that the motors will start spinning, then suddenly stop after about 3-5 seconds. Since the entire system works as expected when an external +5v is applied (from voltage supply and from USB programmer), I think the problem's with the regulator; however, it doesn't heat up or anything. Any ideas for a solution? Thanks in advance.
-
What pins are you using on the SN745510? Just wondering if some are left floating which then disable the output
-
Is the control lines from the processor failing or is the power to the motors failing?
-
I'm using all of them (all four half-H-Bridges), something like this:
_
P09 | | +5v
P08 | | P12
M1A | | M2A
GND | | GND
GND | | GND
M1B | | M2B
P07 | | P11
BAT | | P10
P* are Arduino pins, with 9 and 10 being the EnablePin PWM.
Waltr,
I have not checked if it's control lines or power to motors, I'll respond back in a few minutes.
---EDIT---
The control lines are failing, although both enable pins are working properly, the voltage to the input lines is 0v on both.
-
Is it a code problem? Does it stop sending the controls after the same time delay?
-
Hm... the time delay is quite variable:
#define EN_1 9
#define EN_2 10
#define M1_A 7
#define M1_B 8
#define M2_A 11
#define M2_B 12
void setup() {
analogWrite(EN_1, 255);
analogWrite(EN_2, 255);
pinMode(M1_A, OUTPUT);
pinMode(M1_B, OUTPUT);
digitalWrite(M1_A, HIGH);
digitalWrite(M1_B, LOW);
pinMode(M2_A, OUTPUT);
pinMode(M2_B, OUTPUT);
digitalWrite(M2_A, HIGH);
digitalWrite(M2_B, LOW);
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
digitalWrite(M1_A, HIGH);
digitalWrite(M1_B, LOW);
digitalWrite(M2_A, HIGH);
digitalWrite(M2_B, LOW);
}
It continuously writes the values out. I think a lot of you are forgetting the problem doesn't appear when using an external supply, so I think it must be something to do with the regulator?
-
Could be noise. Try adding a .1uF and 10uF capacitor to both the Motor VIN and Arduino VIN.
Try adding a Serial.Println() to your loop function, and watch the output in a terminal. If it stops printing out when the motors stop, your Arduino is resetting and locking out.
-
You're right, it was noise. I put in the capacitors, and everything worked, so I'm happy for now... time to build the rest.