Hello Guest it is March 28, 2024, 09:10:46 PM

Author Topic: Mach3 and latest ESS Driver - threading now works!  (Read 9220 times)

0 Members and 1 Guest are viewing this topic.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Mach3 and latest ESS Driver - threading now works!
« on: August 08, 2019, 09:06:13 PM »
OK, a report on the latest ESS driver for Mach3 and threading.

The background is that with only one speed update per rev, threading anything difficult with Mach3/ESS was often just not possible. If the cutting forces were significant, the spindle would slow down and the thread would be ruined.  I had been nagging Andy at Warp9 about PID control for Mach3. When the latest driver was released I tried it but found that the full PID stuff still did not work - although the Proportional part does. This is now acknowledged.

Then I made a throw-way comment on the Warp9 Forum that I don't NEED real PID control; I just need the ESS to sync the Z axis movement with the real Spindle speed much faster than one index pulse per rev. To which Andy replied that this feature had been included in the latest driver. I had just not seen any mention of it.

So, today I went into the bowels of Mach3 and of the ESS driver and configured it all for the 512 line encoder which was already on the lathe spindle. Then I ran some tests.

#1: Soft plastic, M12x1.0 metric fine thread, HSS threading tip. I chose this because I have taps and a die for it for comparison. Result: success - but that was soft plastic which would not slow the spindle down.

#2: Using the general test program I had written for #1, I then cut a thread on 5000-series aluminium. This is harder than plastic, but still not all that much of a load on the spindle. This let me fine tune the tip-correction factor for the tool in use (HSS, 60 degrees, sharp tip). The result was successful when tested against the M12x1 die.

#3: A real test: an M14x1 thread on forged steel. (It was some scrap I had rescued ...) This is where all previous efforts had failed: the steel is very tough and the spindle does slow down at times. The thread used to get trashed. Away we went, and the spindle did slow down in places. Quite apart from the fluctuating RPM on the Mach3 screen, I could SEE the spindle slowing. I swear it must have come close to dropping to 50% of speed at least once. OK, it was not a very conservative cut - but that was the whole idea.

Result: a quite satisfactory thread! No sign of wobbles in the pitch. This was checked against a Moore&Wright thread gauge and an M14x1 die I have. Just lovely, despite the variations in RPM.

Conclusion: the dynamic syncing between spindle RPM and Z-axis movement in the latest ESS driver works fine with a good-enough encoder (512 lines is the top end of what is available cheaply). I would imagine that a 256 line encoder would also work OK, or even a 128 line one. I don't care if the actual RPM is different from what was programmed, as long as the threading works on steel! Which it now does.
:) :P  ;D

Thank you Andy.

Cheers
Roger
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #1 on: August 08, 2019, 09:47:49 PM »
Hi Roger,
Good to hear. Can you describe the config setup? Are you using just the A output of the encoder? Also, where does the index come from?
I could see the Smoothstepper using the encoder Z for the index and A for the pulses.
I hadn’t seen that sort of configuration in the ESS and Mach3.

My lathe has a 2000 ppr encoder on it that’s currently not being used.
Cheers
Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #2 on: August 08, 2019, 10:01:32 PM »
Hi Peter,

Quote
My lathe has a 2000 ppr encoder on it that’s currently not being used.

I have read how Andy (Warp9) describes the process of how the ESS reads and interprets a spindle encoder.

It times between successive pulses. Thus with a high resolution encoder the time between pulses is very short and the limited timing resolution
counts against accuracy. Alternatively fewer pulses allow for greater timing accuracy at the expense of  speed refresh rate. The logical extreme
is an index pulse alone, maximum time between pulses for great timing accuracy but insufficent refreshes to combat spindle speed droop that Roger describes.

The ESS requires both an Index signal for synchronisation AND either A or B channel of an incremental encoder.

May I suggest that you try your encoder. I understand that 2000 lines represents about the upper limit where the ESS can still give meaningful speed measurements.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #3 on: August 08, 2019, 10:10:31 PM »
Hi Craig,
Thanks for that. I’ll set it up tomorrow and see how it goes.
BTW, what input does the A encoder signal go into?

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #4 on: August 08, 2019, 10:24:24 PM »
Hi,
I've seen the input in the Mach4 plugin but unfamiliar with the Mach3 plugin.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #5 on: August 08, 2019, 10:39:31 PM »
Hi Peter

