Hello Guest it is April 28, 2024, 12:47:00 AM

Author Topic: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.  (Read 10098 times)

0 Members and 1 Guest are viewing this topic.

Dear,
About the encoder inputs of the ESS board with Mach4:
a) Is Mach4 capable of detecting a "following error" and performing an emergency stop? Consider a step loss situation detected by the encoder reading.
b) Can Mach4 acquire the current position after an emergency stop? That way, the CNC would not be forced to seek home again.

Best regards,
Felicio Gesser
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #1 on: June 23, 2019, 02:57:03 PM »
Hi,

Quote
Is Mach4 capable of detecting a "following error" and performing an emergency stop? Consider a step loss situation detected by the encoder reading.

The ESS can read the linear encoder and can transmit the result to Mach4 but with a communication delay of several or maybe tens
of milliseconds. Mach would then compare the actual position result with its 'assumed' position. Remember that Mach believes
that machine is at position A, because it has sent moves to that effect, but those moves have been buffered so the machine
may not have made those moves yet and still be some way short of position A. The concept of where Mach 'thinks' the machine
and where it actually is, is indeterminate because of the comm delay is one direction and the variance of the length of
the buffer in the other.

The problem is that Mach4, or rather the Windows PC it runs on is not a real time system. The communication delays and
the motion buffer prevent you from having a real time feedback loop.

Controllers like the Hicon can be activated (at a cost) or the CSMIO/A can be feedback controllers because all of the feedback
processing is done on board in real tume without the comm delays of reporting bac to Mach.

If you use a modern servo and servo drive it will have a 'following error' function built in. Thus if the accumulated commanded
position from Mach differs by more than so many encoder counts (programmable) it would raise a fault.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #2 on: June 23, 2019, 03:39:37 PM »
joeaverage, Thanks

I ask my question in another way:

Would the ESS board (on its own firmware) be able to detect a "following error"?

I noticed the following information:
https://warp9td.com/index.php/gettingstarted/setting-up-the-smoothstepper-and-mach4
Encoder 0 Phase A
Encoder 0 Phase B, ...
(Please see attached picture.)

What would be the function of the encoder inputs on the ESS board?

Best regards,
Felicio Gesser
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #3 on: June 23, 2019, 07:58:58 PM »
Hi,

Quote
Would the ESS board (on its own firmware) be able to detect a "following error"?

No. The ESS is not a feedback controller.

As I have previously explained, due to comm delays/buffering, neither is Mach4 capable of direct feedback control.

The principle function of the MPG read inputs of the ESS is to hook up handwheel. The ESS reports to Mach that the handwheel
has been operated and Mach can then issue move instructions to the ESS and thereby move the machine. There is a small
time delay, inconsequental for manual handwheel operations but inadequate for closed loop feedback.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #4 on: June 23, 2019, 09:40:15 PM »
Hi,
the general trend in CNC is for each servo/servo drive to be ever smarter.

In the early days of CNC servo drives were just amplifiers, they required a precision analogue input from the motion controller.
The controller would monitor the encoder/resolver and make adjustments to its analogue output to effect feedback control. So all the
smarts were in the controller and the servodrive was dumb.

A more recently the controller offers step/direction commands to the servo drive. The encoder is hooked NOT to the controller
but to the servodrive. The servo drive has the smarts built in to close the loop. Mach4 is natively a step/direction controller
and this is the sort of servo/ servodrive I would recommend.

The latest and greatest servodrives actually have a partial motion controller built in and they do their own motion control for its own axis.
Ethercat is an example of this. Mach still plans the trajectories and communicates to each servodrive but each servodrive does it own motion
control. This is an example of 'distributed motion control'. Mach is not 'yet' quite ready for Ethercat, but it will be. Whether you and I will be ready
any time soon is another question!

As to your current question if you use a modern servo and drive (prefered) or alternately a closed loop stepper (less advantageous but useful) you
can achieve what you want.

If your axis is coupled to a ballscrew then the rotational position MUST be directly linked to the linear position. Thus the encoder of the servodrive (or closed loop
stepper dive) performs identically to a linear scale attached to the axis and can signal a fault if the commanded position deviates from the actual position.
Given that this is monitored by the drive (realtime) then there is no issue with delays/buffering with Mach.

As an example I have a secondhand Allen Bradley servo I bought for a spindle motor. It is not new by any stretch of the imagination but is stil really really good.
It has an 8000 count per rev encoder. It has two (among many)  parameters that I can program. One called 'following error window' I can program from as low as 4 encoder counts
up to 8000 counts. The default (where I tend to leave it) is 20 counts. If the output shaft of the servo gets more that 20 counts (0.9 deg) away from where it should be
it faults. The other is called the 'zero window. Its default is 4 counts. It means that when the servo shaft is within 4 counts (0.18 deg) of its commanded position
it ceases to try to close the loop any further.

If you had such a servo hooked to your axis would that suffice? It relies on the smarts in the servodrive which as I started with is the current trend in CNC.
Using a linear encoder and a smart controller is more the way things used to be done.

Craig
« Last Edit: June 23, 2019, 09:43:47 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #5 on: July 01, 2019, 07:46:05 PM »
Thank you for the detailed explanation.

I consider that the Mach4-EtherCAT will be the biggest gain for the automation of CNC machines.

I use servo motor (step / dir) in low cost application.
From my experience a board like ESS based FPGA could be able to monitor the pulse train read by the encoder.
I'm talking about a passive comparator (no PID control).

You need to imagine a situation where the ESS commands pulses but the signal is lost before reaching the servo drive input.
If the ESS board monitored the encoder it would be possible to detect the error (pulses commanded - pulses executed).

Best regards,
Felicio
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #6 on: July 02, 2019, 03:59:08 AM »
Hi,

Quote
From my experience a board like ESS based FPGA could be able to monitor the pulse train read by the encoder.
I'm talking about a passive comparator (no PID control).

You are correct, the ESS COULD be a feedback controller but Warp9 have expressed no interest in doing so. A major part
of that thinking is because each servo and servo drive is  a feedback loop. Thus all an ESS need do is provide open
loop step/direction commands and allow the servo and drive to follow. The servo/drive have an  following error window
and can monitor if the loop gets out of whack with respect to the input commands.

Quote
You need to imagine a situation where the ESS commands pulses but the signal is lost before reaching the servo drive input.

Imagine what situation? Are you talking a faulty breakout board?

My ESS has never lost any pulses in the four years I've been using it. As an example I have a PCB
program that I run from time to time, it is a largish but detailed board and it takes 10-12 hours to run. At the end of the
program  I can drill a 0.4 mm through hole EXACTLY through the hole I drilled at the start of the job. If Mach, or the ESS,
or my BoB's, or my stepperdrives, or my stepper lost a step that would not be the case.

Quote
If the ESS board monitored the encoder it would be possible to detect the error (pulses commanded - pulses executed).

What I have proposed is that the servo drive monitor the commanded position (the cumulative step/direction position) by
Mach/ESS and the machines actual current and live position which achieves exactly what you are proposing.

There are controllers that can do as you wish, but they start at six and more times the cost of an ESS. In addition those
controllers are suffering a shrinking share of the market because of the to trend smart servo drives, the motion controllers
don't need it any more, in fact Ethercat does away with the motion controller altogether and 'distributes motion control'
amongst its Ethercat slaves.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #7 on: July 19, 2019, 12:24:39 PM »
Hi Craig,
 
You are correct, the ESS COULD be a feedback controller but Warp9 have expressed no interest in doing so. A major part
of that thinking is because each servo and servo drive is  a feedback loop.


The three main reasons we have not done this yet are:

1) Servos with their closed loop control solve the issue for the majority of users who need it.  This makes it a lower priority for us than other features that we have been delivering like Laser Raster and THC.

2a) In Mach4 a person could write their own lua script to monitor the distance of actual vs commanded and if the following error gets too large stop.  Admittedly this wouldn't be ideal and it would be better done in the Servo or the motion controller.   This would be happening all the time during GCode.

2b) If you are running in exact stop mode, whenever the motion stops and Mach receives an all stop position update, the lua script could see the reported position vs the glass scale position.  This is a better option, especially in the lost steps scenario, telling you if things got off.  But again only at stops not during motion.

3) The ESS doesn't have room in its FPGA for us to do it on board at this point.  We are planning to make closed loop control an option in our next product, where it would be in the SmoothSteppers firmware.

Andy
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #8 on: July 19, 2019, 05:49:08 PM »
Hi Andy,

I was interested in this new product.
Can you anticipate any information?
1. What are you planning to start selling?
2. Will the closed loop be with a step-dir or +/- 10V interface?
3. Support for 4 or 5 axes?
4. Planned price?

Best regards,
Felicio
Re: Mach4 plus Ethernet SmoothStepper with encoder or linear scale.
« Reply #9 on: July 20, 2019, 12:45:01 AM »
Hi Felicio,

The new product won't be available until later this year. 

It will have the same connectors and placement as the ESS.  It will have a step/dir interface (or CW / CCW, or quadrature, just like the ESS), but it won't have a +/- 10V interface. It will be able to perform a real-time comparison of the commanded position and a linear encoder and either EStop or perform a controlled slow stop.

It will support as many motors as the ESS does, which is 6. 

The price will be similar to the price of the ESS.

Andy