PWM to Analog

Status
Not open for further replies.

Draqo

New Member
I have only a brief understanding of circuitry so bare with me.

I need to convert a pulse width modulation signal into a 0 to +5v analog signal. The PWM can be supplied with 7.2 volts DC 700 mA. Pulse widths are 1ms to 2ms, where 1 ms is 0%, 1.5ms is 50%, and 2ms is 100%. The analog outputs are 256 values, where 0 is 0V, and 255 is +5V. Pulse width sensitivity is also 256 values given the pulse width.
 

Presumably these are radio control servo signals?, what are you wanting to do?, and why do you need a 0-5V signal?.

Assuming they are radio control servo signals?, but the voltage is too high, and the current FAR too high - although current depends on the load, not the source.
 

Fixed frequency of 500Hz? Use a counter to count on-time of cycle and output value to 8 bit D/A with filter. Be sure to provide some adjustment feature so that final circuit can be calibrated at 0V & 5V. Is this the kind of thing you are asking about?
 
This is what I'm doing...

Computer =>>
(RS-232 Program Port) =>>
(IFI MiniRobot Controller) =>>
PWM Out =>>
(INSERT CONVERSION HERE) =>>
DB15 Joystick analog pins =>>
IFI Full-Size Operator Interface Joystick Port

-OR-

An application for a RS-232 (From PC) to 4 pin analog signal (Joystick port) to emulate the 4 analog signals on a common joystick.

Computer RS-232 serial port (DB9)=>>
(INSERT CONVERSION HERE) =>>
DB15 Joystick analog pins =>>
IFI Full-Size Operator Interface's Joystick Port
 
puting an cap an resistor shod do it.

the PWM is charging an cap but the cap is dicharging thru a resistor.The longer the pulese me more charge will it pump in th the cap

you may want to use an potencimeter to set it
 

A joystick doesn't output a voltage, it's simply a variable resistor, and only uses a small part of it's range. Unless you have something which requires a 0-5V signal?, you can't simply feed a 0-5V signal in where a joy stick should be.
 
I know Joysticks are just potentionmeters that loop-back resistence, I'm trying to simulate that resistence. Oh, I was fiddling with Electronics Workbench to do a simple capacitor cut of a PWM signal and it worked pretty well for a DC voltage. With a given pulse width I can control the voltage, but I'm not sure how to tanslate that into an output resistance using the +5v feed from a joystick port to the app and then to the designated analog pins.

If anyone can help me with this I much appreciate it.

Current App:
(The X1 & X2 would be the pins on the joystick port.)
 

Attachments

  • pwm.jpg
    22 KB · Views: 1,195
I dont get it .What are you trying to do whith the joystic. Or do you wan to read te joyticks position whith an PIC(thats simple to do it the PIC has A/D converter)?

let me make my self clear:
What do you want to do whith the joysrick and the PIC?
 
I want a computer (a PC or laptop) to be a joystick for another computer.

It's a long story, but filled with promises.
 
the game port works on resistance betwen ground(im not shue is its ground)

so you wod need an transistor to act as an resistor in your circuit

il draw you an circuit in a minute
 
Here it is

its in a simulaton

replayce the 10KOhm whith an potencimeter to set range
 

Attachments

  • pwm_to_analog.gif
    2.6 KB · Views: 1,177
I found out that using PWM's might not be a good solution for doing percision value changes (to the closest 2 value difference eg. 127 = 125 to 129)

So, is there an application to have one PC be a joystick for another PC via serial port to converter (a DAC?) to gameport analog pins?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…