Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rcaffin on August 08, 2019, 09:06:13 PM

Title: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Peter Homann 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Peter Homann 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Peter Homann 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
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 09, 2019, 12:24:46 AM
That is what the prescaler is for. Try a factor of 2 first perhaps?

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: RICH 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


 
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin 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


Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: RICH on August 09, 2019, 03:01:51 PM
Roger,
Glad after 10 years that Andy was able to provide a type of electronic gearing.
No longer follow what's going on with Warp9 so my feed rate comment will not exactly apply to the ESS.

Would be curious as to what development procedure was used.

RICH
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 09, 2019, 05:35:26 PM
Hi Rich

Oh, indeed: the electronic gearing provided with a hi-res encoder and the latest ESS driver make a world of difference. They change the whole ball game. My understanding is that this feature is available for both Mach3 and Mach4 now. However, for me it removes most any reasons for switching from Mach3 to Mach4, as Mach3 now does everything I want.

As for the development procedure - dunno. If you mean software development, you would have to ask Andy about that. My understanding is that you actually write the 'code' for the FPGA operations in a suitable language and then feed it through an FPGA compiler. The code won't look like a conventional program as the FPGA runs many things in parallel. Quite different from a von Neuman processor.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 09, 2019, 06:04:47 PM
Hi Roger,

Quote
My understanding is that this feature is available for both Mach3 and Mach4 now. However, for me it removes most any reasons for switching from Mach3 to Mach4, as Mach3 now does everything I want.

Mach3 enacts proportional only feedback whereas Mach4 offers genuine PID.

While PID control sounds good, and it is a marked improvement over what was, it is still a long way short of servo control.

Firstly there is the means that the ESS derives its speed updates...by timing between pulses. Thus you have a resolution/
refresh rate compromise to make. A regular servo gets its speed information not differentiating its input pulse stream,
aka timing between pulses, but by monitoring the feedback term of a high gain integrator loop. This achieves the same
result, namely providing an estimate of the differentiated input stream but with an order of magnitude better noise
performance, especially at low speeds.

Secondly because Mach uses only one channel of the encoder it has no sense of direction. The PID feedback loop controls
velocity only and has to wait for a speed update for the duration of the interval between pulses associated with the speed
measuring procedure. Therefore the resolution/refresh rate compromise is doubly fraught because is the same compromise
that determines the delay between a speed change and the estimate of that speed change being available to the feedback
controller.

Any delay between physical event and an estimate of that event to a control system counts VERY heavily against
its stability and bandwidth.

For this reason the spindle PID offered by the ESS is good, certainly much better than we've ever had before it still
pales into insignificance to the bandwidth and accuracy of a servo loop....and before you say but this is a spindle.....
remember Mach4 has out-of-band axes that can be driven independently of the coordinated axes but with exactly the
same tight control of a coordinated axis.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: BR549 on August 09, 2019, 07:38:00 PM
It would have been nice to have included both A&B channels of the encoder then it could do rigid tapping as well.

(;-) TP
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 09, 2019, 08:30:53 PM
Hi TP,
I think having both A,B and index channels for rigid tapping is effectively requiring the ESS to be a position mode
feedback controller.

Warp9 have steadfastly refused to dip their toes into that market.......just the support required alone would be a nightmare.

This solution offers a reasonably tight (approx. 50Hz bandwidth with Mach4 and probably 10-15Hz with Mach3) velocity mode
feedback control. This is without having to offer genuine servo type performance, ie bandwidths of hundreds of Hz.

With the superb and increasingly cheap AC servos on the market and Mach4 being able to run out-of-band axes and/or a
coordinated C axis, and able to swap to either mode under program control, what would be the advantage to Warp9 to
compete against that sort thing?

My understanding is that both the Hicon and the CSMIO/A both have the feedback control to enact servo type performance,
but even the cheapest is four-five times the price of an ESS. Of course Galill is the undisputed master of this sort of motion
control but at eye-watering prices.

My contention is that Warp9 have avoided the trap of offering such advanced features that would see the price inflate out of
the hobbyist market....particularly in view of the trend for AC servos and drives to become ever smarter and do all the required
extra 'fruity bits' without the ESS having to raise a sweat.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 09, 2019, 11:19:54 PM
While PID control sounds good, and it is a marked improvement over what was, it is still a long way short of servo control.
It may be 'short' of full servo control, but with a 512 line encoder it is not very far from it, imho and from my observations so far.

