Originally Posted by
mmurray70
Its probably a good idea to wire in the alarm signal, but keep in mind if you set max following errors the machine will stop anyway as soon as theres a problem with a drive and the move is not completed. I just set my machine to do an E-stop when following error was exceeded. Saved the hassle and clutter of extra wiring and saves a few inputs if you need them. Its not as critical say as spindle drive alarm, you definitely want to monitor that. Machines dont cut well at all after the spindle stops lol.
I have a similar approach using a watchdog, but if user runs the Main INIT code again the following error is reset and user can jog other axis without a fault until user jogs axis that faulted, then KmotionCNC will go into ESTOP again. With the ALM input from drive KMotionCNC stays in ESTOP until servo drive is reset to clear the fault.
I actually found the issue with my code when i was working on my MPG code. When i added the Servo Drive Error input part of code...
Code:
// Handle Y Axis Servo Drives Error Line
result = Debounce(ReadBit(YSDERRORLINEBIT),&ysdecount,&ysdelast,&ysdelastsolid);
if (result == 1)
{
DoPC(PC_COMM_ESTOP);
ClearBit(145);
ClearBit(153);
ClearBit(154);
MsgBox("Y ServoDrive Fault",MB_OK|MB_ICONEXCLAMATION);
ClearBit(144);//Enable/Disable MainContactorRelay for servo drive main & logic power.
i forgot to add the state variable for switch debouncing ....
Code:
int ysdelast=0,ysdelastsolid=-1,ysdecount=0;
Now when drive faults i get the pop up message window stating "Y ServoDrive Fault" and after i click the OK button on pop up my Main Contactor for servo drives disables. And the pop up goes away. If i dont clear bit 144 after i click OK i get a loop of my pop up window because the ALM pin of drives toggles state of kanalog input .
At some point it would be nice if KMotionCNC had a status line somewhere, like at top of window in the title bar. And either have the message scroll across or simply flash.
But anyhow, ALM input is working.
Now iam working on getting the code for my pendant into Main C code. Currently i have the MPGsmooth code(which works better than the new Hurco at work) in my Main C program and working. The pendant has a + and - button for continuous jogging, that i cant figure out how to code. The 2 buttons should act like an axis Jog button on the KMotionCNC screen. And my selector switch on pendant would select what axis to jog.
I have looked at the examples JogWithPot and JogWithTogglesAndPot c codes. But cant figure out how to combine the 2 and use the Jog Rate DRO box i have on KMotionCNC for jog speed. Curious...Is there code for using Hotkeys that are assigned to on screen buttons that could be used ?
Anyone got any clues?
Thanks,
Troy