4
\$\begingroup\$

I have built the following circuit from trial and error:

enter image description here enter image description here

The circuit is to change the 5V PWM signal from an Arduino digital pin to a 0-10V circuit to control industrial equipment. In this case a CNC spindle controller.

I tried using an op amp to boost the PWM signal then smooth it with a filter capacitor but wasn't successful. I threw this together with a pc fan as test load and it seemed to work well. I didn't want to keep the test fan so I switched to a 75ohm 25W resistor I had on hand. It seems to work really well, I just take the voltage across the resistor and send it to the motor controller 10V input.

I get to maximum voltage across the resistor at a PWM setting of only 80 of 255. Above 80 there is no change to the voltage output. How can I get the full range from this circuit. I have heard that gates can act as capacitors so thought my PWM signal might be just charging this up too. See the proposed 10k pulldown resistor that I thought may help this.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Details about the spindle controller input expectations are very much needed. 0-10 V is something, but generally very vague. Can you write more about it? \$\endgroup\$
    – jonk
    Sep 1 at 6:02
  • \$\begingroup\$ Your circuit is a bit brutal with the component values you’ve chosen. 75R is working the transistor hard and 2200uF is way too large. There’s plenty of examples on the interwebs. \$\endgroup\$
    – Kartman
    Sep 1 at 6:03
  • \$\begingroup\$ @jonk the spindle controller expects just a signal voltage to control the speed it draws very little current. It has its own ac plug to power the spindle. \$\endgroup\$
    – kyotee89
    Sep 1 at 7:32
  • \$\begingroup\$ Your subject line is misleading. It suggests that motor power increases with low PWM. || Too much drive. \$\endgroup\$
    – Russell McMahon
    Sep 1 at 7:33
  • \$\begingroup\$ @Kartman Yeah i just used what was on hand. \$\endgroup\$
    – kyotee89
    Sep 1 at 7:33
6
\$\begingroup\$

Your circuit doesn't work like you think it does.

I simulated it, and got pretty much your results:

schematic

simulate this circuit – Schematic created using CircuitLab

At low duty cycle, the output looks like this:

enter image description here

At high duty cycle, it looks like this:

enter image description here

The difference between the two is just a few percent in the duty cycle.

What you need would look more like this:

schematic

simulate this circuit

That circuit provides a (more or less) DC output proportional to the PWM duty cycle. Since you have an NPN transistor in there, it inverts the duty cycle relationship. When the PWM from the Arduino is at a low duty cycle, the output voltage will be higher. When the duty cycle is high, the output voltage will be lower.

  • R1 and R7 reduce the voltage from 12V to 10V - the maximum output of the circuit will not exceed 10V.
  • R6 and C1 are a low pass filter with a cutoff frequency of about 8Hz.
  • Q1 uses the PWM input to make 10V pulses at the PWM frequency. It shorts the junction of R1 and R7 to ground when the PWM input is high. This increases the voltage for the pulses, but it also inverts the pulse width.

Low duty cycle:

enter image description here

Middle duty cycle:

enter image description here

High duty cycle:

enter image description here

The 10V input to the CNC machine should have a fairly high impedance input. It shouldn't present much of a load to the circuit, so there should be no trouble reaching the full 10V output. If the 10V output maximum is lower than 10V, then your could reduce R1 and R7 - R7 must always be five times R1. You must also then increase C1. If you halve R1, then you must double C1.

You can increase C1 to make the output smoother, but then it will take longer for the output to respond to changes in the PWM duty cycle.

\$\endgroup\$
1
  • \$\begingroup\$ Created this as you have described above and it is working much better. Cheers!! \$\endgroup\$
    – kyotee89
    Sep 2 at 1:48
4
\$\begingroup\$

Don't try to smooth power PWM signals with capacitors. Your 220 µF capacitor is an equivalent of 1.45 ohm at 500 Hz. It will waste a lot of energy when driven with AC. Filtering is a good choice only for low-power signals, and 220 µF is unreasonably large in this case.

If your load can be driven by PWM, there's no need for smoothing. If your load requires proper DC, use a buck converter with a programmable reference. Generating that programmable reference with a filtered PWM is indeed an option.

\$\endgroup\$
1
  • \$\begingroup\$ I don't think the question is about building a regulated power supply. The desired 0-10 V output is supposedly a high-impedance control signal to a motor controller which does the actual heavy lifting. \$\endgroup\$
    – TooTea
    Sep 1 at 14:39
3
\$\begingroup\$

First, ensure you don't need an isolated 10V output. Some inexpensive DIY setups use KB etc. DC motor speed controls which are designed to work with a pot, but the pot is connected to one side of the mains so you must add an isolation circuit.

Assuming that's not required here, a better approach than a transistor would be to use an op-amp. You can simply low-pass filter the output from the Arduino and amplify it with the op-amp. The output will change a bit with the 5V supply of the Arduino.

For example:

schematic

simulate this circuit – Schematic created using CircuitLab

enter image description here

As you an see, settling time to 90% is around 1/3 second.

For a more accurate circuit, I'd use a reference such as 2.50V or 5.00V and switch that with a CMOS analog switch, but probably this is fine for CNC spindle speed. Usually a few percent is not important.

\$\endgroup\$
2
  • \$\begingroup\$ What is "KB" in "KB etc. DC motor speed controls"? \$\endgroup\$ Sep 1 at 20:18
  • 1
    \$\begingroup\$ KB is a common US brand. Appears it was bought by Nidec of Japan a few years back. \$\endgroup\$ Sep 1 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.