0-10V motor control

Hi All,

I have a small milling machine which I have partially converted to CNC control. The spindle is controlled by a fairly typical DC motor control which uses a 0-10V signal (set by a potentiometer) to set the rotation speed. The motor rotation direction is set by a 3-position switch (REV-OFF-FWD) which simply reverses the polarity.

I would like to be able to have the computer control the spindle. There are a few kit boards out there (like this one) that do this but I have two Arduino boards in my parts bucket so I was wondering about using them to do it. I know how to control relays to turn the motor on and off and to control the direction of rotation. However, I do not really know where to start in generating the 0-10V speed signal.

The first link I found was this one:
Industrial 0V to +10V Digital Potentiometer

Naturally it's 7 years old and uses a part that can only be ordered in quantities of 250 or more :stuck_out_tongue:

The second was the tutorial on digital pots on the Arduino site:

This was interesting and I understand all the basic principles. But, this seems to be good only for a 0-5V (TTL) level output, while I need 0-10V, so I wasn't really sure how to go about it.

Since a 0-10V control is a fairly common industrial protocol, I figured someone else might have done something already or there might be an easy way to do it if you know the magical part number ;D

Thanks in advance!

PS: I've had more luck and experience interfacing between the Arduino and the PC and downstream CNC controls, so I'm fairly confident that if I can get the Arduino to control the motor, then I can figure out how to control the Arduino from upstream...

This should be fairly do-able using a PWM/analog our pin and a basic opamp foo to double your output voltage.

Using a circuit like that, you should be able to just use analogWrite(x,y) where x is the pin number and y is a value from 0 to 255.

A basic op amp can have non-linear performance when the output voltage is near zero volts or the supply voltage. Choosing an op amp that is specified for rail to rail operation will give you more accuracy if this is required for your app.

The simple circuit posted by spiffed is not quite right.

The following page has the corrected circuit and an explanation:

http://www.eecs.tufts.edu/~dsculley/tutorial/opamps/opamps5.html

However, I think from reading your post you will need something slightly different. In you post you mention a 0 - 10V control signal and that a switch reverses the direction by reversing the polarity of the signal.

o I assume you will be removing the switch?
o Does this mean the actual control volage can be -10 to +10V (±10V)?

If this is so you won't be able to use a simple buffer as the PWM output from the Arduino produces only positive values, 0 to 5V.

You will need to offset the output of the op amp so that mid scale of the PWM output produces 5V at the output of the op-amp and have a gain of 4.

The difference applifier is probably the way to go on this. This page has some info on op-amps and a difference amplifier, specifically:

http://www.chem.uoa.gr/Applets/AppletOpAmps/Appl_OpAmps2.html

You would connect the PWM output from the arduino and an adjustable shift voltage to each of the inputs. When the PWM is at mid scale adjust the shift voltage so that there is zero on the output. The shift voltage can be from a simple preset potentiometer, or could even be derived from another of the Ardiono's PWM outputs, suitably scaled and smoothed.

I would be inclined to add a little high frequency roll off, making it a low pass filter, by adding a capacitor across the feedback resistor.

What mem says is accurate about rail to rail performance. Alternatively you canpower the opamp from a higher supply voltage if you have them around. ±12 or high would be good.

Regards,

Mike

Thanks guys. Just to clarify some of the points raised:

  1. The 0-10V signal is 0-10+VDC only. The polarity control is done by a relay between the motor controller box and the motor, not by the 0-10V signal.

  2. I need external +12VDC PSU for the relays anyway, so powering the opamp from it is no problem.

  3. I don't actually need perfect linear performance, so long as it is predictable. For this application, I can have say 10 or 20 possible speed settings and use software to compensate for non-linearities, assuming that they are not too eccentric. My guess is that most of my time will be spent at 3-10V since that's where the useful speeds are.

  4. I have a handful of these opamps in my bin from some audio projects. Any reason they would be manifestly unsuitable before I take the trip to the parts store?

http://www.national.com/mpf/LF/LF353.html

Thanks again!

Do you have a -10V supply available?

The spec says they are not rail to rail, so when run from a single ended supply, you may have difficulty getting the output to zero. This may cause a slight drift of motor position when you think it should be stationary.

This won't matter if you use a relay to switch the motor off when you think it should be stationary.

I would use an LM324: http://www.national.com/mpf/LM/LM324.html

It is spec'd for single supply operation and the output can go down to 0V.

Mike

Thanks Mike. I will be using a relay to shut off power to the motor when I want it stopped. I know that the PSU I have has +/-5 and +12V rails. I don't recall if it has a -12V one. I'll probably give it a try with the parts I have on hand and see where that gets me.