Pages: [1]   Go Down
Author Topic: RC-car motor help.  (Read 557 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi! I'm pretty new at this so bare with me on this one smiley

I'm trying to use the motor shield to power my rc-car.
When i run my code all it does is sounding "beeeeep" .. guessing its not getting enough power?
The battery alone can run the motor no questions since it was used while the rc-car was original.
It has 7.4V and 5300mah.





The code I'm using is from some example i found and modified a bit so its not optimal I think:

Code:
//int pwm_a = 10; //PWM control for motor outputs 1 and 2 is on digital pin 10
int pwm_a = 3;  //PWM control for motor outputs 1 and 2 is on digital pin 3
int pwm_b = 11;  //PWM control for motor outputs 3 and 4 is on digital pin 11
int dir_a = 12;  //dir control for motor outputs 1 and 2 is on digital pin 12
int dir_b = 13;  //dir control for motor outputs 3 and 4 is on digital pin 13


void setup()
{
  pinMode(pwm_a, OUTPUT);  //Set control pins to be outputs
  pinMode(pwm_b, OUTPUT);
  pinMode(dir_a, OUTPUT);
  pinMode(dir_b, OUTPUT);
  
//  analogWrite(pwm_a, 200);        
  //set both motors to run at (100/255 = 39)% duty cycle (slow)  
  analogWrite(pwm_b, 200);
  
}

void loop()
{

  digitalWrite(dir_b, LOW);  //Set motor direction, 3 high, 4 low
  
  delay(5000);
  
 
  //set both motors to run at 100% duty cycle (fast)
  analogWrite(pwm_b, 255);
  
  delay(5000);
  

  digitalWrite(dir_b, HIGH);  //Reverse motor direction, 3 low, 4 high
  
  delay(5000);
  
  //set both motors to run at (100/255 = 39)% duty cycle  
  analogWrite(pwm_b, 100);
  
  delay(5000);
}
Logged

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 394
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which motor shield are you using?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using Arduino Motor Shield rev 3
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5572
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using Arduino Motor Shield rev 3

That uses the SMT version of the L298 - which can only supply up to 2A of current per on-board h-bridge (unless you parallel the two bridges, in which case it can supply 4A). Note that these values are only possible with a fairly large heatsink on the chip, which that board doesn't have.

You should also be aware that you will drop around 2 volts or so using the L298, so if you want your motor to run at the speed it was before, you need a higher voltage battery. Also, what is the stall current and free-running current of your motor? This is very important; if the stall current is higher than than what the L298 can supply, then it might not be able to start rotating. The free-running current will be less than the stall current, so will the "loaded" current (which will be higher than the free-running current). You need to know all of these in order to know if the h-bridge will work (as well as whether the h-bridge is sized properly; with that bridge, you could probably get away with a motor that only needed about 1A of current - it would run hot, but likely not need a heatsink - though it would be better if it had one; if however your motor needed 1.75A of current, you would want to put a heatsink on it - perhaps with active forced cooling with a fan).

Also - see those alligator clips you are using - those things are notorious for having high resistance, especially in motor driving circuits. The clips don't make a perfect contact, and depending on how cheap they are, the wires in them may only be a few strands wrapped around the clips (not even soldered!). They are generally no where near what is really needed for the motor connection (you want low-resistance connections; soldered, crimped, or at least screwed down is best - and you want to match the same gauge of wire that the motor already uses).
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK! you gave me a lot to think about smiley Thanks for the answer and bringing me some clarity!
Logged

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 394
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
uses the SMT version of the L298

A surface mount L298 ???  The only justification for these old chips is a dip socket version, so you can throw it away if it burns out. 
Perhaps sale of these boards should be accompanied by a surgeon general's warning  smiley-wink
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5572
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A surface mount L298 ???  The only justification for these old chips is a dip socket version, so you can throw it away if it burns out. 

Well - the standard multiwatt L298 that you do see - the thru-hole part - isn't DIP socket compatible (one row of pins is offset by 0.05" from the other - though the pin spacing of each row is 0.1" - why they did that, I don't know). But yeah - thru-hole is nice. It'd be nice if there were an easy thru-hole "high-current" mosfet driver IC. There are few SMT h-bridges out there that don't look insanely difficult to solder...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: