PWM to analog circuit troubleshoot - Page 1
Forum section: electronics / beginners

author: Leuven
author_rank: Regular Contributor
timestamp: June 16, 2015, 12:29:21 pm
content: I've got this schematic for PWM to 0-10V convertor. I've put together the circuit and I could almost call it a success, apart from 2 issues:1. The signal on the 0-10V pin coming from the op amp is upside down. It's 0 when it should be 10V, and vice versa. It's the other way around in reference to the PWM signal.2. The source is precisely 10V. The lower and upper limits on the 0-10V pin are 0.4V and 8.9V. They really should be 0 (or at lease closer to) and 10, as it will control the rpm of a spindle motor and at 8.9V it spins at about 10% less than it should. Similarly at 0.4V still jerks slightly when it should be completely stationary.Any suggestions?

author: w2aew
author_rank: Super Contributor
timestamp: June 16, 2015, 12:49:03 pm
content: Reverse the connections to pins 2 and 3 to invert the phase.What does your load look like - i.e. how much current does it draw? The op amp can't get that close to the rails if the load draws a lot of current. See the VOL and VOH specs on page 9 of the datasheet:http://www.st.com/web/en/resource/technical/document/datasheet/CD00000501.pdf

author: Cliff Matthews
author_rank: Unknown
timestamp: June 16, 2015, 12:49:24 pm
content: 1) Opto circuit is inverting the signal so flip the inputs to IC1a2) Check/adjust voltage divider 47k+47K to get correct output at PWM 5v point3) Output buffer supports just 40ma - don't exceed.Alan types faster

author: Andy Watson
author_rank: Super Contributor
timestamp: June 16, 2015, 12:52:35 pm
content: Quote from: Leuven on June 16, 2015, 12:29:21 pmLook at the action of IC2.QuoteThe limits of the voltage output will be determined by the outputs of the op-amps. Even op-amps that claim to be rail-to-rail will struggle to achieve the last 0.5V (or so) of output swing.QuoteIf you are driving a motor why not switch the PWM directly on to the motor and avoid the power losses in the analogue/linear control?

author: dentaku
author_rank: Frequent Contributor
timestamp: June 16, 2015, 05:43:28 pm
content: Hmm. That could be a useful way to make a crude MIDI to CV converter (for analog synth circuits, VCOs, VCAs,VCFs) without needing a real DAC.

author: Dave
author_rank: Super Contributor
timestamp: June 16, 2015, 06:55:27 pm
content: Quote from: Andy Watson on June 16, 2015, 12:52:35 pmI'm guessing he's generating a 0-10V signal to control a VFD, not a motor directly.

author: LukeW
author_rank: Frequent Contributor
timestamp: June 16, 2015, 08:08:12 pm
content: You didn't substitute the specified opamp for a different model, did you?Is it practical to take the supply voltage a little higher than 10V, say 11-12V?

author: Psi
author_rank: Super Contributor
timestamp: June 16, 2015, 08:41:46 pm
content: Check your pwm source. Some mcus can't do full 0-100% in all timer modes

author: LukeW
author_rank: Frequent Contributor
timestamp: June 17, 2015, 09:39:58 am
content: I actually drew up a circuit for an almost identical problem today, actually - generating smooth analog 0-10V to control a variable frequency drive.The requirements are that it should be galvanically isolated, should accept 3.3V logic levels at the input, should be powered at 10V (as little current as possible) and should provide a selectable full-scale range of either 0-10V or 0-5V, should be robust and reliable, and should have a low output impedance - because we don't know what the input characteristics of the VFD are like if the customer is using a flaky generic one.So here's a quick schematic I threw together - what do you think?

author: LukeW
author_rank: Frequent Contributor
timestamp: June 17, 2015, 09:40:49 am
content: This circuit looks quite simple - I don't have any personal experience testing it, though.http://tutanautomation.com/shop/pwm2b-2-channel-pwm-to-analog-converter/http://tutanautomation.com/wp-content/uploads/2015/03/PWM2B_sch.jpgWhat do you think of that circuit? Could be quite a cheap, fairly simple option if it works.

author: Leuven
author_rank: Regular Contributor
timestamp: June 17, 2015, 02:31:23 pm
content: First issue sorted, thanks very much.On the second issue:Supply is 10V sharp directly from spindle drive (the device this PWM converter is supposed to feed 0-10V into), and manual for it says max 10mA. I had this spindle drive/controller run the motor directly through a pot (nothing connected to it except the motor), and current at the pot doesn’t register on my meter (<1mA)When PWM board is connected and motor starts, current barely registers 1mA.Voltage under load:very slow ramp up to 8Vvery slow ramp down to 2.8VVoltage no load (0-10V feed to drive disconnected):quick ramp up to 10Vquick ramp down to 2.8VI don’t know why the current condition drifted a bit from the original, I haven’t done anything to it except replace a variable resistor with a fixed resistor of the same value (the one immediately after the 5V supply). It’s on the other side of the optocoupler anyway, the problem must be on the 10V side. I can't think of anything other than that.@LukeW Thanks for the suggestion. Your circuit doesn't look complicated, except when I have to troubleshoot itI'm a beginner after all. Specified opamp was a TS912N, I've put in a TS912AIDT. Any problems here?Not practical to supply more than 10V, I've got to work with that.