Thus you have a resolution/refresh rate compromise to make.
True. Warp9 does try to suggest that the new driver gives you 'servo' control of the spindle: that would require Step/Dir signals rather than PWM. Buthaving done threading on hard steel with this new driver, and seen how good the thread is, I am not fussed.
Now, if you want rigid tapping with the mill spindle - that is a different matter. Me, I use a single-turn thread mill for this, and so far have gone up to M24x1.5 threads.

because Mach uses only one channel of the encoder it has no sense of direction.
But the ESS does know what direction it is spinning - from the M3 and M4 commands. I do not see this as being a problem of any sort.

Any delay between physical event and an estimate of that event to a control system counts VERY heavily against its stability and bandwidth.
Yup, true. I believe the FPGA in the ESS can handle pulse frequencies to over 100 kHz, and possible much higher. I think this is fast enough for a spindle.

We need to separate the control of the spindle RPM from the implementation of threading on the spindle. As I have pointed out in a previouys posting here, you do NOT need precise control of the spindle RPM to cut high-quality threads. The two things are very different, despite some apparent confusion from a previous era. The new driver is effectively a mechanic gearbox between the spindle and the Z axis, able to handle huge speed variations while cutting a lovely thread.

Actual RPM bandwidth on mach3 is not wonderful: the update rate in the software device driver inside the PC is only 10 Hz. But who cares if it can cut good threads?

Cost: ah yes. The new driver for the ESS is provided FREE to owners of the ESS. You cannot get much better than that!

Now, if we could get Artsoft and Warp9 to work together to produce Mach5 with an ESS*, with very different communication protocols between the two and leaving the old LPT port concept way behind, then you could have rigid tapping to the wazoo. I suspect Artsoft have some cost recovery to do with Mach4 first. Dunno what the cost would be though...

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 09, 2019, 11:56:56 PM
Hi Roger,

Quote
I believe the FPGA in the ESS can handle pulse frequencies to over 100 kHz, and possible much higher. I think this is fast enough for a spindle.

I suspect that the internal frequencies of the FPGA are very much faster than that. The limitation is the means of measuring speed,
the delay between the speed being established and the time that speed is reported to the ESS. I think the ESS solution
would be inadequate for a position mode servo of several hundred Hz bandwidth but does a fine job for a velocity mode
spindle.

I think this is the good news....the ESS now has the capability to make threading a doable proposition for machines
that don't have hugely overpowered spindles. Warp9 should be congratulated for their effort.

I am less certain that progressing the ESS to a high bandwidth position mode controller is either viable or desirable. The cost of
those controllers that are capable of that performance are beyond my budget and I would be lost if Warp9 persued that
avenue. Additionally the ever increasing capability of servo/drives render the need for  motion controllers to do such a thing
moot.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 10, 2019, 12:24:36 AM
Hi Craig

I am less certain that progressing the ESS to a high bandwidth position mode controller is either viable or desirable.
No argument from me: I agree completely.

I also agree that the FPGA in the ESS can probably get much better than 100 kHz, but I don't have any measured performance to quote. Iirc, it can handle Index pulses of 0.1 uS.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: BR549 on August 10, 2019, 07:13:06 AM
Hi Craig, WHY would they want to play in that market ?? Simple because other modern DIY controllers CAN do rigid tapping. It is simply axis following but you do need the 2nd channel of teh encoder to see WHEN teh spindle reverses.
Heck even teh old DOS based controllers were capable of doing it.

(;-) TP
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 10, 2019, 10:25:35 AM
Hi TP,

Quote
Simple because other modern DIY controllers CAN do rigid tapping

Name them and then price them.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Ya-Nvr-No on August 10, 2019, 12:11:04 PM
I use Dynomotion Kflop its $249, if you want analog 0-10volt go for the additional kanalog board for an additional $249. I've used it for both mill and lathe. Great software too but you have to learn C code. Used it for years, love it. :)

http://dynomotion.com/
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: BR549 on August 10, 2019, 05:56:19 PM
Hi Craig,
UCCNC
PathPilot Mesa card
PathPilot LPT
LinuxCNC Mesa Card
LinuxCNC LPT
CommandCNC
CSlabs
PoKeys
Centroid Acorn
Centroid Analog

I could go on but what would be the point (;-)
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 10, 2019, 06:56:26 PM
Hi TP,
UCCNC                      UCCNC is not a feedback controller, neither are any of the UC**** boards ergo not PID capable
PathPilot Mesa card    No idea what PathPilot is.....is it realtime PID capable?
PathPilot LPT              See above
LinuxCNC Mesa Card   LinuxCNC is realtime capable and can be programmed to do realtime PID....if Linux is your thing
LinuxCNC LPT             See above
CommandCNC            No idea what CommandCNC is.....is it realtime PID capable?
CSlabs                       Yes CSMIO/A is realtime PID capable at 600Euro, shame about the buggy/lacking Mach4 plugin
PoKeys                       PoKeys has an on board API that allows for proportional control but cannot do PID
Centroid Acorn           A rather more expensive albeit complete solution....not Mach
Centroid Analog         See above

Two that should be on this list are:
Hicon                       With the activation to do PID $1200, good Mach4 plugin
Gallil                        Starts at $2000 for three axis, recently released Mach4 plugin.

In short there are only three boards that allow genuine PID with Mach, CSMIO/A, Hicon and Galill....all of then way
more expensive than an ESS.
LinuxCNC is capable if Linux is your thing...and that debate is as old as hobby CNC itself.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 10, 2019, 06:59:47 PM
A useful list to know about, but what are the costs for a full implementation?
Dynamotion seems to be about $500 for the two cards needed.

How many of these handle the standard NIST g-code without lots of C programming? It's not hard to learn the basic g-code commands (G0 - G3), but learning C would be a demand too far for many hobbyists.

And just how 'full' are the various implementations anyhow? For instance, does the Acorn system offer as much as a Mach3/ESS one? And do any of them offer the equivalent of the ESS threading 'gearbox' which comes with the latest driver?

It would be a valuable service to us all to have this detailed in full. Sure, I use Mach3, but I am still interested in what alternatives there are, how they compared in functionality, and their full costs.

Thanks Craig for your info.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 10, 2019, 07:03:34 PM
Hi TP,
have been doing some research, PathPilot and CommandCNC are variants of LinuxCNC and are very probably PID capable.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: RICH on August 10, 2019, 07:17:35 PM
Roger,
 Now that you have high confidence in the threading may want to play around with the
different thread cutting feed methods. You may even be more surprised on the results of
your systems ability to do threads. Example; Alternating flank infeed to do a acme thread
with a single point threading tool. HP requirement is greatly reduced!

Just for info:
Back many years ago tried to get slaving of the spindle to the Z axis.
We had enough problems just fixing the Mach3 threading when it was broke.
So never happened.
Why the slaving? Because back manny years ago a DOS controller allowed that, and using an mpg
one could just move the Z at varing feedrate along the stock, back and forth, to do
threading. It was a model makers dream since you could easily do threads way smaller
than 0-80's.

Matters not how good  a controlling device addresses threading. If all the other items
of the lathe system  ( which includes the operator ) is not applied correctly for the
task success will not occur. The nut goes on has it's place, but, meeting design intent
and spec are the name of the game. ;)

Have fun,
RICH
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 10, 2019, 07:39:18 PM
Hi Roger,
on the Acorn website I came across this in relation to their step/direction controller:

•Spindle encoder input for CSS, Threading and Rigid Tapping

It would suggest that the encoder has A,B and I channels enabled to do rigid tapping. The controller is not PID capable overall,
I suspect it has a partial PID control of the spindle only in similar manner to the ESS.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on August 10, 2019, 07:59:19 PM
Hi Roger,
Acorn do two other much more advanced models which are feedback capable:

AllIn1DC at $2250
OakCNC at $1600

Quirkily the AllIn1DC is not step/direction capable and therefore cannot drive steppers or AC servos. The CSMIO/A has he same
problem, sure you've got nice analogue outputs its just that you cannot therefore have step/direction.

The OakCNC cannot drive steppers either, according to Acorns feature list but can drive AC servo drives, I suspect the controller
is analogue output only and therefore the AC servo drive solution is based on analogue input rather that step/direction.

The much cheaper Acorn is $300 plus $150 for the entry level software other than the severely limited free software. It looks
to be a capable controller very much of the ESS ilk and approximately the same price as Mach/ESS.

The other two models are way way more expensive but they are genuine feedback capable controllers.

This supports my contention that 'genuine feedback controllers are way more expensive than open loop step/direction controllers'.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: BR549 on August 10, 2019, 09:42:29 PM
UCCNC  does a fine job rigid tapping and encoder threading for turn (;-) Does perfect guaged threads  Even does Peck tapping LH OR RH and uses BOTH channels of teh encoder plus index ABZ.

It is probably teh EASIEST controller to set up rigid tapping or threading. ALMOST plug and play.

Just a thought, (;-) TP

So why do I need PID again (;-)
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 10, 2019, 09:48:45 PM
Hi Rich

I have just reread your excellent Mach3Threading.pdf file . Some wonderful stuff about threading in general in there.

But ... it was written in 2009 with Mach3 version .032 and an LPT in the PC. This does not really represent what most new users will have today. In particular, the transition to an external pulse engine (such as the ESS) and the possibility of an electronic gearing is not considered. Is it time to consider updating it?

Also, I have to mention that I am not really happy with the m1076.m1s program version I have: 9/Apr/2015. Watching the threading very closely, it seemed that some passes did a significant cut while other passes did very little. I have looked AT the code in the program, but not in depth.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: BR549 on August 10, 2019, 10:07:47 PM
Hi Roger there are several M1076 macros floating around. It was modified several times officially and many times unofficially.

I asked Art one time IF mach3 could do encoder threading and teh answer was SURE it is possible but he was not going to put teh time into it for teh few people that were using it for turn.

Yes teh old dos based controllers could do rigid tapping and threading they had a real time kernal (;-) Many Comercial controllers used DOS a lot longer that most people realize. Why do you think they drip feed them ?? Limited DOS memory.

OHHHHHH  the old days, (;-) TP

(;-) TP
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 10, 2019, 11:03:24 PM
Hi TP

Yeah I know. My CNC originally had a DOS controller - I think it was at lest two large S100 PCBs (or something like that). There was a slight maintenance problem with them though (like who?), not to mention difficulties in buying new DOS machines.

I remember all right - I started programming about 1969, and hacking processors in the TTL days.

Fwiiw, I believe one can still buy suitable motherboards as so many industrial systems still use them, with a couple of serial ports and a couple of LPT ports too! But being a specialised market, the prices are going up, and the graphics ... are terrible. On the other hand, you could put a real time OS on them.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: RICH on August 11, 2019, 08:49:14 AM
not really happy with the m1076.m1s program version I have: 9/Apr/2015.

The one I use is way early that that one and have no problems with it.

I use G32 output for threading. That allows me to backplot thread passes should there
be a need to look into a possible problem, and  frankly never seemed, to be the Gcode.
Have the ability to mount a microsope on the carriage to monitor actual chip formation / cutting
of the material. Why you may see that a particlular thread pass is not removing the proper
amount of material could be due to a number of reasons. It is a complex process
greatly influenced by lot factors.

As far a updating the write up...............
Threading ( internal to Mach3 ), after it was fixed,  has not changed to my knowledge.
One can check the Mach3 revison history and will find nothing officaly recorded since 4/3/2012.
The last write update was 2/3/2012 - Rev 3 and have no intent on updating it.
A book can be written to cover just threading so one must start and stop somewhere.

As you noted external motion controllers like the ESS have improved, and it took "years" to have
lathe stuff addressed, thus I will leave it to them to anounce and explain the advances. That goes for
lathe CAM programs  also. Lathe has been and probably will remain an orphan child!

Maybe we should refer to this thread in  Member's Doc's and let the thread discusion be a source
of information. Going off topic can serve a purpose in a thread sometimes.

RICH
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 11, 2019, 05:34:00 PM
Hi Rich

Lathe has been and probably will remain an orphan child!
It shouldn't be that. I use it and rely on it a fair bit. With the new threading capability, it is an excellent tool.

Maybe we should refer to this thread in  Member's Doc's
Good point.
I am not suggesting any changes to the general discussion of threading which you wrote. It is in fact way more detailed than I need. And probably more demanding than many small lathes can handle, as you note.

What I am suggesting is an addition to cover the ESS and the 'gearing' it now has for Mach3. Perhaps it should be a separate document instead? Member's Docs indeed.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: RICH on August 14, 2019, 05:05:22 PM
Roger,
Current thoughts are to do an Appendix to the Threading on the Lathe Manual.
Getting some thoughts together on just what it should include.
 
RICH
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 14, 2019, 05:35:44 PM
Hi Rich

I would be delighted to help.
I have been an Editor for 20+ years - another skill.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: RICH on August 15, 2019, 06:22:53 AM
Roger,
Appreciate the offer and will take you up on it. Maybe Greg can also join in on the effort.
The intent of the update will be to cover a 9 year span of time in a way that is strictly focused on lathe threading using
Mach3 and 4  as the software along with currently available external controllers and breakout boards and other
related threading aids so that a Mach  user has additional basics.

