go away spammer

Author Topic: 5V Power  (Read 2048 times)

0 Members and 1 Guest are viewing this topic.

Offline rbtyingTopic starter

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
5V Power
« 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.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: 5V Power
« Reply #1 on: September 22, 2010, 07:49:18 AM »
What pins are you using on the SN745510? Just wondering if some are left floating which then disable the output
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: 5V Power
« Reply #2 on: September 22, 2010, 08:49:52 AM »
Is the control lines from the processor failing or is the power to the motors failing?

Offline rbtyingTopic starter

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: 5V Power
« Reply #3 on: September 22, 2010, 08:51:14 AM »
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. 
« Last Edit: September 22, 2010, 08:58:32 AM by rbtying »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: 5V Power
« Reply #4 on: September 22, 2010, 10:15:52 AM »
Is it a code problem? Does it stop sending the controls after the same time delay?
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline rbtyingTopic starter

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: 5V Power
« Reply #5 on: September 22, 2010, 02:24:22 PM »
Hm... the time delay is quite variable:

Code: [Select]
#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?

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: 5V Power
« Reply #6 on: September 22, 2010, 02:43:47 PM »
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.

Offline rbtyingTopic starter

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: 5V Power
« Reply #7 on: September 22, 2010, 08:48:29 PM »
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.

 


Get Your Ad Here