Replies: 3 comments 6 replies
-
Motor fault does not seem to be fully supported across all platforms yet. Within the Teensy driver there is an '#if MOTOR_FAULT_ENABLE #define MOTOR_FAULT_PIN n' within GRBLHAL2000_map.h, but MOTOR_FAULT_ENABLE does not appear in any other place, so is never defined. Following the trail for the safety door activation: Along the same lines: Within the iMXRT1062 (Teensy) driver, driver.c has multiple functions which make use of SAFETY_DOOR_PIN, but nothing that makes use of MOTOR_FAULT_PIN. grbl/state_machine.c has a STATE_SAFETY_DOOR, but no STATE_MOTOR_FAULT or similar. grbl/system.c uses the safety door status or signal in the control_interrupt_handler(), disable_lock() and go_home(), but only uses signals.motor_fault in control_interrupt_handler() and go_home(), but not disable_lock(). Since STATE_SAFETY_DOOR is likely to be a temporary state that can be resumed from, but STATE_MOTOR_FAULT is likely to be terminal, they probably need to be handled differently, but the core support for motor faults does not seem to be complete yet. Is this an active area of development? |
Beta Was this translation helpful? Give feedback.
-
Correct, it has to be added to the input definitions array as a minimum.
I have kept this for backward compatibility - I want to rename, or perhaps remove it, it as pin definitions do not belong in the core. Signal handling functionality does,
No, see above. It should be enough to define the pin in the map file. Or perhaps also by adding a plugin that claims an aux input.
Again correct, currently the signal resets the controller so it is pretty harsh. It can surely be improved upon.
Not really, but can be made active again if a reasonable functionality can be agreed upon. This discussion could be what is needed to get it completed? |
Beta Was this translation helpful? Give feedback.
-
The motor fault signal does require an additional (ideally interrupt capable) input pin on the MCU, and those are always in very short supply. Of course now that I say that I realize that adding a polling check to the (core) motor fault signal in stepper.c would actually be pretty effective. At least on platforms like STM32 it would be helpful to poll it since it is pretty easy to fill up all of your interrupt pins on that chip. To me it seemed that the action taken in the event of motor fault was appropriate (effectively e-stop) since by definition position has been lost if the motor faults and homing is required. It is useful to the user to have the motor fault code appear rather than e-stop so that it is immediately obvious why the system has halted, so it would be good for us to start exposing this signal in more of the drivers. I guess if @Squeack with your implementation, if you are able to somehow correlate received step pulses with the encoder position you might be able to keep track of position in the event of following error and use the motor fault to signal the core to pause rather than halt so that the motor could catch up? |
Beta Was this translation helpful? Give feedback.
-
Moved from terjeio/grblHAL#356
Stepper motor control is open-loop and cheap. Servos are closed-loop and expensive. I am planning on partly closing the loop on my stepper driven system by feeding the step and directions outputs from the GrblHAL controller (Teensy based breakout board) to both the stepper drivers and to a separate position tracker based on a Raspberry Pi Pico. The three movement leadscrews will be linked via timing belts to 200PPR rotary encoders which will feed back to the Pico. After allowing a ratio for micro-stepping the Pico will then raise an error if the driver instructions and position feedback do not match within a given tolerance.
This has to be communicated to the GrblHAL controller somehow. What would be best? Triggering the door open switch? Does GrblHAL react to the limit switch inputs for the A or B axis even if compiled to handle only three axes?
Terjeio replied in old discussion forum:
Suggestion to use motor fault pin in newer versions. A & B limit switch pins do not respond for 3 axis mills, but can be repurposed.
Beta Was this translation helpful? Give feedback.
All reactions