The config is very similar to feeding an encoder back to a Gecko driver. You have to allocate port/pin numbers in the Ports&Pins page in Mach3 under MPG1 and you have to set up the ESS driver to use the signals. This ONLY applies to the very latest release (24/10/2018) of the driver from the Warp9 web site: version 2018_10_24 a-v10f1 (or similar).

It installs just like any other ESS driver, but when you boot Mach3 there is a new Warp9 splash screen with the version number.

To my mind, Warp9 did a really poor job of advertising this upgrade: it seems that just about no-one knows about the wonderful new feature. This is sad!

In more detail then.
Yes, I keep the Index pulse from the spindle just as it was. This goes through the ESS to Mach3 and gives the RPM readout. Don't change anything here.

I take either the A channel or B channel from the encoder on the spindle motor (it makes no difference which one) and allocate it to MPG1 channel A in Mach3. You can put in something for the Channel B if you want, but I don't think it matters. See Engine Config image below.

Then in Mach3 under Plug-In control you will find an option about half way down the list for the PID setup (or something like that). Leave Ki and Kd zero: they don't work anyhow. One of them may actually do 'bad things'. You can try to fine-tune Kp from its default value of 0.5 if you want, but if you make it too big the servo loop will start to oscillate. That is bad news!
See the 'Spindle, THC etc' image below for this option, and look at the yellow region.

This screen comes up with 'RPM source' 'Spindle Index' ticked. You will have to tick the 'MPG #1 Ch A' box instead. Then in the 'RPM Pulses per rev' box put the number of LINES your encoder has. You mentioned 2000, but I suspect that could be the number of edges instead, in which case your encoder has 500 lines. Leave 'Prescaler' set at 1.

Then tick 'Use Spindle PID' - I think that will have the ESS driver in the PC try to use the Index pulse for better speed control. I have not tried leaving it unticked.

Then (and this is critical), tick the 'Use PID while threading' box. This is what makes it work.

Explanation
The Index pulse goes through the ESS to Mach3 in the PC as usual and updates the displayed RPM. The Encoder signal going into the ESS as 'MPG #1 Ch A' stays inside the ESS, where it is used to synchronise the Z axis travel with the spindle speed - in my case 512 times per rev. This is tantamount to putting a mechanical gearbox between the spindle and the Z axis.

HTH
Cheers
Roger
« Last Edit: August 08, 2019, 10:41:39 PM by rcaffin »
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #6 on: August 09, 2019, 12:07:27 AM »
Hi Roger
That all makes sense.  Presumably I can use the prescaler value to reduce the ppr for the 2000ppr encoder.

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #7 on: August 09, 2019, 12:24:46 AM »
That is what the prescaler is for. Try a factor of 2 first perhaps?

Cheers
Roger

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #8 on: August 09, 2019, 06:11:18 AM »
rcaffin,
Did you ever try using the different feed methods available for threading?

A key factor in threading is a non-fluctuating feed rate ( constant spindle rpm ) during the actual thread cutting.
Said differently, you need adequate HP to cut the thread, and or, a refined approach to cut a  thread within your machines capability. The above becomes even more important for punny lathes.

Mach3 threading allows for spindle slow down in that the current rpm data is used to adjust the following path of cutting
allowing for a possible adequate thread. It's all a matter of degree.

Enhanced data applied to the following path should assist in an altered feed rate and the data used is averaged so the affect is not as great as you may think.

Just some threading insight for what it's worth......,

RICH


 

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Mach3 and latest ESS Driver - threading now works!
« Reply #9 on: August 09, 2019, 07:03:53 AM »
Hi Rich

Sorry, but I have to disagree with you.

A key factor in threading is a non-fluctuating feed rate ( constant spindle rpm ) during the actual thread cutting.
This is manifestly false, as may be seen by two examples.

I can cut a thread on a geared manual lathe by running the motor, OR by turning lathe chuck by hand. The gearing looks after the relation between spindle angle and the Z axis. This works fine: I have done it many times. In effect, you do not have to worry about the motor power or the RPM with gearing between spindle and Z.

I was able to cut an excellent thread in hard steel on my CNC despite variations in the RPM - because the latest ESS driver acts like a mechanical gearbox. I suspect the results would not be so good with a (say) 50 line encoder as the Z movement could be a bit more jerky.

What is indisputable is that it works.

Sorry, but.
Cheers
Roger