View Full Version : Using DC motors
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
20-09-2006, 12:59
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
20-09-2006, 13:03
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!
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.
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
20-09-2006, 15:36
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.
I think a victor is a little too big for my robot.
Culvan Van Li
21-09-2006, 12:58
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
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.