Hopefully the above statement reduces required effort to get it done, and will say, that  the appendix will not be a
book nor a replacement for lack of  vendor information on use of their product.

RICH
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on August 15, 2019, 07:18:51 AM
> so that a Mach  user has additional basics
That seems about right to me.
Rope in Greg, and Andy as well if possible.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 01, 2020, 10:55:11 AM
Hi Friends
I am a long time sufferer of the non threading lathe controlled by the ESS, I just came across this tonight and am interested if this actually works?
For those that do not know my set-up I’m Have a modified lathe running steppers in x and z driving the cross slide ect with ballscrews. the big difference is the spindle is driven by a 2.2kw AC servo with a geared belt 1/.75 reduction to spindle.
Controlled by ESS through a Homman Bob everything works as it should and very well except for threading!!!!!!
I don’t know what it is but I just get multiple start points, first 10 passes could be spot on then it could  turn to @%$^.
Just reading this thread tonight quickly might give a little hope, I have looked at the Warp9 site and there doesn’t seem to be much discussion there, or documentation, I’m using the version from when Andy said threading has been fixed for mach3 users!
What do I need to do to make this work?
Cheers
Katoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 01, 2020, 05:55:27 PM
Yes, it DOES work.
I have a 512 line encoder on the lathe. At first I thought to use all 512 lines for the feedback, but this was not good. It turns out there was too much noise on the individual pulses, due to the small number of clock pulses between each line.  So Andy told me to use 16 lines for the pre-scaler and 32 'lines' for the feedback, or vice versa. That removed most of the noise from between pulses by averaging over a longer period, but 32 updates per rev was so much better than just 1 update, and threading now works very well.

The PID control does not work and you should not bother with it. Mach3 just does not have the bandwidth to do it properly.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 01, 2020, 09:15:13 PM
Hi Roger
That's awesome if it does work!
Where can I find more information about the hookup of this? Its being a long time since I played around with things.
Could I use feedback from my servo? Sorry for the stupid questions just trying to put things in language I understand.
Cheers
Katoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 01, 2020, 10:05:46 PM
Ah, well, um.
The 'manual' has not been written yet. This thread is probably IT.
Yes, you have to use feedback from an encoder on your spindle motor.

Basically, you need the LATEST driver, an adequate encoder on the spindle motor, an input pin for what will be called the MPG A signal, while keeping the Index pulse as well. The MPG A signal is used because Mach3 can be configured to use it without any hassles.

My encoder has 512 lines: 16*32. A 256 line encoder might do. Got some doubts about going very far down from that. Well, a 100 line encoder (10*10) would work, just not as well. Better than nothing of course!

Cheers
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 02, 2020, 12:05:28 AM
Quote
Ah, well, um.
The 'manual' has not been written yet.

Haha , that’s funny!

Ok I will install the newest version of the ESS software step1
On the lathe already is the single slotted disk from previous version, I keep this attached on "index pulse" step2
From my servo drive I have 3 outputs A,B and Z I connect the A+ and A- to the mpg1 input step3
On the servo drive I found two parameters I may need to alter that being the "speed output electronic gear ratio numerator and denominator values" I take it because I have a 1.25/1.0 drive ratio to the spindle. I take it that it should be 100/80 Step4
Now is the part I’m uncertain about, what is the configuration in the software to make all this happen? The other thing is I’m not certain what the encoder pir from the servo is? I take it will be quite a high value, still researching that one. I think its 2500

Thanks for your help Roger!
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on May 02, 2020, 12:14:41 AM
Hi,

Quote
Could I use feedback from my servo? Sorry for the stupid questions just trying to put things in language I understand.

Yes and no. You could use the servo encoder to Mach and that would allow Mach to correctly calculate the spindle rpm.
What Mach, or rather the motion controller, requires in addition is an index signal ONCE PER SPINDLE REVOLUTION.
The motion controller uses the index signal to start the thread. If multiple passes are required to cut the thread to the target
depth then the index signal is critical to get succesive passes synchronised.

As you have a belt reduction between the servo and the spindle the index pulse of the servo encoder will not suffice for
an index signal for thread synchronisation. You either have to ensure that the reduction is exactly 1:1 so that the srevo encoder
index pulse occurrs once per spindle revolutio OR you need to add an index pulse genertor to the spindle.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 02, 2020, 12:30:08 AM
Hi Craig

