stabilize an inverted pendulum

D

Thread Starter

Derek

how to write program for the dc motor position control(CCW &CW) using PWM with dc driver circuit through parallel port?
HOw to convert the voltage to PWM in order to control the dc motor? programing language using C++
 
I think you'd better expand upon your question.

I'm pretty sure you'll need feedback (i.e. encoder) if you are doing POSITION control on a DC motor.

What are you putting through the parallel port? The fractional duty cycle of your pwm 0-255? or are you actually trying to generate the pulse
out of a pin of the parallel port? (Don't expect to generate pulses directly using a Windows operating system - accurate timing is not
something Windows does).

Where is the voltage coming from for your voltage-to-PWM conversion you are referring to?

If you do have an analog voltage, you could have a d/a and count it from 0 up to full scale each PWM cycle, along with a comparator and use the comparator output for your pulse. Or run it into a d/a and compute and set your PWM arithmetically.

Oh, and one other thing. Are you sure you have to use C++? It scarcely seems appropriate for the application.

Rufus
 
Top