Author Topic: PWM + DIR to +-10V signal  (Read 2541 times)

0 Members and 1 Guest are viewing this topic.

Offline yaqwsxTopic starter

  • Contributor
  • Posts: 29
  • Country: cz
PWM + DIR to +-10V signal
« on: January 05, 2019, 11:09:55 pm »
I want to control an old DC servo amplifier with a CNC controller. The servo amplifier takes +-10V command signal to control the speed (0V = stop, -10V full CCW, +10V full CW). The CNC controller can generate either: 1) PWM + direction 2) PWM (for the high side) + inverted PWM (for the low side), 3) PDM + direction.

Generating analog voltage in one direction is simple - I take the PWM signal, put it through an RC low pass filter and then amplify it through an op-amp. However, I am struggling to find a solution which would allow me to invert the command signal based on the direction signal. What would be the simplest solution? Or is it achievable with the low- and high-side signal?
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16617
  • Country: us
  • DavidH
Re: PWM + DIR to +-10V signal
« Reply #1 on: January 06, 2019, 03:08:43 am »
Take a close look at how the second operational amplifier shown below is configured.  When the switch is open, it has a gain of +1.  When the switch is closed, it operates as an inverter with a gain of -1.  The switch only sees positive or zero volts with a positive input so a bipolar transistor or FET works fine as a switch even when the output is negative.

 

Offline yaqwsxTopic starter

  • Contributor
  • Posts: 29
  • Country: cz
Re: PWM + DIR to +-10V signal
« Reply #2 on: January 08, 2019, 04:17:37 pm »
Thank you for your response! I created the following schematic consisting of a low-pass filter, your circuit for inverting the signal based in the direction a and amplifier to get the full range of +-10V. The circuit is designed to use the components I have laying around (that is why the PWM and dir are isolated using Adum, the enable signal for the driver is isolated by an optocoupler - I don't have Adum1300 laying around).

I simulated the low-pass filter in Ltspice. Are there any mistakes in the schematic? I was also wondering if it would be possible to get rid of the last op-amp amplifier. However, when I added amplification to the low-pass filter, it got unstable according to Ltspice.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16617
  • Country: us
  • DavidH
Re: PWM + DIR to +-10V signal
« Reply #3 on: January 08, 2019, 06:47:22 pm »
That looks good to me.  A smaller MOSFET with lower leakage and capacitance is desirable but that one should work fine in a low frequency application.
 

Offline awallin

  • Frequent Contributor
  • **
  • Posts: 694
Re: PWM + DIR to +-10V signal
« Reply #4 on: January 08, 2019, 07:03:36 pm »
69USD 7I33 from there http://www.mesanet.com/ ?
manual doesn't have the schematic but if you ask nicely mesanet might share it?
 

Offline skunkworks

  • Newbie
  • Posts: 3
  • Country: us
Re: PWM + DIR to +-10V signal
« Reply #5 on: August 14, 2023, 01:27:18 pm »
I wanted to drop by and say that I threw together the first circuit and it seems to be working very well..   very linear.  (tl082 dual op amp and a small mosfet for the switch)

Using pdm/dir out of the printer port using linuxcnc..

 

Offline skunkworks

  • Newbie
  • Posts: 3
  • Country: us
Re: PWM + DIR to +-10V signal
« Reply #6 on: August 14, 2023, 01:28:09 pm »
Oh - and I switched the rc to a low pass (it is currently setup as a high pass)

sam
 

Offline jcdammeyer

  • Newbie
  • Posts: 4
  • Country: ca
Re: PWM + DIR to +-10V signal
« Reply #7 on: September 14, 2023, 04:33:09 am »
I saw you have one of those MACH3BoBs.  I reverse engineered it last spring.  Here's the drawing.
 

Offline skunkworks

  • Newbie
  • Posts: 3
  • Country: us
Re: PWM + DIR to +-10V signal
« Reply #8 on: September 14, 2023, 01:22:40 pm »
I saw you have one of those MACH3BoBs.  I reverse engineered it last spring.  Here's the drawing.

That makes total sense..  The cut off frequency for that r/c low pass is about .3 hz..  No wonder why getting 1hz sine wave through it was the limit..

The circuit I am playing with is currently around 67hz..  which - If I was able to get an 'ok' closed loop with the cheap bob at .3hz cut off - this should be a ton better..

sam
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf