Hello Guest it is April 18, 2024, 03:50:42 AM

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

0 Members and 1 Guest are viewing this topic.

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #30 on: March 24, 2015, 01:40:04 PM »
Quote
I assume also that accurate control of the spindle speed is required where 'Threading operations' are carried out ?

The more stable the rpm the better and set it manualy. ie; don't have a vfd trying to maintain the rpm while Mach is trying compensate for
rpm changes.

RICH
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #31 on: March 24, 2015, 04:29:44 PM »
Fired the circuit but looks like I messed up, there is no analog output coming from it, so gonna assemble a new circuit keeping in mind the schematics, hope for the best

Cheers
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #32 on: March 24, 2015, 04:31:14 PM »
Even if it doesn't go well, I am much thankful to the community.
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #33 on: March 24, 2015, 04:37:49 PM »
Quote
I assume also that accurate control of the spindle speed is required where 'Threading operations' are carried out ?

The more stable the rpm the better and set it manualy. ie; don't have a vfd trying to maintain the rpm while Mach is trying compensate for
rpm changes.

RICH

To be honest, I doubt mach 3's capability of threading because it likes one pulse per rev which leaves a lot of gray area between pulses whereas being a cnc lathe machine retro fitter I have seen professional systems like HUST and Siemens go haywire even while having 1024 pulses per rev from a good quality encoder.
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #34 on: March 24, 2015, 04:43:46 PM »
Some peoples have answered to the gray area by giving mach 3 more than one pulse per rev and compsating the more pulses by increasing the pulley ratio so that the increased RPM display is corrected, but again this remains unanswered as the speed of the LPT port is limited.
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #35 on: March 24, 2015, 04:59:29 PM »
On this Lathe (TCL150) the way the tool turret and tools are designed the Surfacing tools come into contact with the workpiece from above. This is where the reverse rotation of the spindle motor is needed.

I assume also that accurate control of the spindle speed is required where 'Threading operations' are carried out ?

==========
Of course.  If you always use reverse then my Krypton extra circuit would work.  If you require both forward and reverse, then the G-code solution would be best - that I cannot advise on.

Inherent in the PWM filtering is a ripple on the DC.  I adjusted the values of the filter (R, R*C) and the PWM period as a compromise to achieve satisfactory operation.  In our spindle driver there is an output when the speed is stable, and it showed that the speed was continuously hunting - trying to follow the ripple.  But the motor sounded fine, so it is a reasonable compromise.

Krypton
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #36 on: March 24, 2015, 05:25:24 PM »
Fired the circuit but looks like I messed up, there is no analog output coming from it, so gonna assemble a new circuit keeping in mind the schematics, hope for the best

Cheers

==========
It should be very easy to debug.  There should be pulses on the new circuit input (the output from the breakout board).  If you do not have access to an oscilloscope, then an old-style analogue voltmeter would be better that a digital meter because it has inherent mechanical filtering.

So you should be able to control the voltage on the circuit input by controlling the speed through Mach3.  Then look at the optoisolator output (the logic chip input), the logic chip output, the filter output - in turn.

I would expect that your problem is that Mach3 is not yet producing pulses.

Krypton

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #37 on: March 24, 2015, 08:08:46 PM »
XTREME 2010,
Quote
To be honest, I doubt mach 3's capability of threading because it likes one pulse per rev which leaves a lot of gray area between pulses


Threading will only be as good as "your lathe system". Have a look at figure 4.4.5 in the Threading On the Lathe Manual for accuracy basis.
Also the rpm indication can be very accurate, out to 4 places, and that was tested / confirmed with a  custom pulse counter accurate to 30 ppm.
If one can "almost" accomplish class 3A threads with a hobby machine, 0-80 and on up.........of what matter should one be concerned.

FWIW,
RICH
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #38 on: March 25, 2015, 04:18:48 AM »
Fired the circuit but looks like I messed up, there is no analog output coming from it, so gonna assemble a new circuit keeping in mind the schematics, hope for the best

Cheers

==========
It should be very easy to debug.  There should be pulses on the new circuit input (the output from the breakout board).  If you do not have access to an oscilloscope, then an old-style analogue voltmeter would be better that a digital meter because it has inherent mechanical filtering.

So you should be able to control the voltage on the circuit input by controlling the speed through Mach3.  Then look at the optoisolator output (the logic chip input), the logic chip output, the filter output - in turn.

I would expect that your problem is that Mach3 is not yet producing pulses.

Krypton



Kypton,
I dont have a mechanical voltmeter at the moment but I have digital multimeter and I checked the output on pin 14 (defined pin 14 as spindle step pin and dir pin 1, also pwm out enabled in the spindle options) when I gave the command m03 s500 in mdi mode, there was approx 1.5volt coming from it and when I pressed the main reset switch the voltage dropped to zero. So, I guess it's pretty much in order, what do you think? BTW There's an oscilloscope lying unsed in my company's store room from the last 30 years , i will check if its operation.

Gaurav
Re: PWM Spindle Control using Mach3 - How I did it
« Reply #39 on: March 25, 2015, 04:28:11 AM »
right, you have pulses at the input.  Now check the circuit as I have listed.  You don't need the oscilloscope,  just the on/off signal you have been using so far.

There are two signal inversions, one through the optoisolator and the other through the logic chip.

Krypton