Adding error sources to LinuxCNC
For example: I have two Y joints (gantry mill) that both receive the same motor position command. If these get out of sync more than 0,2mm I currently throw a joint 1 servo fault by setting axis.1.amp-fault-in to true. This works, but then I have to start halshow to figure out what really caused the error.
A message saying 'Y joints out of sync' and the same behaviour as a normal amplifier fault would be much nicer. And I do have more critical error sources that I would like to give their own message. Spindle VFD communication failure, spindle temperature too high, spindle overtorque, incoming power supply phase loss, etcetera.
And then I have less critical error sources such as 'mist cooler fluid reservoir empty' which I might want to handle with a program pause and temporary spindle shutdown or so. Of course I can manipulate HAL pins to do so, but I would like to have an error message displayed.
Is it possible to add error sources to LinuxCNC?
I am using LinuxCNC 2.7~pre and gmoccapy as the UI, if that matters.
Please Log in or Create an account to join the conversation.
I would write a component to take the inputs and monitor them.
Then you can report a fault with rtapi_print_msg(RTAPI_MSG_ERR, "Error state in gantry Y axis joints"); or whatever
which will display in Axis and presumably in gmoccapy as well.
If you create other pins in the component, you can make program pause toggle on the state of that pin, halt spindle etc
An alternative HAL solution, could be to use the multi-label widget in pyvcp, which I wrote to display up to 6 legends.
Depending which pin is high it will display different pre-defined text
regards
Please Log in or Create an account to join the conversation.
Writing a component works for me; 'comp' makes this easy. Do I have to include header files to use rtapi_print_msg?
If I detect a fatal error and have printed the error, how do I put LinuxCNC in the error state? I could foce an E-stop through HAL, but I suppose there exists something like 'rtapi_send_message (YIKES)' or similar?
Please Log in or Create an account to join the conversation.
Do I have to include header files to use rtapi_print_msg?
Not if you are using comp
If I detect a fatal error and have printed the error, how do I put LinuxCNC in the error state?
There is no such thing in absolute terms.
You need to decide what you want to disable, until the error is cleared.
Connecting one of your output pins to halui.abort will stop everything in the same way as pressing Esc
halui.program.pause will just pause.
You have quite a wide choice just in halui, enable pins, estop, flood off etc etc
regards
Please Log in or Create an account to join the conversation.
For those 'there is something that needs attention but not critical enough to abort all operations, shutdown the servo drives, etcetera' HAL/halui is the way to go indeed.
Please Log in or Create an account to join the conversation.
Exporting a pin and routing it externally to and2/or2 components and finally to estop increases the complexity of the HAL logic without any benefits.
There is no complexity, the other connections in the hal file work on the iocontrol pins.
You just need
net sig1 mycomponent.progstop-out => halui.abort to stop a program
But that is not the same as estop, depends how complex your logic chain is, as to whether you want to go that way
regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Its stupidity drives me nuts.
Please Log in or Create an account to join the conversation.