Motor speed & pwm

russbow

Senior Member
Got a motor control working with my 28x1 and the L293D driver chip. Quite happy with the low / high direction controls and was very pleased that I could control the speed by PWMing the driver enable pin.

Question – could the pwm 1 (or 2) pin on the picaxe be connected to both the enable pins? The driver data sheet suggests minimal current requirements.

Then I met the problem – cant use a servo in the same program!

I have had a look at the HPWM commands, and to be honest I get lost.

All I want to do is drive two motors, in either direction, with speed control. Both at the same speed unless one is stopped with a low / low command. From as slow as possible, consistant with a good pulling power, to full speed.

What area hould I investigate next.

Russ
 

jodicalhon

New Member
PWMing both enable pins will give the same speed to both motors, but you will have independent control of the direction of the motors.

A low/low command to a motor will, as you say, stop the motor. So will a high/high for that matter.

I seem to remember that one way (high/high or low/low) consumes less current, but check the datasheet.
 

russbow

Senior Member
Thanks Jo. Seems to work well pwming the enable pins. BUT the problem is that using pwmout screws up servo commands. I need to get my head round hpwm - downward spiral at the moment.

If all else fails, just use another picaxe for the motors.
 

Wrenow

Senior Member
The simplest solution to being able to use servo with motors at the same time is to use a hobby ESC (Electronic Speed Control). These puppies use a servo signal to control a motor's speed and direction. Pretty common in radio control and in robotics. High current draw motors take a pretty hefty ($$$) ESC. Mut, if your motors draw 1A or less at stall, you can use the Vex Robotics contoroller (about USD$10).

For more information and some cautions on ESCs, there is an article entitled "ESCs Lessons Learned" on the http://ntxbg.org web site, in the How To knowledgebase.

By the way, if you are interested in the Vex ESC, it is on the Vex Robotics site under accessories/logic at the bottom of the page. Comes with a 3-pin connector that is made to plug it in to a breadboard.

Cheers,

Wreno
 
Top