PLUS+1 User Forum

PLUS+1 Hardware => I/O Modules => Topic started by: paterianus on March 22, 2012, 04:51:27 PM

Title: Analog Output
Post by: paterianus on March 22, 2012, 04:51:27 PM
I need a 0-5VDC analog output.  It appears that the only way to do this is to put a load resistor accross a PWM output.  Has anyone done this and how did you configure it?  Do I need a filtering capacitor?
Title: Re: Analog Output
Post by: 240glt on March 23, 2012, 12:58:14 PM
Hi. I did this on a MC090-010, with a PWM output (c1p29).
PinConfig: 3
DitherAmp: 0

A made a low-pass filter, with two zener diodes (for safety).
I controlled a charger, with a 0-5V input to control the charging current. In my case, I didn't need to change the signal fast. I was more interested in having a smooth voltage. I made a small PCB with three connectors (there are two chargers to control).

The first resistor and zener diode limits the PWM signal to 5,6V peak. Then we have a lowpass filter, with a cutoff frequency of 16Hz. After that a zener diode again, to limit the maximum voltage to 5,1V. I did this for a few years ago, so I don't remember if the output are linear. If you want to try it, you have to do some tests to see if it is smooth enough, if the response to a changing voltage are quick enough, and to see how a certain PWM dutycycle corresponds to a certain voltage.
Title: Re: Analog Output
Post by: paterianus on March 23, 2012, 07:36:51 PM
Thanks, I'll give this a try.  It looks exactly like what I'm looking for.
Title: Re: Analog Output
Post by: jsaluk on March 24, 2012, 05:57:43 PM
I have used a simple PWM output.  I compared 5 vdc to the supply power to establish the max PWM % and then the command was a percentage of that maximum.  I used an MFOut with 4000 Hz frequency.  The valve being controlled seemed quite happy with this command. 
Title: Re: Analog Output
Post by: jhorn22 on March 12, 2014, 02:13:01 AM
I need a much quicker response so I just tweaked the RC time constant, but I have another question.  In the IOX012-010 short data sheet it says under the PWM output section "Analog voltage: open loop PWM at 4000 Hz."  Is that just saying that I should set my PWM to 4k and use an RC filter or is there another way to filter this better?

Title: Re: Analog Output
Post by: oiltronic on April 05, 2014, 08:35:23 PM
It's just saying that the PWM output is open-loop, meaning it doesn't adjust the duty cycle based on any feedback, and that it can go up to 4000Hz if you like.  How you filter it all depends on the current and max ripple voltage you need.