Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Cbyrdtopper on March 27, 2018, 10:55:29 AM

Title: A Aixs Brake
Post by: Cbyrdtopper on March 27, 2018, 10:55:29 AM
We use the 4th axis on our VMCs to run our product and we use the pneumatic brake whenever we are machining finishing passes.

We have 3 other types of controllers here in the shop; Fanuc, GSK, and Haas.  All of these controllers apply the brake when the A axis is not moving.  

I never work with the Axis or Jog controls from the API so I don't know if this is a possibility to do in LUA, is it possible to code this in Mach4?
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on March 27, 2018, 12:46:56 PM
I found this in the API  mc.mcAxisIsStill(inst,AixsID)

This works when I'm jogging; Keyboard and On Screen Buttons.

This does not work when it is in G Code or MDI. 

I would like some insight into this.  Thanks in advance!

local AAxisStill = mc.mcAxisIsStill(inst,3)
local Output30 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT30)
if AAxisStill == 0 then
    mc.mcSignalSetState(Output30,0)
    else
    mc.mcSignalSetState(Output30,1)
end
Title: Re: A Aixs Brake
Post by: Chaoticone on March 27, 2018, 03:38:52 PM
Would the output for the brake not be a  function of the drive? All I have ever seen required voltage to release the brake. 0 volts allows the brake to lock. Not sure I have ever seen one work as your describing. When the servo is powered up it shouldn't allow the axis to move. Usually the brake is only applied at power out, drive fault, etc. but I think I have seen the option for setting it up like you want in some drive configuration software.
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on March 27, 2018, 03:43:57 PM
No, the brake is to hold it from rotating while machining.  It's on the 4th axis; not the X, Y, or Z. 

Anytime the A Axis moves on our Johnford, GSK, or Haas machines, it releases the brake and has a delay ever so slightly to release pressure and then rotate.  Then it locks when it is finished with its move. 

It's not like a brake for an axis with a ballscrew. 

However, I haven't thought of making it work off of hardware, AKA the drive.  I'll look into that as well.
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on May 10, 2018, 05:20:40 PM
Okay, so I've found an output on the servo drive that I can potentially use to actuate the brake on and off.

The only issue I foresee running into will be the brake being on for the first part of the turn while the valve releases the pressure.  It will be a very small amount of time because the Solenoid will be on the 4th axis, so the hose will be very short.  But still, the signal I found from the drive is instant on/off with pulses.  Off with any motion and On once it is stopped. 

My question is this, is there a way to delay an axis' motion from for lets say 100 milliseconds?          Running from MDI and G Code; if it is in a jogging state I will turn the brake off all together. IE Keyboard Inputs Enabled or MPG Enabled.

I tried to make an "a" macro based on the fact that I made a "t" macro to preload the tool magazine.  I was going to add a mc.mccntlMdiExecute(inst, "G04 P200") or a mc.mccntleGCodeExecute(inst, "G04 P200")   But these did not work, I was hopeful but doubtful.  Any ideas?
Title: Re: A Aixs Brake
Post by: Chaoticone on May 10, 2018, 08:11:47 PM
Yeah, that won't work. I was thinking or an electric brake inside the servo (even though you said it was pneumatic  :-[). You will need a delay so it doesn't tear itself up.

Does the brake have a confirmation switch confirming it is active or inactive or does it just fire a solenoid and hope for the best?

The only way I can think of to do what you want is 2 custom macros. One would have to be called before the A moves to unlock it and dwell and the second would have to be called after A moves to lock it and dwell...... unless there is some dwell parameter/s in your drive to tune that output. If the brake has a confirm switch you could probably use mc.mcSignalWait in the macros for the dwell.
Title: Re: A Aixs Brake
Post by: smurph on May 10, 2018, 10:42:24 PM
It is usually called a clamp if it is pneumatic.  And since they are pneumatic and cause a delay, most of the time they are engaged/disengaged with M codes.  A lot of MTBs (Machine Tool Builders) use M10 and M11 for the 4th axis clamp.  M11 and M12 for the 5th axis clamp.  But they are really all over the map with not much of a standard.  An electric motor brake can usually be driven with an output on the drive because it is fast acting.  

To do the 100ms wait, that would really have to be a function of a motion plugin to detect the motion on the A before it was actually executed.  The motion plugin could simply wait 100ms (or more or less) or wait on an output, etc...  before executing the motion.  Pretty custom.  Or you could simply let the A axis handle a lot of following error and let it catch up?  

