possible to output PWM to speed controller from PC parallel port ?
Feb 06, 2006 11 Replies
P
pogo
Is it possible to provide PWM output to a speed controller ( such as the Devantech MD03 ) using a PC parallel port ? If possible, I would think there would need to be a background process running to keep telling some controller on the motherboard to output the PWM.)
Has anyone done it ? Any comments ?
Didn't find your answer? Ask the community — no account required.
M
mlw
You can do it with some circuitry, for instance, I am using a Velleman K8000 I/O board. I wire the D/A converter output of the I/O board into a comparator. The other input of the comparator is the ourput of a ramp generator. This produces a PWM signal.
Typically, though, you wouldn't want to drive the PWM directly from the parallel port because you will spend a lot of time in I/O and the frequency will be pretty low.
P
pogo
That tells me exactly what I wanted to know. I didn't really think it would be worth the effort since my thoughts on doing this were to simply reduce the number of extra components / controllers for a PC / mini-ITX based robot.
Thanks !
D
Dale T Stewart
Hi
There seems to be problems with some of the links at the moment, but an excellent site for PC/IO interfacing is at
formatting link
They have tutorials so you can build your own cards, and write code to control motors using PWM!
Cheers
|-]
Dale
D
Dale T Stewart
Hi again
If you use Internet Explorer the links are OK...something wrong with Firefox I think...
Cheers
|-]
P
pogo
Cool! I've been using this guy's TRIPOD code and didn't even know he had a working boondog.com site because everytime I looked for it I got a blank page. Thanks !
P.S. This thread is almost gone on my newsgroup server.
E
Ed Okerson
I have done it using RT Linux. A real time kernel module generates the PWM and a user space program controls it.
Ed
H
howy
About 10 years ago I wrote some experimental code to do servo control all in software on a PC without any buffer circuitry needed. It is very crude and may need some tuning to get the pulses the correct spacing, but it moved a servo to different positions using the UP/DOWN keys....
I now use a Mini SSC RS232 controller
formatting link
make my servo signals (with a USB to RS232 converter).
-howy
this was compiled using borland C.
/////// start of SEROV1.CPP ////// #include #include #include #include
// parallell port address you want to talk to #define PPORT1_DATA 0x03bc
void quit_pgm (void);
void main(void) { int i,j,w=1; long x;
for(;;) { if(w
H
howy
About 10 years ago I wrote some experimental code to do it all in software on a PC without any buffer circuitry needed. It is very crude and needs tuning to get the pulses the correct spacing, but it moved a servo to different positions using the UP/DOWN keys....
-howy
this was compiled using borland C.
/////// start of SEROV1.CPP ////// #include #include #include #include
// parallell port address you want to talk to #define PPORT1_DATA 0x03bc
void quit_pgm (void);
void main(void) { int i,j,w=1; long x;
for(;;) { if(w
M
Matthias Melcher
This will not work with todays PCs anymore because WIndows messes up your timing in the 'for' loop. Actually, a good compiler will remove the 'fro' loop entirely when optimizing. And last but not least, there is no outportb command on WIn2k/XP anymore. The parallelport can only be talked to via drivers.
E
Ed Okerson
I don't run Windoze on my modern PC. Under other operating systems this is not so difficult.
S
steamer
--Works great with a Victor controller and a Stamp. I've done this to run those DC windshield wiper motors. Watch out for capacitor drift..
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.