Forum Navigation
Please or Register to create posts and topics.

Sherline Mill - VFD to Speed Controller Isolator

I am currently putting the finishing touches on an upgrade of a CNC variant of a Sherline mill purchased in 2008, which was subsequently upgraded from threaded rod lead screws to ball screws earlier this year.

As I purchased my G3 controller directly from Masso I didn't get the "extra fruit" of the spindle speed control directly from Masso.

The KB Electronics speed control board can be controlled using a 0-7V signal in place of the original potentiometer however appropriate isolation is required as the speed control circuit is direct mains powered. Locating a suitable 0-10V isolation module that is powered from the input side has been a challenge. Most isolation modules are a mix of 0-10V / 4-20 mA and powered on the outlet side, although companies can provide a 0-10V in / 0-10V out / inlet powered it is likely to be a custom configuration and price is higher than replacing the speed controller out-right. The CNC integration supplier CNC4PC has two breakout boards that convert a PWM signal into an isolated 0-10V signal however the inlet wiring connections are either modular (C41 breakout board) or a DB25 port (C69 breakout board).

So I looked into what is required to build a simple 0-10V isolation board myself (turns out there are a lot more technical issues than I expected). I am at the stage where I am just about ready to send off for a set of prototype PCBs to make my own isolation board. The board is currently 72mm x 25mm with 1kV isolation between input and output sides of the board, it has adjustable zero offset (±2V) and adjustable span (between 2.1 to 14.2V).

Below are some work-in-progress information

Uploaded files:
  • Isolator_1.png
  • Isolator_top.png
  • Isolator_Schem.png

Broke out the electronics breadboard and prototyped the circuit, the output was within 0.15V across the entire span (constant offset except near the ends).


Uploaded files:
  • Isolator_Breadboard.JPG

Further adventures in making Masso talk to a Sherline motor speed controller. I spliced a wire using some spade connectors (see photo) into the wiper connection for the speed potentiometer ("P2" terminal on the speed controller board). I connected the signal ground reference to the "F-" terminal. The other end of the wires were connected to banana plugs so I can plug them directly into a multimeter,

After closing everything up I ran some spindle speed tests while monitoring the potentiometer wiper voltage and using a cheap laser tachometer to measure the spindle speed (high speed pulley was used).

1.00 V 75 RPM
1.50 V 344 RPM
2.00 V 513 RPM
2.50 V 672 RPM
3.00 V 835 RPM
3.50 V 993 RPM
4.00 V 1147 RPM
4.50 V 1317 RPM
5.00 V 1492 RPM
5.50 V 1623 RPM
6.00 V 1804 RPM
6.50 V 1943 RPM
7.00 V 2152 RPM
7.50 V 2275 RPM
8.00 V 2421 RPM
8.67 V 2667 RPM

It appears the relationship between wiper voltage and speed is linear for speeds > 280 RPM (10% of maximum speed, nominally the high speed range should reach 2800 RPM). The zero speed intercept works out to be 0.4V.

I am not surprised by the offset and was half expecting it as that is the reason by the zero adjust on the isolation board (0V In => 0.4V Out, 10V In => 9.0V Out).


Uploaded files:
  • Speed_Controller_Harness.JPG

The printed circuit boards arrived and started to load the components in when I noticed that there was an error in one of the tracks (my mistake).