Yes I do have an index input directly from spindle to mach3, in the form of a slotted disk only one slot triggers an opto sensor works a treat, before I went to the ESS it worked with just the BOB,s use to thread Ok not brilliant but worked.
What I just sort of noticed then is the thread cuts but wants to put a second thread 180 deg from the first one started. look at the pic. Bizzare!
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 02, 2020, 12:46:57 AM
A belt drive? Um, I missed that.
I agree with Craig: the encoder must be on the spindle too. There is too much room for slip and slop with a belt drive for the encoder. This does not mean you can't have a belt drive - far from it. but all sync must be to the spindle itself.

Cheers
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on May 02, 2020, 01:01:36 AM
Hi,
yes, if you use a belt drive it not only needs to be 1:1 but it can have no slip, ie it has to be a toothed 'timing belt'
type otherwise successive thread passes will result in disaster.

Just as a matter of interest how are you driving your servo, step/direction or 0-10V analogue?

I ask because if you use 0-10V analogue, which is by far the most common control methodology for hobby spindles,
then the ESS plugin for Mach4 offers a subtle but powerful advantage over the ESS and Mach3.

In particular the ESS can execute a PID control loop over the spindle motor with the PWM (effectively the 0-10V analogue)
as the controlled variable. This allows for marginally powered and/or low inertia spindles to be precisely and acitvely
speed controlled resulting in more accurate threading.

Note that this speed controll still requires a 'once per spindle revolution index signal' for thread synchronisation.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 02, 2020, 03:31:12 AM
I should clarify a things first.
The spindle is driven by a timing toothed belt, absolute no give in that one.
The timing is still controlled by a slotted timing disk directly off the spindle.
The AC servo works of step and direction, funnily enough I forget certain things that I’ve done and its encoder runs back to mach already on the mpg1, when programming a speed its rock solid in the spindle.
I haven’t yet had a chance to upgrade the software but I am thinking now its something in the config settings.
I an turn the spindle by hand and get an rpm to show on the screen.

