"Motion Inhibit" Function Help


Results 1 to 10 of 10

Thread: "Motion Inhibit" Function Help

  1. #1
    Registered
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    33
    Downloads
    2
    Uploads
    0

    Default "Motion Inhibit" Function Help

    Hi All;

    I'm a newbie with Mach4, hope someone can point me in the right direction. I'm having trouble utilizing the "Motion Inhibit" input. I have a set of servo ready signals wired to provide proof to the system that the servos are ready to receive pulse and direction signals. They are wired to Pin 12 Port 1 of my BOB. I can map the input to a light on the screen (that is set to indicate the status of the "Motion Inhibit Input") so I believe Mach should be seeing it. It just does not inhibit Mach from sending out drive signals to my servo's. I expected to see an alarm / warning that "Motion Inhibit" was active. ????? Its like I have to activate that feature or something??

    BTW
    Windows XP
    Mach4
    Smooth Stepper
    C23 BOB

    Thanks in Advance
    Jim

    Similar Threads:


  2. #2
    Member
    Join Date
    Nov 2013
    Posts
    4371
    Downloads
    0
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Hi,
    you'll get more replies if you ask on the Mach4 board of the Mach Support Forum.

    I suspect that the problem is that while Mach4 has a signal called Motion Inhibit it does not do anything.
    Another guy I helped found the same with the signal Spindle At Speed. He thought that because it was
    defined by Mach then it should do a certain thing. He was incorrect. The information carried by the signal
    has to be incorporated into some code to have it do as you wish.

    It is true that certain signal are not only defined but already have specific actions associated with them but most do not.

    This is an example of a 'object oriented' style of programming, a much more modern style than Mach3, where a signal (object)
    is defined but its action is separate.

    Craig



  3. #3
    Registered
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    33
    Downloads
    2
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Craig;
    Thanks, that would explain what I am seeing. After thinking about it, I believe I will try to add code to link the signal to the "Machine Enabled" function. The enable button on the screen writes to this function and will stop the machine so it should work?? I'm hoping to be able to hold the Machine Enabled low while the Motion Inhibit Input is Low. Then allow the operator to Re Enable the machine only when the input is High.

    As you say the "Motion Inhibit" is already coded to be a recognized signal, just needs to be told to do something.

    Thanks,I'll update if I make any progress.
    Jim



  4. #4
    Member
    Join Date
    Nov 2013
    Posts
    4371
    Downloads
    0
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Hi,
    yes there are a number of choices.

    You could, as you say, have the Motion Inhibit signal disable the machine with this API:
    LUA Syntax:
    rc = mc.mcCntlEnable(
    number mInst,
    number state)

    Description:
    Enable or disable the control.

    But you could have it do a number of other things. How about an Estop? Another would be FeedHold.

    FeedHold would mean that the moves within the controller would execute and then the machine would stop. You could restart
    without homing thereafter. If you Estop, Stop or Reset then the machine would stop immediately aborting the moves already committed
    to the motion controller. You would loose reference and so would have to home before resuming.

    If you have axis brakes, the Z axis particularly, how do you handle that?

    You need to consider whether the spindle and coolant is turned off. If you have hydraulic or pneumatic clamps you need to decide how
    they are handled.

    The great strength of Mach4 is that it is so amenable to customization....but it comes at a cost.....you become the programmer and the responsibility
    for the safe and effective actions of your machine are your responsibility.

    Craig



  5. #5
    Registered
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    33
    Downloads
    2
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Craig

    Yes you are correct, there are a lot of things that can be done with a programmable system such as Mach. I try and find the easiest way to Implement what's needed. I my case I really want to implement another Estop type stop. The basic logic being. If Servo's or spindle are not happy, stop all motion. I was going to just hardwire it that way into the Estop Bob Input, but wanted to bring it thru Mach so I could better identify the trip condition.

    I have it working now by using a one line PMC program that uses an input to trigger an EStop condition. Actually seems to work just the way I want.
    Jim



  6. #6
    Member
    Join Date
    Nov 2013
    Posts
    4371
    Downloads
    0
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Hi,
    I think in this case it may be even simpler than that.

    I would put an entry in the signal library table for the signal ISIG_MOTION_INHIBIT which caused the machine to disable.
    Some thing like this:
    Code:
    mc.ISIG_MOTION_INHIBIT]=function(state)
    		if (state==1) then
    			mc.mcCntlEnable(inst,0)
    		end
    	end,
    Put that in SigLib near the top of the screen load script and your done!

    If you put code into either the PLC or the PMC then that code runs every few milliseconds in the case of the PLC and even more frequently for the
    PMC, but why....you only need to disable the machine WHEN the signal changes to high. That is exactly the purpose of the signal library table.
    Its such an elegant and code efficient use of Lua's one and only data structure.

    Craig



  7. #7
    Registered
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    33
    Downloads
    2
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Quote Originally Posted by joeavaerage View Post
    Hi,
    I think in this case it may be even simpler than that.

    I would put an entry in the signal library table for the signal ISIG_MOTION_INHIBIT which caused the machine to disable.
    Some thing like this:
    Code:
    mc.ISIG_MOTION_INHIBIT]=function(state)
    		if (state==1) then
    			mc.mcCntlEnable(inst,0)
    		end
    	end,
    Put that in SigLib near the top of the screen load script and your done!

    If you put code into either the PLC or the PMC then that code runs every few milliseconds in the case of the PLC and even more frequently for the
    PMC, but why....you only need to disable the machine WHEN the signal changes to high. That is exactly the purpose of the signal library table.
    Its such an elegant and code efficient use of Lua's one and only data structure.

    Craig
    Craig;
    Thanks
    I'll try it and compare the results
    Jim



  8. #8
    Registered
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    33
    Downloads
    2
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Craig;

    I tried your suggestion. It works to stop the motion but I can not get it to block a restart. I took your example and triggered the Estop

    [mc.ISIG_MOTION_INHIBIT]=function(state)
    if (state==1) then
    mc.mcCntlEStop(inst,0)
    end
    end,

    Same Result. Any suggestions?

    Is there an efficient way to do what my crude PMC program did?

    Jim



  9. #9
    Member
    Join Date
    Nov 2013
    Posts
    4371
    Downloads
    0
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Hi,
    the signal library idea is efficient because the code runs only on the signal event, ie when ISIG_MOTION_INHIBIT changes state.
    Your PMC script repeatedly tests the input and so while it consumes processor time it does enable an enduring machine state change
    that the signal library idea lacks.

    If you require an enduring fault condition that can't be cleared until the Motion Inhibit input clears then I would stick with your PMC script.
    It was always done this way in Mach3....it certainly wont harm Mach4.

    Craig



  10. #10
    Registered
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    33
    Downloads
    2
    Uploads
    0

    Default Re: "Motion Inhibit" Function Help

    Craig;

    Thanks for the help and conversation, it's always good to hear ideas and talk it thru. Before I started this Thread I had never been in the script editor of Mach4. It appears similar to the Mach3 scripting environment. (Not that I have spent much time in either, LOL) So thanks for taking the time to respond.

    Jim
    BTW I initially had the scan time of the PMC script set to the default 10ms. There were no noticeable performance issues. I have it set to 100ms now with no noticeable performance change.



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

"Motion Inhibit" Function Help

"Motion Inhibit" Function Help