How to control brake before moving ?

More
22 Jul 2025 18:33 #332198 by bladekel
How to control brake before moving ? was created by bladekel
I have an axis that I use with a stepper motor with brake. Before this axis starts moving, I have to disable the brake, wait for the mechanical delay and then move it. And when the movement is finished, I have to activate the brake immediately. I used the following commands to do this.
loadrt ddt count=1
loadrt abs count=1
loadrt comp count=1
loadrt timedelay count=1
loadrt not count=1

addf ddt.0 servo-thread
addf abs.0 servo-thread
addf comp.0 servo-thread
addf timedelay.0 servo-thread
addf not.0 servo-thread

# Joint 3 movement detection
net joint3-pos-cmd joint.3.pos-cmd => ddt.0.in
net joint3-velocity ddt.0.out => abs.0.in
net joint3-vel-abs abs.0.out => comp.0.in0
setp comp.0.in1 0.001  

setp timedelay.0.on-delay 0   
setp timedelay.0.off-delay 1 

net joint3-moving comp.0.out parport.0.pin-14-out timedelay.0.in
net dontMove timedelay.0.out => not.0.in
net canMove not.0.out => stepgen.3.enable
I can do what I want in manual movement with these commands. But when I use it with mdi commands, it gives “joint 3 following error” error.

How can I solve this?
The following user(s) said Thank You: COFHAL

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

More
22 Jul 2025 20:07 - 22 Jul 2025 21:49 #332204 by PCW
Replied by PCW on topic How to control brake before moving ?
net canMove not.0.out => stepgen.3.enable

My guess is that this causes the following error
when motion starts and this is still false.
That is, the commanded position is changing but
the stepgen is disabled so cannot follow ( so the
stepgen feedback is static) so you get a
following error.

Edit:

If linuxCNC is allowed to start motion before the brake is released,
Expanding the following error limits seem like the easiest solution.
However now this joint will lag the others so coordinated motion would
not be possible.

Is there some way to use digital inputs and outputs in the
gcode to manage the brake? That is, use a digital output
to enable the brake and a digital input to signal when the brake was
full applied and fully released. You would do this using M62,M63 and
M66 in the gcode and the hal digital input and output pins.

www.linuxcnc.org/docs/devel/html/gcode/m...e.html#mcode:m62-m65
Last edit: 22 Jul 2025 21:49 by PCW.
The following user(s) said Thank You: bladekel, COFHAL

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

More
23 Jul 2025 05:07 #332212 by Aciera
Replied by Aciera on topic How to control brake before moving ?
Maybe have a look at the 'joint.N.unlock' pins:
linuxcnc.org/docs/html/man/man9/motion.9...OINT%20unlock%20pins
The following user(s) said Thank You: bladekel, COFHAL

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

More
23 Jul 2025 09:02 #332216 by bladekel
Replied by bladekel on topic How to control brake before moving ?

Maybe have a look at the 'joint.N.unlock' pins:
linuxcnc.org/docs/html/man/man9/motion.9...OINT%20unlock%20pins
 

It seems to work for me.
Is there any example for unlocking an axis?
The following user(s) said Thank You: COFHAL

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

More
23 Jul 2025 15:23 #332226 by Aciera
Replied by Aciera on topic How to control brake before moving ?
The intended use is for indexing rotaries as described in this section:
linuxcnc.org/docs/stable/html/config/ini...:ini:sec:axis-letter

If you need more than just G0 moves then you would likely need to make something up in HAL.
The following user(s) said Thank You: bladekel

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

More
23 Jul 2025 15:35 - 23 Jul 2025 15:40 #332227 by bladekel
Replied by bladekel on topic How to control brake before moving ?

The intended use is for indexing rotaries as described in this section:
linuxcnc.org/docs/stable/html/config/ini...:ini:sec:axis-letter

If you need more than just G0 moves then you would likely need to make something up in HAL.

 

I can only control the brake with G0 moves.
here is the way;
[EMCMOT]
EMCMOT = motmod unlock_joints_mask=0x08
...

[AXIS_A]
...
LOCKING_INDEXER_JOINT = 3

[JOINT_3]
....
LOCKING_INDEXER = 1

I have to control the brake for G0,G1,G2,G3 and manuel movements. Because that axis' motor has mechanical brake.
In any type of movement, brake is have to be deactivated and after the movement it has to be activated again.

Do you have any opinion else ? What else I have to try?
Last edit: 23 Jul 2025 15:40 by bladekel.

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

More
23 Jul 2025 16:03 #332228 by PCW
Replied by PCW on topic How to control brake before moving ?
The gcode (M62,M63,M66) method with digital I/O will work for any motion but you need to change the gcode.

 

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

More
23 Jul 2025 18:35 #332237 by Aciera
Replied by Aciera on topic How to control brake before moving ?
The usual reason for brakes on non-indexing axes is to avoid unwanted motion when a driver is disabled. So, my first question would be as to why the motors on your machine need to have the brake applied while the motor drive is enabled.

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

More
23 Jul 2025 22:28 #332243 by pippin88
Replied by pippin88 on topic How to control brake before moving ?
Why do you need to control the brake like this?

Stepper motors have full torque at 0rpm. If the stepper is powered you should not need the brake. Brake should be turned off when the CNC is powered on, then brake should reactivate when CNC is powered down.

Or is this a brake for 4th axis machining?

Brakes integrated into steppers or servos are not designed to be used for machining, they are jus to hold axis position when the motor is off. Usually to stop Z axis falling under gravity.

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

Time to create page: 0.074 seconds
Powered by Kunena Forum