Pages: 1 [2] 3   Go Down
 Author Topic: Autonomous Robot, motor driver  (Read 2132 times) 0 Members and 1 Guest are viewing this topic.
Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #15 on: February 22, 2013, 02:33:04 pm » Bigger Smaller Reset

Yes the code may works perfectl, but it seems to run the motors at 255 which is full speed. When you try to get the wheels to move the robot at full speed immediately, it stalls. But if you do an analogWrite(pin, 10) followed by a short delay and an analogWrite(pin, 20) etc etc it might start moving.

But instead of hard-coding the 10 and 20 etc into a zillion analogWrites, you would increment a variable called speed and have analogWrite(pin, speed) to get it up to speed gradually.

Thanks for the help, I'm going to try it now, I understood the concept but where would I increment "speed"? in what part of my code would i place it I'm just confused there?

also, my professor stated "The problem is too much load. If it works fine with the wheels off the ground the you know what the problem is.  adding a fan will help. " what do you think?
 Logged

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #16 on: February 22, 2013, 03:05:50 pm » Bigger Smaller Reset

Yes the code may works perfectl, but it seems to run the motors at 255 which is full speed. When you try to get the wheels to move the robot at full speed immediately, it stalls. But if you do an analogWrite(pin, 10) followed by a short delay and an analogWrite(pin, 20) etc etc it might start moving.

But instead of hard-coding the 10 and 20 etc into a zillion analogWrites, you would increment a variable called speed and have analogWrite(pin, speed) to get it up to speed gradually.

Code:
int speeds=0;
int speedstep=10;
if ( 127 > turn ){
drive_Left();
for (i=0; i < 255; i++)
{
speeds=speeds+speedstep;
analogWrite(PWML, speeds);// speed control
}
}

correct?
 « Last Edit: February 22, 2013, 03:08:47 pm by husein06 » Logged

Queens, New York
Offline
Karma: 59
Posts: 2731
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
 « Reply #17 on: February 22, 2013, 03:09:26 pm » Bigger Smaller Reset

You should add a small delay in there to see the change. Also for that particular segment, I would swap analogWrite(PWML, speed), with analogWrite(PWML, i);//
 Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #18 on: February 22, 2013, 03:26:57 pm » Bigger Smaller Reset

You should add a small delay in there to see the change. Also for that particular segment, I would swap analogWrite(PWML, speed), with analogWrite(PWML, i);//

I just tried it, worked in the Air, again put it on the carpet and it stalled.

Attached are the pictures of my bot. Did I install the motors the wrong way? Should the motor and bracket be above the chassis?

WHY THE STALL! lol its getting frustrating
 photo 2.JPG (680.52 KB, 1632x1224 - viewed 19 times.)  photo 1.JPG (704.67 KB, 1632x1224 - viewed 16 times.) « Last Edit: February 22, 2013, 03:29:00 pm by husein06 » Logged

Queens, New York
Offline
Karma: 59
Posts: 2731
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
 « Reply #19 on: February 22, 2013, 03:33:05 pm » Bigger Smaller Reset

My guess would be the mass of the chassis. And the fact that your on carpet doesn't help either.
 Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #20 on: February 22, 2013, 03:40:14 pm » Bigger Smaller Reset

My guess would be the mass of the chassis. And the fact that your on carpet doesn't help either.

The weight of the whole robot is 5.7 pounds, each motor weighs 1 pound, so the chassis is 3.7 pounds very light material.

The motors are supposedly powerful, I thought they will handle something like this.

Is the weight appropriate? maybe the chassis is too long?
 Logged

Queens, New York
Offline
Karma: 59
Posts: 2731
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
 « Reply #21 on: February 22, 2013, 03:45:48 pm » Bigger Smaller Reset

Try this, pick the robot up and run the motors. Then using your finger try to slowly apply pressure to the wheel and see how much pressure it takes to stop it. Do you or can you post a schematic of your design? It is possible that your motors are not getting enough current, so you will need another or better battery.
 Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #22 on: February 22, 2013, 04:10:56 pm » Bigger Smaller Reset

Try this, pick the robot up and run the motors. Then using your finger try to slowly apply pressure to the wheel and see how much pressure it takes to stop it. Do you or can you post a schematic of your design? It is possible that your motors are not getting enough current, so you will need another or better battery.
http://www.robotshop.com/bat-04-7-2v-ni-mh-rechargeable-battery.html
Im using that battery, 7.2V / 2800 mAH Ni-MH Rechargeable Battery , its fully charged for the motors.

