Hello Guest it is October 20, 2020, 11:12:44 AM

Author Topic: Pending signal managment on mach3  (Read 180 times)

0 Members and 1 Guest are viewing this topic.

Pending signal managment on mach3
« on: May 29, 2020, 08:55:44 AM »

I have a closed loop stepper motor with a stepper driver that can output a PEND signal that, if I understood correctly, should be used to comunicate that the last order was completed and the driver is waiting for the next order. Is there a way to implement a sort of closed loop software management on mach3? Maybe something that tell to mach3 to don't send the next order as long as the PEND signal is not active.
Is it possibly present in mach4?


Offline Tweakie.CNC

  • *
  •  8,507 8,507
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Pending signal managment on mach3
« Reply #1 on: June 04, 2020, 01:49:49 AM »
Mach3 was never intended to be operated in that manner but it does support the M1 optional program stop. This command could be linked to an input pin so that Mach3 could be toggled between start and stop by an external signal.

I am sure Mach4 could be operated in a similar manner.

Re: Pending signal managment on mach3
« Reply #2 on: June 04, 2020, 04:09:54 AM »
yes Mach4 can be operated that way but why?

This question has come up before....and on the surface it seems reasonable enough...ie have Mach wait until one move is complete
BEFORE issuing the next move...right??

Well no actually. Mach issues a stream of commands without regard to whether the drive and steppers can keep up, but that's what you've got
closed loop steppers for, they will fault 'following error' should they ever 'fall' behind the commanded position. When they fault 'following error'
the machine will Estop.

What prevents Mach from issuing instructions faster than the machine can respond?....remember you program Mach with max acceleration and
velocities, which are determined by the steppers and drives, and if chosen correctly the machine will go as fast as its drivers and motors will take
it without losing steps and without Mach getting ahead of itself. This applies equally to open loop steppers as closed loop steppers or even servos.
The advantage of servos and closed loop steppers is that the drive will signal an error if Mach attempts to issue instructions faster than they can handle.

So you can see that having Mach wait it not actually necessary. In fact its worse than not necessary. If Mach waits for a move to complete before
it issues the next move the machine will stop and have to wait for Mach to receive the Pending signal and then wait while Mach sends it a new instruction.
That would be really 'jerky'. Its not dissimilar to 'Exact Stop' mode in Mach3. Try it...you probably won't like it. Mach (3 or 4) runs best in
'Constant Velocity' mode where it tries to blend the end of one move into the start of the next move. It keeps the machine moving and is (usually)
faster and smoother.

Having Mach wait until it receives a signal to proceed with the next move will make the machine slower and jerky.

My wife left with my best friend...
     and I miss him!
Re: Pending signal managment on mach3
« Reply #3 on: June 05, 2020, 03:37:01 AM »
Hi thanks both for the reply.
Actually I was pretty sure that doing something like this would have been not good for the “fluidity” of the program execution. I was just trying to image a way to close my motor loop at a software level instead of driver level in a way that is not just sending an alarm signal that stops everything but actually correct the positioning error. I also checked if it was possible to implement a linear scale reading and automatic correction with mach3 but it seems very hard to even find a motion controller and bob combo capable to handle this, same or even a worst problem at the software level. I thought that a sort of algorithm similar to those used in lan communication could have solved the problem somehow.
Re: Pending signal managment on mach3
« Reply #4 on: June 05, 2020, 04:13:31 AM »
neither Mach3 or Mach4 are feedback software, Windows all but precludes realtime operation and therefore the feedback loops have delays in them
which screw it up bigtime.

The current paradigm in industrial machine control is moving away from feedback controllers in any event. The feedback loops
are actually between the drive and the servo, and the drive is it's own motion controller as part of a distributed motion control solution.
Read up on EtherCat, its a fascinating insight into where motion control is going.

If you want to have linear scale feedback in addition to step/direction control the I suggest that you look to recent developments in AC servos.
The Delta A2 series servos for instance have a ridiculously high resolution encoder (1,280,000 count per rev) but in addition have a second
encoder channel for a 'load monitoring' encoder, aka a linear encoder. What's more these A2 series are only another $40-$50 more than
the B2 series (160,000 count per rev encoder, without load sensing).

Most of the top tier servo manufacturers offer load sensing.

My wife left with my best friend...
     and I miss him!