Author Topic: PWM to analog circuit troubleshoot  (Read 4594 times)

0 Members and 1 Guest are viewing this topic.

Offline LeuvenTopic starter

  • Regular Contributor
  • *
  • Posts: 108
PWM to analog circuit troubleshoot
« on: June 16, 2015, 12:29:21 pm »
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?
« Last Edit: June 16, 2015, 12:40:06 pm by Leuven »
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1780
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: PWM to analog circuit troubleshoot
« Reply #1 on: June 16, 2015, 12:49:03 pm »
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
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1910
  • Country: ca
    • General Repair and Support
Re: PWM to analog circuit troubleshoot
« Reply #2 on: June 16, 2015, 12:49:24 pm »
1) Opto circuit is inverting the signal so flip the inputs to IC1a
2) Check/adjust voltage divider 47k+47K to get correct output at PWM 5v point
3) Output buffer supports just 40ma - don't exceed.

Alan types faster  :(
« Last Edit: June 16, 2015, 12:52:32 pm by Cliff Matthews »
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2086
Re: PWM to analog circuit troubleshoot
« Reply #3 on: June 16, 2015, 12:52:35 pm »
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.
Look at the action of IC2.

Quote
2. The source is precisely 10V. The lower and upper limits on the 0-10V pin are 0.4V and 8.9V.
The 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.
Quote
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.
If 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?
 

Offline dentaku

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: PWM to analog circuit troubleshoot
« Reply #4 on: June 16, 2015, 05:43:28 pm »
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.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: PWM to analog circuit troubleshoot
« Reply #5 on: June 16, 2015, 06:55:27 pm »
If 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?
I'm guessing he's generating a 0-10V signal to control a VFD, not a motor directly.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: PWM to analog circuit troubleshoot
« Reply #6 on: June 16, 2015, 08:08:12 pm »
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?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9953
  • Country: nz
Re: PWM to analog circuit troubleshoot
« Reply #7 on: June 16, 2015, 08:41:46 pm »
Check your pwm source. Some mcus can't do full 0-100% in all timer modes
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: PWM to analog circuit troubleshoot
« Reply #8 on: June 17, 2015, 09:39:58 am »
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?
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: PWM to analog circuit troubleshoot
« Reply #9 on: June 17, 2015, 09:40:49 am »
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.jpg

What do you think of that circuit? Could be quite a cheap, fairly simple option if it works.
 

Offline LeuvenTopic starter

  • Regular Contributor
  • *
  • Posts: 108
Re: PWM to analog circuit troubleshoot
« Reply #10 on: June 17, 2015, 02:31:23 pm »
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 8V
very slow ramp down to 2.8V

Voltage no load (0-10V feed to drive disconnected):
quick ramp up to 10V
quick ramp down to 2.8V

I 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 it :) I'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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf