Hello Guest it is March 29, 2024, 06:49:45 AM

Author Topic: Closed loop system, encoder connected to mach3  (Read 64578 times)

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Closed loop system, encoder connected to mach3
« Reply #20 on: October 24, 2014, 09:53:10 AM »

So our stepper is cruising along at whatever rpm and for some reason misses a step. The next pulse comes along and what? Well it's not going to move the stepper because the driver is in the wrong phase. Our stepper is still stalled. The next pulse comes along. No - still out of phase - our stepper stays where it is. In fact with a full step drive the stepper will miss 4 steps minimum because of incorrect phase and will allways lose steps in multiples of 4. (In a microstep system it will miss 4*microstep steps before the driver issues the correct phase signals). Anyway back to our full-step system - the 4th pulse comes along - good - correct phase, the motor moves a step from stationary. The 5th pulse comes along. Ooops - way to soon. The controller is sending out pulses at the speed the motor would have been going if it hadn't stalled, but it has only done one step from stationary - don't we need an acceleration ramp? The 6th, 7th, etc. steps are all too close together - stall....


That paragraph answered many questions, never thought about it like that.

So, when you energise a stepper system from cold, is it instantly in the correct phase to move properly?

I need to read up on steppers ;)
Re: Closed loop system, encoder connected to mach3
« Reply #21 on: October 26, 2014, 03:13:07 PM »
So, when you energise a stepper system from cold, is it instantly in the correct phase to move properly?
I need to read up on steppers ;)

No!  That's why if you close down Mach and "save fixture", and try to start again from cold, the stepper may move a little when re-energised and be in a slightly different plave from where they were when closed down.  When I turn the drivers off or on there is a thump from the drives as they move slightly to align with wherever the drive phases are.

But yes, it can now move properly from wherever it now is but that wasn't quite where you left it. 

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Closed loop system, encoder connected to mach3
« Reply #22 on: October 27, 2014, 03:12:27 AM »
Excellent, thanks. I get that thump too when starting up.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Closed loop system, encoder connected to mach3
« Reply #23 on: October 27, 2014, 08:35:36 AM »
Ian, here is my $0.02 that you did not ask for...  :)

    I wrote a plugin for a vendor, that would take in encoder values, and do an "Adaptive"
feed rate adjustment, i.e. slow the feed by 10% if the encoders where within a following (corrective) error band, it also had a Max error that would be an estop, then it had an "Acceptable" following error band in which it did not correct. While in the corrective band, it would slow the machine, then after it got through the "Hard" part, it would then ramp back up in 10% increments back to its original speed. 
    This worked in theory, and in bench top testing.... BUT..........  did NOT work in real world application on my test mills.  And that was due to the slow speed of the update loop in Mach3.
when machining a part that had a "Hard" spot in its material (or DOC was greater in that area),
the steps that where lost in the engine(s) loop would build up quickly, and already be past the MAX error when the plugin got around in the 1/10th loop. That was using the Para Port.
On the other machine, with an external motion card, the problem re-presented itself in a slightly different manner, in where the "buffered" moves would build up error, and again, you would be behind the MAX.  Under certain conditions, like cutting "soft" material, the system did work, in where the slow down was not that much through the softer material, in that LIMITED case it would do adaptive feed........
        But, again, having said the above...  I only run servos on my machines, so, having read your in-depth explanation on steppers and how they react to following errors..... I suspect the results would have been even worse.  The Plugin in its way would stop the machine and "catch up" the servos... but.... the part was completely non-acceptable, once you have lost those steps especially on a simple or compound curve...  you can easily see the "opps" area.
        The adaptive approach may, I repeat MAY work in wood since the tolerances are a lot looser, but, really only on straight lines.......curves or intricate designs I think you would see the error in the cut where the Axis lagged to much.
        From my point of view, for following error adaptive correction to work correctly, or at least useable, the Hardware (motion card or device), would have to be designed with that in mind in advance. The speed needed to catch this, and do something about it would be at the hardware level, and basically it would just notify the software of what it did about it when it got around to servicing the board...

        Note: I am NOT saying that it can not be done, I have not had the guts to try it at the Brain/Macro-pump level, since in my mind plugins should be more stable or at least reliable.  But, I have not tried it, nor will I since testing is expensive with broken tools, or crashed axis...

        My suspicion would be, that some enterprising user could take an Arduino, to read the encoders, and do the following error math/decisions and notify Mach about it, or control mach depending on what it decided to do about the current error condition(s). This could interface through a Plugin or some kind of hybrid Brains/Pump thing.... Good luck to the brave sole that tries it, and GOOD JOB if you get it to work good!!

Scott
fun times

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Closed loop system, encoder connected to mach3
« Reply #24 on: October 27, 2014, 12:59:51 PM »
We do all realize the thrux of this thread is 4 and 1/2 years old? - Not sure why it was resurrected or whether I can summon the effort to read who said what all over again TBH  ;)

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Closed loop system, encoder connected to mach3
« Reply #25 on: October 27, 2014, 02:21:50 PM »
opps, didnt pay attention to the age............
fun times

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Closed loop system, encoder connected to mach3
« Reply #26 on: October 28, 2014, 07:31:10 AM »
LOL - no worries Scott - seems that thread resurrection is happening a lot lately  ;D

Ian

Offline DMBGO

*
  •  201 201
  • Time is the same in a relative way
    • View Profile
Re: Closed loop system, encoder connected to mach3
« Reply #27 on: April 09, 2015, 07:05:21 PM »
Well Easter has just been and gone, so there is a bit of it around :)
Cheers

David