Hello Guest it is March 28, 2024, 02:04:47 PM

Author Topic: PWM Spindle Control using Mach3 - How I did it  (Read 81267 times)

0 Members and 1 Guest are viewing this topic.

Re: PWM Spindle Control using Mach3 - How I did it
« Reply #10 on: January 13, 2011, 01:58:59 AM »
Hi,

My understanding is that Kernel Speed is not important when using a Smoothstepper as the step and direction pulses are generated by the Smoothstepper, not the controlling computer.

To answer your question, my Kernel Speed is set to 45000.  I use a 1.6GHz Centrino Dell Laptop.

Regards

Chrisjh
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #11 on: January 13, 2011, 10:27:28 AM »
Chris, thanks for your quick reply.

 I'm not using smooth stepper which is why I asked.
airnocker

Everything depends on everything else

Offline peu

*
  •  23 23
    • View Profile
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #12 on: July 06, 2011, 03:22:26 PM »
I just built this circuit, if you use low PMW, say 100hz, the spindle speed woobles, above 1000hz is a safe value. Thanks for sharing it.


Pablo
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #13 on: December 07, 2012, 07:53:33 AM »
OK, kernel speed 45000hz pwm base frequency 1000hz= 45 possible speed increments on the spindle.  In all honesty this barely sounds acceptable.  at this point it seems like the VFD should be chucked for a variable pulley? 
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #14 on: September 01, 2014, 04:09:56 AM »
I noticed that you have earthed all unused 4011 pins.  You must not do this.  Only earth (or connect to +12V) unused inputs. 

The logic gate inverts.  So if you earth both inputs the output goes high - the top output transistor turns on.  If you earth the output the only limit to the current drawn is the on-resistance of the top transistor.  This will heat the package, as you have three of the gates with outputs shorted.  The currents and power may exceed the maximum specified, and the chip life will be reduced.

So leave all outputs open-circuited.

And check that the chip is specified to handle 12V - some have a maximum of 7V, designed to operate on 5V supplies.

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #15 on: September 01, 2014, 07:46:43 AM »
Well spotted Krypton - you are quite correct - only the unused inputs should be tied to GND.

Tweakie.
PEACE
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #16 on: September 03, 2014, 01:13:14 AM »
Hi All,

Thanks for correcting my error.  The design intent was to tie all unused inputs to ground (the reason for this is to prevent high impedance inputs from "floating high", thus causing indeterminate output states).  I got a bit carried away when I was drafting the schematic.

The CNC lathe has been operational for quite a few years now, and the spindle control has never missed a beat.

Regards

Chris Humphris
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #17 on: September 04, 2014, 02:46:12 PM »
Firstly, Thanks Chris for your well documented info for the PWM converter.
l have bought one of the China spindles kits that included the VSD, which I knew would not be the best VSD.
The VSD does not have a PWM input, so I also need to convert the PMW signal sent from my smooth-stepper controller, to a 0-10V input for the speed VSD.
I bought the required parts today, but need to confirm the part number for the input transistor. My local electronic supplier supplier me with a surface mount BC848, but all the other parts are "through hole".
In the pictures of the converter already built, transistor does not look like a surface part. I first though they supplied me the incorrect part, but when I Google BC848 it also shows it as a surface part.... some help please...
Then I also understand that there is an issue with the GND in the Schematic, so was wondering if the correct Schematic could be placed on the site to help us novice electronics guys...
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #18 on: September 04, 2014, 07:51:02 PM »
Hi All,

My sins have caught up with me :'(

I have corrected the schematic and published a Parts List (BOM) and attached them below.

To make it easier for others to assemble this PWM to Voltage Converter, I have also attached the photographs showing the Veroboard PCB layout (top and bottom side).

Regards

Chris Humphris
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #19 on: September 09, 2014, 05:18:52 AM »
We bought a Chinese NC milling machine that was supplied with NCstudio software and driver board.  Being familiar with Mach3, we decided to convert.  With a non-isolated breakout board and a 5V external supply, it was easy to connect up the X, Y, and Z stepping motors (there is isolation in their driver units).

The spindle motor is driven by a Fuling V/F inverter model DZB312B001.5L2DK.  An internet search located a manual for the DZB200 / DZB300 series inverters, showing that there are some differences between the DZB300 and DZB312 models, like a panel mounted speed pot on the latter.

The manual shows about 200 commands, so it is a complex machine.  We set the command so that it could be controlled by the keypad.

We found that the speed was controlled by NCstudio from three digital inputs in eight levels, so we were at least able to run the mill by connecting the appropriate wires together

Trial and error located the command that allowed the speed to be controlled by the panel mounted pot or by an external pot.  (Command F0.03 set to 1 or 2.)  There is a 10 V supply with an analogue ground for the external pot.

The breakout board supplies a 5 V signal driven by the PWM output of Mach3.  This would not directly drive the external pot input - it seemed to upset certain timers in the inverter.  The filtering command F2.13 designed to smooth out interference did not seem to work.

The PWM signal was opto-isolated (to keep the analogue ground separate from the digital ground), amplified to 10 V and filtered.  The command F2.11 to set the upper voltage limit to 5 V did not seem to work, (although it worked on the panel pot okay), so the amplification to 10 V was necessary. 

The PWM signal from Mach3 has a minimum space pulse width, so as the frequency is increased the filtered voltage range is reduced, down to 50% at over 4 kHz.  A compromise was reached by setting the frequency to 100 Hz, and the RC filter time constant to 100 ms.  Because the inverter input has an input resistance of 20 kohms, the R value has to be low.  A sufficient value was 470 ohm, losing 2.5% of the signal.  To not lose any more voltage the filter input was driven hard, by using a CD4069 hex inverter with all six inverters in parallel, losing only 20 mV.

So the circuit was:  an opto-isolator driven such that its output transistor was off when not driven from a computer, so that the speed is zero when first powered on.  That transistor drives the CD4069 parallel inputs with a pull-up resistor.  The chip and resistor are powered by the inverter's +10V.  Then an RC filter into the external pot input.  If a non-isolated input is satisfactory the opto-isolator is replaced by an npn transistor and two resistors.

(So it is a lot like Chris Humphris' one except with no LED, no power supply capacitor, no pot, using an optoisolator on the input, and using a different logic chip.  With his, I would recommend a resistor between the transistor base and earth so the spindle motor does not turn on ever if the input is unplugged - base leakage current.)

As it turns out the full range of the frequency to get 24,000 rpm was available and Mach3 successfully handled the spindle motor.

Then a digital input to the inverter was used to set the motor in run mode from Mach3.  This was derived from the PWM spindle drive with a filter, to put the inverter in Run Forward mode whenever the pulses were there, and Stop mode when they were absent.

The emergency stop button was wired to the computer to action a Mach3 emergency stop when required.

And using an inverter relay output (command F2.21) to be active only when the spindle motor was turning to drive a solid state relay to turn on the spindle motor water cooling, vacuum dust extractor, mister and cooling fans, so that it is quiet unless the mill is actually cutting material.

It is intended to get the mill to produce a printed circuit to replace the non-photogenic prototype board – then we can produce the photos for all to see.

Krypton