Dont know.
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 02, 2020, 03:51:24 AM
Hi all
Thanks for all your help, just a quick update working still on the older software I managed to find some errors, my errors more than anything. I had set the ESS config to RPM setup from mpeg where I only had figures of 1 and 1 in there it was actually still getting rpm feedback from the slotted disk on the spindle (don’t know how). Turns out if I changed a few figures to what they should be it works as it should feedback from the servo and correct speeds through mpeg pulses.
I wish I knew this earlier! A quick trial produced a 1-1/8" UNF thread in some 1020, without an issue. Later I will attempt to load the latest ESS software and do a few more trails, Ill keep you all posted.
Thanks Roger, if this all goes well I maybe able to help you write that manual.  ::)
Cheers
Katoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 02, 2020, 11:29:18 AM
Hi Friends
In this crazy world its amazing how quickly things change. I installed the new ESS software and it seems to be fine, quick test I cut a M12 thread in some mild steel, even cut an M4 thread into a nail, was impressive then tried a larger thread and it all went to hell >:(.
Started doing its usual starting from a random point? The rpm is rock solid, the only thing I notice is the index pulse, on the diagnostic page works well when turned by hand but anything above 20rpm fails to show the index light flash on the on the screen.
On the bob it shows every pulse flash next to its input pin but not on the mach diagnostic page only shows random flashers, could this be the issue?
Thanks
Katoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on May 02, 2020, 05:10:05 PM
Hi,
Machs GUI cannot display fast signals, it is possible that the index signal is operating properly just that it is so fast
that it does not show on the diagnostics screen.

I have heard that some people have found that it is neccessary to make the slot in the disc as wide as possible so that
the index pulse has greater duration.

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 02, 2020, 05:48:37 PM
If you are losing the Index pulse at speed, you need to take a look at the filtering settings in mach3. If they are at all large, then at high speed the pulse may not get through. It may get filtered out. I found that cleaning up the signal outside, by having a good (electronic) driver, plus zero filtering on the Index pulse was what I needed.

Timing belts: there are good ones and bad ones. The old toothed belt designs are not so good: they have backlash. I have replaced those on my machine with GT2 belts, 9 mm wide. You look at the GT2 belts and say 'no way' could they be strong enough, but first look at the mfrs specs for power throughput (Gates web site). Very strong!

You can get 6 mm ones very cheaply on ebay from China: they are strictly speaking NOT GT2 but a simple copy. The profile is slightly different, but in practice the difference does not matter. However, I chose to go up to the 9 mm width, which I got from America. I made my own pulleys with slim taperlock inserts. A good project maybe? (Photo of Z axis drive)

Cheers
Roger

Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 03, 2020, 03:59:11 AM
Hi Craig, Roger
This is definitely an index problem, I cant see any other issue.
One thing that comes to mind was a long time ago before the ESS was installed or the servo spindle. I do remember that I could only get feedback from the index if I bypassed the bob and went directly to mach, Why? we never knew or found out.
Everyone is saying that at speed the GUI wont light up but at 50-100rpm it should come on every time without fail, it doesn’t, that’s not quick pulsing at all.
I am thinking that I might bypass the BOB and run the index pulse directly to the ESS Board, it might save the issue, or its the opto trigger itself, but  I can see it activating the little led on the BOB next to where it plus in every time its triggered and at speed, for some stupid reason the signal is not getting through, hence my erratic start points and the only issue this lathe has.
How can I do this? Or should I do this?
Thanks
Katoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on May 03, 2020, 04:34:54 AM
Hi,
sure test out yor theory by probing the ESS input with an oscilloscope.

The ESS samples at 4MHz and so the Sampling Theorem suggests that the ESS could resolve (with ut aliasing) up
to 2MHz....which should be fast enough!!!

Craig
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 03, 2020, 06:16:50 AM
 the signal is not getting through, hence my erratic start points and the only issue this lathe has.
Hum - you definitely need to probe with a scope. It is faintly possible that the connection has some HW problems. I would suggest that there is NO way you might need to bypass the BoB. Hum - also check all the grounding.

If you don't have a CRO, there is a small problem. Frankly, I can't see one maintaining a complex CNC machine without a CRO! But there are some hacks which could be used if desperate. Q: how's your electronics?

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 03, 2020, 09:43:05 AM
Craig, Roger
Roger if your referring to a CRO as an Oscilloscope, I am out of luck on there and my electronics are not that good. I’ve built 3 machines a router a lathe and a mill(90%) complete. All issues I have had in the past I have solved either by the forums or trialling something different. Still have a sneaking suspicion about the BOB and all the issue I had before the ESS and servo spindle upgrade.
Thanks Again
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 03, 2020, 05:37:25 PM
Have you used the ESS diagnostics? The pin readouts respond a little bit faster.

I have found that rotating the spindle VERY slowly allows me to see the Index pulse even on the Mach3 diagnostics page. Can you do this?

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 03, 2020, 09:15:02 PM
Hi Roger
I can see the light if I go very slow, I haven’t looked at the ESS diagnostics yet, didn’t even know there was one till now :-[
Here is a thread way back before the ESS days when I had the same issue with mach3 and rpm feedback using the same machine.

https://www.machsupport.com/forum/index.php?topic=23520.msg171575#msg171575

I might try today changing the voltage that powers the opto, I know that I am using 12v for the limits and e-stop and the jog buttons. If I remember 5v couldn't cut it. The opto is on 5v I wander if its picking up a stray signal or loosing one or more every now and then. Must state the wires to the opto are shielded and earthed, but the length is a good 1.5m.
Cheers
Katoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 03, 2020, 10:35:55 PM
The 1.5 m of shielded wire, with the shield earthed at the BoB only, should be fine.

I am a bit worried about the 12 V on the switches. That puts a 12 V signal into a logic chip designed for 5 V. Imhe, that can sometimes let the smoke out, or at least do some partial damage.
On the other hand, the BoB requires 5 V and not higher (or lower).

Do you have a circuit diagram covering ESS, BoB, switches and sensors?

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 04, 2020, 04:10:11 AM
Hi Roger
A little bumpsteer the limits are 5v to the BOB they go through a relay triggered by 12v, I forgot, I’m bad!
Do you think I could use my B signal from the Encoder on the servo to trigger the index? That would eliminate the whole opto slotted disk thing and be much more accurate.?
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: Katoh on May 04, 2020, 01:01:04 PM
Friends,
I can not thank you enough  for all your input to help me through this. I believe I have a shooting solution!
I ended up using 12v to power the opto, before I here the gasps it is only the opto, the trigger is still 5v that I took directly from the 5v supply not the 5v from the bob, personally I think this makes no difference, I tried also direct input to the ESS via bob  3 pin 13, yes it worked fine, made no difference? Switch back to pin 13 on the bob 2 as an input but still kept 5v directly from the power supply  0v from the bob and used 12v as the opto power. Confusing Maybe but actually it neatened up a few wires I had.
In saying this all this did is "Sweet FA"  Yes couldn't get it to thread, frustration, lots of!
I started searching for different opto switches , ect when I came across the one thing that sent shivers to my bones, Yes you have to tick sync spindle to index box in spindle setup. Yes I am very red faced and do apologise for wasting a lot of peoples time. Still in saying this it took a lot of tweaking to actually make this work, A real lot of tweaking and some of the figures I am going to state maybe a little over the top but they do work well on my lathe and work well.
Firstly for some stupid reason I activate timing and index on mach3 from the same port and pin? Spindle feedback in Sync Mode and Spindle Speed averaging both ticked in Spindle setup Ports and Pins. General Config Mach3 Debounce interval 10000 and Index Debounce 1000. On the ESS Plugin general config Encoder/mpgs filtering 5.00 .
Now I just like to point out the lathe runs very stable, everything works and works extremely well and now Threading works as well, Why I don’t know and have no explanation  3 days of trial and error may have paid off. The only issue I cannot get True rpm readout above 1500rpm, but can still run the spindle to 2000 without an issue.
The pic shows 3 different threads the bottom is a bolt 3/8 UNC but to trial I set it up to cut the first 1/2"which you can see by the different colouring were the lathe cleaned it up, I ran this program 5 times without fail each time had 12 passes. The Brass is the same thread ,the first 1/2" is scrap from trails but the back 1/2" is the new thread that was cut , Not bad I think. The top is a piece is 1020 steel That I cut 1.1/8" UNF but did it 14 times each time decreasing the X by 0.2mm the code took 15 passes each time, Why I wanted to make certain it would index to the same point every pass which it did. I am happy with this.
I hope it keeps behaving itself!!
Cheers
Kahoh
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on May 04, 2020, 05:35:20 PM
Happy threading!
Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rafatpanahrm@gmail.com on February 10, 2021, 09:26:35 PM
Is there any documentation on the ESS features to read encoder feedback for tapping? I haven't been able to find any documentation. I have an AC servo as a spindle motor (mill, connected via a geared timing belt, right now 2:1 ratio, controlled via step/dir) and want to try out tapping in aluminum.

I have the encoder feedback read into Mach3 as MPG#1 and it's working well. However when I try to use the PID control the spindle RPM control is not great. I have tried to play around with the PID parameters but haven't gotten anything to work well. I am guessing the Mach3 PID control feedback and the servo driver controller are fighting each other. I don't need spindle RPM feedback, but just to tie the encoder feedback back into Mach3 to adjust Z feed rates.

Is there a way to enable the ESS feedback without enabling PID controls? Thanks for any assistance!
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on February 10, 2021, 09:35:21 PM
I have the encoder feedback read into Mach3 as MPG#1 and it's working well.
This is as good as it gets - and it is not bad.

when I try to use the PID control the spindle RPM control is not great.
Don't bother: it does not work. Nice try, but the Mach3 update rate was too slow for it to work.

Is there a way to enable the ESS feedback without enabling PID controls?
You need the Index pulse for two things: RPM and threading sync.
You need the encoder A channel for the improved threading control via the ESS, NOT via Mach3.

To explain: what the ESS encoder support does (MPG #1) is to allow the ESS to control the Z axis speed for threading. If the spindle slows down, tough, but the ESS knows and it slows the Z axis down to match. I repeat: this is a function in the last driver release for the ESS; it is not a function in Mach3.

Cheers
Roger
PS: it works fine.
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rafatpanahrm@gmail.com on February 10, 2021, 10:35:19 PM
Thanks for the clarification! With the latest ESS driver, is there anything you need to enable (or other settings) besides the RPM feedback with both index and MPG#1 encoder (I have both A and B channels hooked up, but I don't believe the B channel is used from what I read).

I haven't attempted (or really determined what is involved in the tapping process yet G-Code wise) tapping yet, but I will try some tests soon!
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: rcaffin on February 10, 2021, 11:42:35 PM
With the latest ESS driver, is there anything you need to enable (or other settings) besides the RPM feedback with both index and MPG#1 encoder
Not as far as I can remember.
Experiment! Air cut, then soft plastic, then soft aluminium.

Cheers
Roger
Title: Re: Mach3 and latest ESS Driver - threading now works!
Post by: joeaverage on February 12, 2021, 02:25:23 PM
Hi,
spindle PID is for Mach4 only, it does not work in Mach3.

Clarification: This refers to realtime spindle PID enacted by the ESS

Craig