For my entire circuit and arduino I'm using a 9 volt battery, (I gotta find a replacement for that, its running out every 10 minutes)

My professor keeps stating "You do not have enough torque. Use a motor operated fan to cool the motor driver"
 Logged

texas
Offline
God Member
Karma: 27
Posts: 862
 « Reply #23 on: February 22, 2013, 05:28:09 pm » Bigger Smaller Reset

Quote from: husein06
My professor keeps stating "You do not have enough torque. Use a motor operated fan to cool the motor driver"
[/quote

Don't you think you might ought to listen to him?  I also told you that it wouldn't take much to overheat that controller.  One important thing you need to take into consideration is derating your parts as temperatures go up.  Those specs you gave are likely for the controller when it is at 25C.
 Logged

Experience, it's what you get when you were expecting something else.

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #24 on: February 22, 2013, 05:46:09 pm » Bigger Smaller Reset

[quote author=husein06
My professor keeps stating "You do not have enough torque. Use a motor operated fan to cool the motor driver"

Don't you think you might ought to listen to him?  I also told you that it wouldn't take much to overheat that controller.  One important thing you need to take into consideration is derating your parts as temperatures go up.  Those specs you gave are likely for the controller when it is at 25C.
I just cant grasp how a fan over my motor driver will help my robot drive? will a fan really cool off the warming of current that much?
and I'm just trying to learn and ask here dont fight me lol
 « Last Edit: February 22, 2013, 06:04:45 pm by husein06 » Logged

Queens, New York
Offline
Karma: 59
Posts: 2731
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
 « Reply #25 on: February 22, 2013, 06:12:57 pm » Bigger Smaller Reset

Ok try this, bypass the motor controller altogether. Wire the motors directly to the battery and see if it is able to move.

If your 7.2V battery is only powering the motors and it is able to move with a direct connection, then the problem is with your motor controller.

If it still does not work, even with a direct connection, then it is your battery.

Do this little test, and you will finally find the culprit to your problem.
 « Last Edit: February 22, 2013, 06:15:31 pm by HazardsMind » Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #26 on: February 22, 2013, 07:35:21 pm » Bigger Smaller Reset

Ok try this, bypass the motor controller altogether. Wire the motors directly to the battery and see if it is able to move.

If your 7.2V battery is only powering the motors and it is able to move with a direct connection, then the problem is with your motor controller.

If it still does not work, even with a direct connection, then it is your battery.

Do this little test, and you will finally find the culprit to your problem.
I'm going to do that right now!! check back for my reply!

 Logged

Offline
Jr. Member
Karma: 0
Posts: 53
 « Reply #27 on: February 22, 2013, 08:00:30 pm » Bigger Smaller Reset

Ok try this, bypass the motor controller altogether. Wire the motors directly to the battery and see if it is able to move.

If your 7.2V battery is only powering the motors and it is able to move with a direct connection, then the problem is with your motor controller.

If it still does not work, even with a direct connection, then it is your battery.

Do this little test, and you will finally find the culprit to your problem.
GREAT NEWS!!!! I put that battery directly to those motors and it went forward about 10 yards in 1 second! lol So on the bright side we now know the problem is the motor driver, this is the one I was using:
http://www.pololu.com/catalog/product/1213
What do you think is the problem, I'm trying to find a better motor driver!

Thanks for pointing out this simple test!
 Logged

Queens, New York
Offline
Karma: 59
Posts: 2731
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
 « Reply #28 on: February 22, 2013, 09:44:50 pm » Bigger Smaller Reset

I am not familiar with the one you have so I have no clue what the problem is. How about this one.
http://www.ebay.com/itm/L298N-Dual-H-Bridge-IC-Stepper-Motor-Driver-Controller-Board-Module-for-Arduino-/300864612676?pt=LH_DefaultDomain_2&hash=item460ceda944
 Logged

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

0
Offline
Tesla Member
Karma: 104
Posts: 8568
Arduino rocks
 « Reply #29 on: February 22, 2013, 10:59:21 pm » Bigger Smaller Reset

The below is from the pololu 33926 page.

Unlike other H-Bridges, the 33926 has a feature that allows it to gracefully reduce current as the current exceeds 5 A or as the chip temperature approaches its limit. This means that if you push the chip close to its limit, you will see less power to the motor, but it might allow you to avoid a complete shutdown.
 Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.

 Pages: 1 [2] 3   Go Up