Delay axis movement while brake releases

More
16 Jan 2021 18:53 #195558 by lllars
I have a 4th axis with brake on my mill. I want to set it up like a locking indexer, where the brake is on whenever the axis is stopped. But I also want to be able to jog the axis and (ideally) use it for coordinated moves also. So, I can't just use the built-in locking_indexer functionality (which only allows G0 moves).

I have it set up using a wcomp to check if the commanded velocity for the axis is non-zero, and that controls the brake. It all works great except that I am losing a few steps during the fraction of a second it takes for the brake to disengage. How can I delay sending steps to the axis until after the brake disengages?

Here's the relevant section of my hal file:
### handle 4th axis brake ###
loadrt wcomp names=wcomp_vzero
loadrt not names=not_vzero
loadrt timedelay names=timedelay_brake,timedelay_brake_movement
addf wcomp_vzero			servo-thread
addf not_vzero				servo-thread
addf timedelay_brake			servo-thread
# wcomp output is true when input between min and max, false otherwise
setp wcomp_vzero.min			-0.0001
setp wcomp_vzero.max			0.0001
setp timedelay_brake.on-delay		1.0
setp timedelay_brake.off-delay		0.0
net a-vel-cmd => wcomp_vzero.in
# drive is wired so that brake is on when switch is off
# so need to invert logic
net A_stopped wcomp_vzero.out => timedelay_brake.in
net A_brake_on timedelay_brake.out => not_vzero.in
net A_brake_off not_vzero.out => hm2_7i95.0.ssr.00.out-02

Please Log in or Create an account to join the conversation.

More
16 Jan 2021 23:55 - 16 Jan 2021 23:56 #195596 by andypugh
One way is to set the adaptive feed to a _tiny_ number such as 10e-10. Not high enough for anything to actually move, but high enough for the axis velocity to not be exactly zero. Then set the adaptive feed to 1 as soon as the brake is released.
Last edit: 16 Jan 2021 23:56 by andypugh.

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 02:20 #195625 by lllars
But for moves that don't involve the 4th axis, the brake won't (and shouldn't) be released. So motion would never proceed.

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 02:27 #195627 by lllars
Hmm.. I wounder if I could twiddle the a-enable or hm2_7i95.0.stepgen.03.enable pins.

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 03:17 #195629 by lllars
This is looking promising. I've got a timedelay set to enable the axis about 40 ms after the brake is turned off. I do get a following error, but if I dial down the acceleration of that axis a bit, the f-error is manageable and drops back to zero after ~300ms.

I'm sort of simulating this tonight with only the PC and Mesa card powered up, but all the motor drivers powered off. I'll fire it up all the way tomorrow and see if it actually works and if the dial indicator shows I'm still losing any steps.

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 12:08 #195652 by chris@cnc
Hi,
one solution would be to use motion.feed−inhibit.
At time when brake is working, stop motion in machine. So should not possible, that any pulse go lost.
Usually is the brake control by M-Code to avoid any flicker. So take a look that the brake operate not so nervous. Relay contacts burn very fast by this way.

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 12:45 #195654 by andypugh

chris@cnc wrote: Hi,
one solution would be to use motion.feed−inhibit.


That makes it very hard to tell if any axis is attempting to move.

The reason I suggested the miniscule adaptive-feed approach is that it is the only way that I have found to tell if a joint is commanded to move without it actually moving.

There must be other ways, as the GUIs can show "distance to go" but I don't think that is available in realtime on a HAL pin.

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 12:50 #195655 by andypugh

lllars wrote: But for moves that don't involve the 4th axis, the brake won't (and shouldn't) be released. So motion would never proceed.


You never told us you wanted to be able to move other axes :-)

This is probably a job for a simple custom HAL component that arbitrates between various states and sets adaptive feed accordingly.

All axes stationary - adaptive feed 1e-10 - brake on
Any axis but Z moving - AF 1 - brake on
Z moving and brake on - AF 1e-10, brake release
Z moving and brake released - AF 1, brake release

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 13:47 #195662 by chris@cnc

andypugh wrote: That makes it very hard to tell if any axis is attempting to move.


you are right.:laugh:
I not want to measure the movement in this way. But i thing it's safe to stop all motion in case off using a brake. So it's more a proposal in future if problem solved.
Another idea about this issue.
Any axis are little move during working brake by gravity.
Do you have an external encoder?

Please Log in or Create an account to join the conversation.

More
17 Jan 2021 22:51 #195717 by lllars
Toggling the enable pin did work. It turned I needed only about 30ms of delay, so the following error was not an issue. Of course as I was polishing it up, I had the servo drive manual open, and realized it could handle the brake engagement for me, delays and all. So that's how I've got it hooked up now and it is working well.

Thank you for helping me think through this guys. Andy, your solution sounds like it would be a good one, especially if the delay needed was longer than mine was.

Please Log in or Create an account to join the conversation.

Time to create page: 0.100 seconds
Powered by Kunena Forum