PDA

View Full Version : Using DC motors


Guy_E
09-20-2006, 10:51 AM
Hi,
I have another question, but this time rather more complicated.

I have 2 DC motors which I want to connect to the VEX controller. Because they are DC I can't connect them to the PWM port.
My Electronics teacher has suggested me to build 2 small electric circuits using L293 chips that control motors, connect each chip to an amplifier and connect all that to a digital output.

If I do all that, I will we able to simulate a PWM signal, using the digital outputs and a timer.

My problem is that I don't know how to write the code for the PWM control in a way that it will be running simultaneously with the general code of the program.

Can someone help me?

I hope I've made myself clear,

Guy

Andy Brockway
09-20-2006, 11:59 AM
This (http://www.tigoe.net/pcomp/labs/lab-motors.shtml) has a pretty good write up on building the circuit plus it gives you some code to make it all work. It is not discussed at this site but the chip does have a pwm controlled pin for controlling speed. There are many sites that will give similar results if you search using L293.

Here (http://www.kronosrobotics.com/an101/AAN101.shtml) is another site.

Billfred
09-20-2006, 12:03 PM
Hi,
I have another question, but this time rather more complicated.

I have 2 DC motors which I want to connect to the VEX controller. Because they are DC I can't connect them to the PWM port.
My Electronics teacher has suggested me to build 2 small electric circuits using L293 chips that control motors, connect each chip to an amplifier and connect all that to a digital output.

If I do all that, I will we able to simulate a PWM signal, using the digital outputs and a timer.

My problem is that I don't know how to write the code for the PWM control in a way that it will be running simultaneously with the general code of the program.

Can someone help me?

I hope I've made myself clear,

Guy
What kind of DC motors are you working with? If they're 12V (or 24, or 36, or 48), you should be able to interface a Victor directly with the Vex controller's PWM outputs (just use a Y-cable to get the appropriate male-to-male connection). Someone who's more familiar with the Victors can tell you if and how well they handle smaller voltages.

It's less legwork, which may be a good or a bad thing for your project, but there is something to be said for keeping it simple. Hope this helps!

Guy_E
09-20-2006, 12:11 PM
My problem is not with the electrical part.

What I want to know is how to intergrate it with the general vex code. Just to mention, im programming using MPLAB.

Guy_E
09-20-2006, 02:22 PM
What kind of DC motors are you working with? If they're 12V (or 24, or 36, or 48), you should be able to interface a Victor directly with the Vex controller's PWM outputs (just use a Y-cable to get the appropriate male-to-male connection). Someone who's more familiar with the Victors can tell you if and how well they handle smaller voltages.

It's less legwork, which may be a good or a bad thing for your project, but there is something to be said for keeping it simple. Hope this helps!

I wish I could use a victor, but my motors are 6-8V DC .

lukevanoort
09-20-2006, 02:36 PM
I wish I could use a victor, but my motors are 6-8V DC .
The Victor 884 (http://www.ifirobotics.com/victor-884-speed-controller-robots.shtml) is rated for 6-15V.

Guy_E
09-21-2006, 04:28 AM
I think a victor is a little too big for my robot.

Culvan Van Li
09-21-2006, 11:58 AM
Another thing to be aware of is the difference in PWM (pulse width modulated) signals. The VEX motor ports output a PWM signal that has a 1-2ms pulse every 18ms (11% - 22% duty cycle). This is the same style that is used for remote control servos. The Victor88X controllers are designed to take this type of signal.

If you design your own circuit using a L293 (or similar part) you will probably need to generate PWM signals that cover the entire sepectrum of duty cycles (0% to 100%) because you will probably be driving a transistor to drive the motor directly.

I'd also recommend you look into the HB-25 (http://www.parallax.com/search_results.asp?txtsearchParamTxt=HB-25&txtsearchParamCat=ALL&txtsearchParamType=ALL&iLevel=1&txtsearchParamMan=ALL&txtsearchParamVen=ALL&txtFromSearch=fromSearch) from Parallax (http://www.parallax.com/). It functions like the Victor controllers but costs about 1/3 as much. It's a little bit smaller too. I'm currently using these with my VEX controller for cordless drills.

Andy