Pages: 1 [2]   Go Down
Author Topic: Arduino resetting when running 2WD platform, why?  (Read 2918 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I am using the yellow geared motors which come with the 2WD arduino chassis.

I am having a problem with my motor control. I am using an L293E motor driver with 4 flyback diodes, and a 100nf capacitor accross the motor input. The flyback diodes are to prevent the high inductance voltage spike and the capacitor blocks out high frequency noise.

I wrote a simple program where i press a push button, and the motor runs for 5 seconds then stops. The motor works beautifully when i set the enable pin to HIGH, but when i apply PWM on this pin, the motor gives this weird "whistling" noise and it does not spin at all.

I am using a single power supply of rechargeable batteries with 2700mah capacity (6.5V). This is more than sufficient i believe. I have two LM317 regulators connected to the battery. One is used to produce 5V for the microcontroller, and the other 4.2V for the motor. (The motor driver drops 1.2V so the motors see 4.2 - 1.2 = 3V).

Any idea what the whistling noise is and how i can eliminate it and get the motor to spin?

I'd be interested to know how any of you guys are controlling the speed of these motors?

Best Regards,
Yuveer
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I am using the yellow geared motors which come with the 2WD arduino chassis.

I am having a problem with my motor control. I am using an L293E motor driver with 4 flyback diodes, and a 100nf capacitor accross the motor input. The flyback diodes are to prevent the high inductance voltage spike and the capacitor blocks out high frequency noise.

I wrote a simple program where i press a push button, and the motor runs for 5 seconds then stops. The motor works beautifully when i set the enable pin to HIGH, but when i apply PWM on this pin, the motor gives this weird "whistling" noise and it does not spin at all.

I am using a single power supply of rechargeable batteries with 2700mah capacity (6.5V). This is more than sufficient i believe. I have two LM317 regulators connected to the battery. One is used to produce 5V for the microcontroller, and the other 4.2V for the motor. (The motor driver drops 1.2V so the motors see 4.2 - 1.2 = 3V).

Any idea what the whistling noise is and how i can eliminate it and get the motor to spin?

I'd be interested to know how any of you guys are controlling the speed of these motors?

Best Regards,
Yuveer

According to the datasheet, at 1A current the motor driver drops 2.6v typical, 3.6v maximum (you need to add the source and sink output saturation voltages together). So 4.2v is a little low.

You should have a large capacitor (say 1000uF) between the L293E VS pin and ground (the ground connection of the capacitor should be close to where the 2 current sense pins and the flyback diodes are connected).

The whistling sound is probably PWM. You may need to increase the PWM frequency to reduce or get rid of it. if you increase the PWM output to near the maximum (255), I would expect the motor to turn anyway.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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

Ok so i have increased the voltage on Vs to 5.5V. I dont have the correct resistor values to get exactly 6V.I have added the 1000uF capacitor on Vs to ground.
I have changed the duty cycle to 255 and you are correct, the whistling goes away and the motor spins quite well. Then i tried reducing the duty cycle to about 190 (75% of max rated rpm), and then the whistling started again.

You see i am designing a robot which can carry a cup of coffee. So i need it to move slowly to avoid spillage. This is the reason i chose to run the motor at 3V (90rpm), and i thought i would play around the the PWM duty cycle and select a decent speed. I learnt that some DC motors dont like PWM and do not work under PWMs less than 40%. I'm not too sure about these motors though.

I have decoupling capacitors everywhere. Could it be the regulator?
Is there anything else i could maybe try?

Wow....ok i just figured this out right now...
It works with the duty cycle of 190, but its very twitchy. The whistle comes, and the motor doesnt move, but if i give the motor a slight push with my hand then it works.
I wonder why...hmmm.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds like the motor torque is only just enough to move the robot at PWM 255. I suggest a higher gear ratio or smaller wheels, which should both increase torque and reduce speed. Alternatively, add a sensor to measure the motor or wheel speed, then you can program it to give the motor a shove at pwm 255 to start it off and reduce the pwm once it is moving.
« Last Edit: September 05, 2011, 12:59:19 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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

Ok so now i am weird problem.

If i connect either motor to the A,B,Enable1 inputs of the motor driver, the motor spins (even with PWM).
But when i try the motor on C,DEnable2, the microcontroller resets (even if no motor is connected to A and B)

It seems like the right hand side of my chip is faulty.
I have a 1000uf cap from Vs going to ground. and i have four 100nf capacitors connected to the motor outputs with 1n4001 diodes. Maybe i need shottky diodes since they're faster? I dont know. Any ideas?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33301
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Any ideas?
I think you have it yourself:-
Quote
It seems like the right hand side of my chip is faulty.
Either that or you have wired it up wrong.
Logged

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

Could the resetting of the micro controller be due to the fact that the batteries are not charged enough to handle the current requirements of the two motors?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33301
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes it could, if the voltage dips that could cause the brown out detector to trip in or just to drop below the threshold.
Logged

Pages: 1 [2]   Go Up
Jump to: