Need Help! How to generate a Mach3 error when a drive gives a fault output


Results 1 to 8 of 8

Thread: How to generate a Mach3 error when a drive gives a fault output

  1. #1
    Registered
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    99
    Downloads
    0
    Uploads
    0

    Question How to generate a Mach3 error when a drive gives a fault output

    Hi,

    I am working on a cnc plasma machine controlled by mach3. All motors are leadshine closed loop.
    If the drives go into error, I want the machine to stop all motion until that error is fixed.

    I wired the fault output of the drives to 4 different inputs. In ports & pins I configured them as input #1 to #4.


    Can anyone help me on how to generate different errors for different drives, and to block all motion until the error is fixed.
    Should this be done in the macropump? And what would the code look like?
    I should tell that I have no experience with VB scripts yet, and only little with mach3 so far.

    EDIT:
    Would it look something like this:
    If Not IsEStop() And IsActive(INPUT1) Then
    DoOemButton(1021)
    Message "ERROR: X-axis drive fault (master rail axis)"
    End If

    If Not IsEStop() And IsActive(INPUT2) Then
    DoOemButton(1021)
    Message "ERROR: XX-axis drive fault (slave rail axis)"
    End If

    If Not IsEStop() And IsActive(INPUT3) Then
    DoOemButton(1021)
    Message "ERROR: Y-axis drive fault (transverse axis)"
    End If

    If Not IsEStop() And IsActive(INPUT4) Then
    DoOemButton(1021)
    Message "ERROR: Z-axis drive fault (torch height axis)"
    End If
    It's not doing exactly what I want it to do though, but I don't want you guys get the feeling I'm not trying anything myself.
    What I want it that only when the system is not in e-stop mode, and the input is high, then the message should come and the machine should go back into e-stop.
    If the system is already in e-stop, I want nothing to happen. What I see with this code is that when I play it once, I see a message "EStop Button Pressed. Then when I play again the E-stop is removed and then my previous error message is shown.
    So apparently the e-stop message is always on top of other messages. How can I display my error message and let the machine stop everything, as if it was on E-stop.
    I don't want to make a separate DRO for the error message, if that is even possible...

    Regards,
    Sascha

    Similar Threads:
    Last edited by skillalot; 04-29-2015 at 11:02 AM.


  2. #2
    Registered
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    99
    Downloads
    0
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    Oke, haven't been waiting but have been trying myself as well.
    This is what I came up with so far, and it seems to be working.
    I placed this in the Macropump...

    '================================================= =
    ' Check Alarm outputs of drives, generate e-stop
    '================================================= =
    If IsActive (INPUT1) And Not IsEstop() Then
    DoOemButton(1021)
    Sleep 500
    Message "Error X-axis (Master rail) drive fault"
    Sleep 500
    End If

    If IsActive (INPUT2) And Not IsEstop() Then
    DoOemButton(1021)
    Sleep 500
    Message "Error XX-axis (Slave rail) drive fault"
    Sleep 500
    End If

    If IsActive (INPUT3) And Not IsEstop() Then
    DoOemButton(1021)
    Sleep 500
    Message "Error Y-axis (Transverse) drive fault"
    Sleep 500
    End If

    If IsActive (INPUT4) And Not IsEstop() Then
    DoOemButton(1021)
    Sleep 500
    Message "Error Z-axis (Torch height) drive fault"
    Sleep 500
    Else
    End If
    If the error output of the drive triggers one of the inputs, and the machine is not in e-stop already, then OemButton( 1021 (e-stop) is activated and the machine goes to e-stop.
    After 500ms the message will overwrite the e-stop message on the status line, and the real error is visible.




    Still have a minor problem, when the machine goes to e-stop like this, it is like if it is trying to get itself out of e-stop.
    I head the other motors trying to engage every second or 2.
    Is there a way how to prevent this?






    For those interested, I also edited the homing routine to automatically enable the softlimits if they are not already enabled.
    '================================================= ======
    'Homing routine
    '================================================= ======

    'Home the machine
    Message "PLEASE WAIT: MACHINE IS REFERENCING"
    DoOEMButton(1024) 'Z-axis
    DoOEMButton(1023) 'Y-axis
    DoOEMButton(1022) 'X-Axis
    While IsMoving()
    Sleep 100
    Wend

    'Move the machine away from homing switch
    Code "G0 F3000"
    Code "G1 F3000"
    Code "G91"
    Code "G1 X10 Y-10"
    Code "G90"
    While IsMoving()
    Sleep 100
    Wend

    'Check softlimits enabled, if not enable them
    If Not GetOemLED(23) Then
    DoOemButton(1029)
    Message "Homing completed, Software limits enabled."
    Else
    Message "Homing completed."
    End If
    Sleep 1000
    Message ""




  3. #3
    Member CS900's Avatar
    Join Date
    Aug 2006
    Location
    USA
    Posts
    670
    Downloads
    0
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    Hi,
    i have a cnc mill that i'm looking to do the exact same thing to. Can you please tell me how to implement this code into mach3. I'm a terrible programmer i'm afraid, lol.



  4. #4
    Member
    Join Date
    Mar 2009
    Location
    Romania
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    Modify the second sleep value from every cycle from 500 to 5000. Drives need to be shut down for error led to be off



  5. #5
    Member
    Join Date
    May 2014
    Posts
    1
    Downloads
    2
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    ok,, this is the right code to include in macropump.m1s to generate an Mach3 error :


    '================================================= =
    ' Check Alarm outputs of drives, generate e-stop
    '================================================= =
    If IsActive (INPUT1) And IsEstop()=0 Then
    DoOemButton(1021)
    Sleep 500
    Message "Error X-axis drive fault"
    Sleep 500
    End If

    If IsActive (INPUT2) And IsEstop()=0 Then
    DoOemButton(1021)
    Sleep 500
    Message "Error Y-axis drive fault"
    Sleep 500
    End If

    If IsActive (INPUT3) And IsEstop()=0 Then
    DoOemButton(1021)
    Sleep 500
    Message "Error Z-axis (Motor height) drive fault"
    Sleep 500
    Else
    End If





  6. #6
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4252
    Downloads
    4
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    Me, I would just AND all those fault lines (via diodes) to the eStop line.
    You could stick diagnostic LEDs on the fault lines if you wish.

    Cheers
    Roger



  7. #7
    Member CS900's Avatar
    Join Date
    Aug 2006
    Location
    USA
    Posts
    670
    Downloads
    0
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    Quote Originally Posted by RCaffin View Post
    Me, I would just AND all those fault lines (via diodes) to the eStop line.
    You could stick diagnostic LEDs on the fault lines if you wish.

    Cheers
    Roger
    that's what i ended up doing. My drives have a fault light on them so i just crack open the cabinet and see which axis faults. not as convenient, but it's saved me once already.



  8. #8
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4252
    Downloads
    4
    Uploads
    0

    Default Re: How to generate a Mach3 error when a drive gives a fault output

    Just so.
    For each axis, I have a current meter, a magnetic circuit breaker and the diagnostic LED. I find watching the ammeters interesting: they never read much more than 0.5 A, if that. So much for needing kW motors on the axes.

    Cheers



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

How to generate a Mach3 error when a drive gives a fault output

How to generate a Mach3 error when a drive gives a fault output