Steve
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on May 11, 2018, 08:25:27 AM
Brett,
I'm trying to get away from having macros before and after the A Axis move; that's what we do now.  It doesn't have a confirmation, it is just a solenoid. 

Steve,
This motor doesn't have a brake on it. 
I'm assuming a motion plugin would be difficult to make for this application?  I have no idea where to even start with that or how to do it.
What do you mean let it have following error and catch up?  Let the drive and motor lose commanded position from the brake and let the servo and drive do its thing to get back to position?
Title: Re: A Aixs Brake
Post by: smurph on May 11, 2018, 02:10:14 PM
Well...  you would have to ask your motion control vendor for the custom work, as you are already using a motion plugin.  I wasn't suggesting that you write one for yourself.  Unless you are also the type that also likes poking knitting needles through their ear drums.  :)

As for the following error, yes.  If we are talking 100ms of time, and you are using servos, the drive for the A axis could be setup to handle a lot of following error before faulting out.  The other thing you could do to help this out is set the accel on that A axis motor to be rather wimpy.  So that it won't try to move a whole lot very fast. 

Steve
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on May 11, 2018, 02:33:36 PM
Hey Steve,
Not a fan of needles of any kind lol so.... I won't be writing one myself.

Yeah, I thought about having a really slow ramp.  As is, that's the best way I could think of to keep it from moving while the brake is still applied. 

I pretty much just use the HiCON from Vital Systems now.  Won't hurt to ask if they can help.
Title: Re: A Aixs Brake
Post by: dbt3000files on January 28, 2019, 12:09:11 PM
Any luck in getting mc.mcAxisIsStill working?  I am having the same problem that when running gcode it returns positive no matter what the axis is doing.
Thanks,
David
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on January 28, 2019, 12:32:01 PM
I haven't tested this any further, maybe Brett or Steve can chime in on this one.
I found out how to get Fusion to post an M Command to engage and disengage the A Axis Brake for 3+1 or simultaneous 4th axis machining, so I don't need the mc.mcAxisIsStill right now.

I read the thread you just started,
It was suggested in this thread that you may be able to get an output from the drive to use.  I was able to get an output off the drives I was using; but then I ran into the delay time needed to release the brake completely, so I was unable to use it effectively.
Title: Re: A Aixs Brake
Post by: dbt3000files on January 28, 2019, 05:56:28 PM
Hey thanks for the reply,
I actually need something from Mach4 to initialize a check on the motor.  Essentially I am trying to create an extra level of safety in the case of a wire fault or any other reason signals might not get to the motors. I am using clearpath motors, which will know if they are out of position, but if a signal fails to reach them, they won't know they missed anything. 
I had a strange incident when Mach4 stopped sending step and direction signals intermittently when jogging.  The whole program was behaving erratically and was fine after a restart, but it was enough to make me want to create a way for the clearpath motor to verify that it is moving when Mach thinks it is.
Title: Re: A Aixs Brake
Post by: Cbyrdtopper on January 28, 2019, 06:24:26 PM
It sounds like you want communication from the drive to Mach.   You will need some sort of output from the motor drive to do that
Title: Re: A Aixs Brake
Post by: dbt3000files on January 28, 2019, 08:12:51 PM
Yeah, that's no problem for the Clearpath motors.  They have a pretty wide range of output options to choose from including one that is high whenever it is moving.  I just need mach4 to know when to look for it, and to trigger an estop if it doesn't see it.  That's why I was thinking mc.mcAxisIsStill would be perfect.  I could just put something into the plc script that says that every time the axis is moving, if a particular input is low then perform an estop.
Not sure if that is all correct, but it might be a moot point if I can't find a way to query if an axis is moving or not.
Title: Re: A Aixs Brake
Post by: Chaoticone on January 29, 2019, 11:32:30 AM
If you want to know if an axis is moving or not get its velocity.

velocity, rc = mc.mcAxisGetVel(
   number mInst,
   number axisId)

Description:
Get the velocity of an axis in user units per min.
Title: Re: A Aixs Brake
Post by: dbt3000files on January 29, 2019, 02:39:10 PM
Ha! I should have thought of that!
Works Perfectly.  Thank you so much!!!!
Title: Re: A Aixs Brake
Post by: Chaoticone on January 29, 2019, 06:39:28 PM
 :)

No problem, glad it helped.