Sherline Mill - VFD to Speed Controller Isolator

zombieengineer

ZombieEngineer
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
 

Attachments

  • Isolator_1.png
    Isolator_1.png
    81.1 KB · Views: 43
  • Isolator_top.png
    Isolator_top.png
    46.7 KB · Views: 41
  • Isolator_Schem.png
    Isolator_Schem.png
    15 KB · Views: 41

zombieengineer

ZombieEngineer
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).
 

Attachments

  • Isolator_Breadboard.JPG
    Isolator_Breadboard.JPG
    319.7 KB · Views: 27

zombieengineer

ZombieEngineer
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).
 

Attachments

  • Speed_Controller_Harness.JPG
    Speed_Controller_Harness.JPG
    20 KB · Views: 30

zombieengineer

ZombieEngineer
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.
 

Attachments

  • Isolator_Reworked.png
    Isolator_Reworked.png
    42 KB · Views: 34
  • IMG_0190.JPG
    IMG_0190.JPG
    187.7 KB · Views: 33

zombieengineer

ZombieEngineer
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.
 

Attachments

  • KBIC_Supply.png
    KBIC_Supply.png
    123.9 KB · Views: 30

zombieengineer

ZombieEngineer
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
 

zombieengineer

ZombieEngineer
The custom circuit boards arrived from an on-line supplier. After 30 mins of soldering various components I did some bench testing of the linearity of the final circuit.

Linearity error is usually defined as the error between the actual value and the "line of best fit" divided by the full scale range. When calibrated for 0-10V output the maximum error was 0.02V which is equivalent to the raw measurement error (a multimeter on 20V range has an error of 1 digit which is 0.01V, the error applies to input and output so the total error is doubled). Therefore the linearity error is ?0.2%, it could be lower but I don't have test equipment accurate enough to provide a more precise value.
 

Attachments

  • VFD_Isolator_Linearity.png
    VFD_Isolator_Linearity.png
    9.2 KB · Views: 31
  • IMG_0193.JPG
    IMG_0193.JPG
    170.5 KB · Views: 33

breezy

Arie
Staff member
@zombieengineer,

Could you supply your configuration file, I'm trying to solve another user's Sherline mill problem and I would like to compare settings files.

Thanks,

Arie.
 

zombieengineer

ZombieEngineer
@breezy

As requested please find attached my system settings. My system does not have a Sherline variant of the Masso controller.

Note: I purchased (12 years ago) the 2010-CNC which is the mill with the stepper motor mounts but no stepper motors or additional CNC components. At the time I had an old PC so it was more cost effective to assemble the CNC components myself (Geckodrive G540 + 1.2Nm steppers).

PS: Was thinking of dropping by the Bicton Mens' Shed in a couple of weeks as saying hi - currently pushing projects out the door and feeling like a zombie.
 

Attachments

  • Machine_Settings.zip
    1.9 KB · Views: 36

breezy

Arie
Staff member
@zombieengineer

Thanks for the files.

Just one more question where are your X & Y homing sensors located with respect to the front of the machine.

Regards,

Arie,
 

zombieengineer

ZombieEngineer
@breezy

The X & Y homing switches are in the lower left on my machine (self created 3D printed parts, not standard Sherline homing switches)

The X axis switches are mounted on the table triggered by contact with the cross slide block.

The Y axis switches are triggered by contact with the way cover ends mounted on the cross slide block

EDIT: I might have my Y axis flipped - something to check when I get time in the shed.
 

Attachments

  • IMG_0194.JPG
    IMG_0194.JPG
    239.2 KB · Views: 32
  • IMG_0195.JPG
    IMG_0195.JPG
    294.3 KB · Views: 33
  • IMG_0196.JPG
    IMG_0196.JPG
    187.9 KB · Views: 33

breezy

Arie
Staff member
ZombieEngineer

Thanks for the photos.

With your Y homing switch at the front and with the settings you have, your Y could be flipped, if positive Y commands moves the head to the back of the bed then all is OK.

Regards,

Arie.
 

zombieengineer

ZombieEngineer
@breezy

The spindle is static and the table / work piece moves under the cutter. I am certain that the Y axis is flipped.

This mill conversion has been running on "corona time" (as in "where did 2020 go?").
 

uribench

New member
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
@zombieengineer,

Could you please share thoughts about your experience with this isolation board after using it for more than a year (assuming you are still using it).

- Thanks. Uri.
 

zombieengineer

ZombieEngineer
@uribench - Built and tested the module but have not had a chance or need to use it (more on the "use" bit later).

Day job had gotten the better of me (I build training simulators for chemical plant operators).
A lot of project work from 2020 was deferred till 2021 but the 2021 work wasn't deferred...

By the time I had gotten the 2nd prototype made I came to a realisation that for a mill with a "manual tool changer" that automatic speed control was not necessary as each tool will have an optimum speed based on the material being cut and the diameter of the tool. There simply isn't a need to change the spindle speed half way through a tool pass on a mill.

It is a different situation when using a lathe as the surface speed changes with the part diameter.
 

uribench

New member
@zombieengineer

I totally understand the situation and agree with the rationale of not needing it in the given use of the mill. I had the same doubts and decided to try building it anyway to satisfy my curiosity.

Thanks for sharing your solution and thoughts, from which I have learnt several interesting things.

Could you please share your final PCB design and parts list.

- Uri.
 

zombieengineer

ZombieEngineer
@uribench

As requested:
  • Parts List
  • PCB Design (Gerber Files)
  • PCB Design (EagleCAD)

Parts list
PartValueDevicePackage
DC1MER1S2424SC
PDME1-S24-S24-S
ITW2424SA
24V to 24V Isolated through hole DC/DC converterSIP
IC1LM358NLM358NDIL08
IC2HCNR200HCNR200DIL08-400
IC3LM336LPLM336LPTO92
IC4LM358NLM358NDIL08
INPUTTB003-500-P02BE2 Way 5mm pitch PCB Mount Terminal Block
OUTPUTTB003-500-P02BE2 Way 5mm pitch PCB Mount Terminal Block
PWRTB003-500-P02BE2 Way 5mm pitch PCB Mount Terminal Block
R1220KR-EU_0204/70204/7
R218KR-EU_0204/70204/7
R313KR-EU_0204/70204/7
R4680R-EU_0204/70204/7
R547KR-EU_0204/70204/7
R647KR-EU_0204/70204/7
R718KR-EU_0204/70204/7
R8180KR-EU_0204/70204/7
SPAN100K33863386-MULTI
ZERO50K33863386-MULTI

The Isolator_Gerber.zip is for using on-line PCB ordering services. If you want to check the contents, go to https://www.pcbway.com/project/OnlineGerberViewer.html and drag the ZIP file into the appropriate location in your web browser. Contains tracks, holes, solder mask and silkscreen information.

The VFD-Isolator.zip contains the EagleCAD files (schematic / board layout).

When I ordered the PCBs on-line I ended up with 6 (used one, have 5 spare).
 

Attachments

  • Isolator_Gerber.zip
    114.8 KB · Views: 16
  • VFD-Isolator.zip
    153.5 KB · Views: 18
Top