The screw terminals are 3.5mm pitch which is a little tight (need to use jeweler's screw drivers) while 5mm pitch is closer to spacing on the Masso controller.

Will need to rework the circuit boards and hope they don't get stuck in transit (Australia has just halved the already limited international flights due to the new COVID strain).

Picture below of the components loaded but not soldered.

Uploaded files:
  • IMG_0190.JPG
  • Isolator_Reworked.png

I ran a small simulation to determine the amount of voltage that the isolator needs to protect against. I have seen someone mention that the control circuitry is effectively at half mains voltage. It turns out that the statement is both correct and wrong at the same time.

I built a rough simulation of a circuit based on a circuit diagram found on the internet for the KBIC controller. I was interested in the voltage between the signal common (F- on the control board) of the speed controller and Earth. This is the voltage a person would be exposed to if they touched this wire.

The Australian wiring standards use the MEN system (Multiple Earthed Neutral) where the neutral wire is earthed on the supply side (usually at the distribution transformer) and at the switch board (earth stake to earth bus bar with a wire link to the neutral bus bar). This is done because the ground in Australia is not very conductive in summer (lack of water).

It turns out that the signal common is at earth potential for half the mains cycle while for the remaining half of the cycle is at full mains voltage. From an Root-Mean-Square (RMS) voltage perspective the voltage difference is half of the mains voltage but the peak voltage difference is still the same (230V RMS => 325V peak). This means the board will require an appropriate case to ensure no-one touches the speed controller side and the trim-pots have insulated wipers.


Uploaded files:
  • KBIC_Supply.png

My second set of circuit boards have been manufactured and currently stuck in shipment (restricted air cargo due to reduced number of flights to Australia).

Time to provide a description of the circuit and how some of the component values were determined (someone may come along and attempt to repurpose the circuit for another application, some notes so they can make adjustments to suit their needs).

Firstly the op-amp chosen is an LM358N, this is one of the few "low side sensing" op-amps that is available as a through hole component (DIP). Most op-amps can amplify the difference between two inputs over a wide range of voltage however this range often excludes voltages near the supply rail. In this circuit case we are measuring 0-10V with respect to the negative rail. On the op-amp datasheet this is defined by the "Common Mode Voltage" or "Common Mode Input Voltage".

The input op-amp adjusts the opto-coupler LED such that the photo-diode current matches the current from the 0-10V input.

From the HCNR200 datasheet the absolute maximum LED forward current is 25 mA, the recommended LED forward current is 0-20 mA. The "Input photo-diode current transfer ratio" can vary between 0.25% to 0.75% (for every 1mA of LED current the photo-diode would have between 0.0025 and 0.0075 mA of current). Using the worst case value of current transfer ratio with the LED running with 20mA would result in a photo-diode current of 0.05 mA. With an input voltage of 10V a 200kΩ resistor is required to provide a matching current, as this value is between typical resistor values the next highest resistor value was chosen (this will result in a slightly lower current and subsequently a slightly lower LED forward current). A current transfer ratio better than the worst case scenario will result in a lower LED current.

The op-amp output resistor in-line with the LED was chosen to provide 25mA with an allowance of 4V for op-amp loses (LM358 datasheet has a chart of output voltage delta vs current) and 2V for the LED forward voltage.  This would result in a theoretical value of 720Ω. The basic circuit diagram has no current limiting resistor but I am uncomfortable doing this so as a compromise I chose a 680Ω value (#).

The input side op-amp chip had an unused op-amp, the recommendation is to configure it as a voltage follower within the common mode voltage range. Technically I could of connected the input to 0V but with a simple voltage divider I could use it to provide a voltage at 10/24 of the supply voltage (basically a 10V reference). With the available resistor values I was able to achieve a 13/31 ratio which results in a 10.06V value.

The isolated DC-DC convertor is intended to be a 24V in / 24V out however due to available supplier stock a 24V in / 15V out model was chosen instead (pandemic supply related issues?).

On the isolated output side a 2.5V reference (LM336) was used to generate a signal reference value (required to allow a +/- zero adjustment). The LM336 requires a minimum of 400uA supply current, using a 27kΩ supply resistor (#) provides a 460uA supply current (more than the minimum).

The output photo-diode provides a matching current to the input photo-diode (within ±15% of the input side). This current passes through a 47kΩ resistor resulting in a voltage that is read off by an op-amp, the resulting voltage should be 47/220 of the original 0-10V (ratio determined by the input resistor R1 and the output sense resistor R6). The op-amp is configured as a non-inverting amplifier with a variable gain of 1.0 to 6.6 for an overall input voltage gain of 0.21 to 1.4. For a 0-10V input this would result a possible output voltage range between 0-2.1V and 0-14V depending on the adjustment of the Span trim-pot.

The zero adjust was achieved by using a resistor divider across the isolated circuit supply rails. Using 100kΩ resistor  and a 50KΩ trim-pot (#) the zero voltage can vary by ±2.5V with respect to the signal reference voltage.

It may appear odd that the voltage to the speed controller is the difference between two op-amp outputs, however this was the cleanest way to implement the Zero/Span adjustments such that the interaction between them is minimal.

Note: (#) indicates revised values compared to original circuit diagram.

  • LED in-line resistor value was a typo, should have been 680Ω
  • LM336 supply resistor adjusted upon review of datasheet, could explain voltage error with original breadboard prototype
  • Voltage divider resistor values changed due to different isolated output voltage