grbl / grbl

An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino
https://github.com/gnea/grbl/wiki
Other
5.42k stars 3.04k forks source link

Alarm,Lim:000 Arduino CNC Shield #1880

Closed N-Tinga closed 3 weeks ago

N-Tinga commented 3 weeks ago

I have been working with Arduino and the CNC Shield V3 in tandem with LabVIEW to operate a single axis CNC machine. Until yesterday it has been running with no issues, running GRBL 0.9j (as the V3 CNC Shield does not support newer versions of GRBL), and using Machine Control Toolkit found here.

Then for some reason I started getting an alarm state <Alarm,Lim:000> which as best as I can tell, is an alarm warning me that no limit switches are pressed, which seems like a good thing but the alarm state prevents LabVIEW from sending gcode instructions. I thought something in the GRBL config had been messed up, so I rechecked the state using Universal Gcode Sender (UGS Version 2.1.6). When connecting, it also gets the alarm, but I am able to unlock the device by using $X (the unlock command). Checking the config, settings are as they should be for hard limits and NO switches, $5=0, $20=1, $21=1 (if a full list of config values is needed, or a console output of the machine state let me know). So using UGS I can control the machine no issue after I unlock it. So my current plan of action is to figure out how to clear the alarm in LabVIEW every time I connect (by sending $X).

However I am confused as to why the alarm is occurring in the first place as it seems to be complaining about being in the desired state (i.e. not hitting the limit switches). I have tried changing out the limit switch, the cable connecting it, the USB to Arduino connection, rebooting the program, the PC, re-flashing GRBL, downloading a fresh version of the Machine Control Toolkit, and checking all the connection on the board and CNC Shield. Nothing makes the alarm go away or otherwise seems to be amiss. I will take a quick look at the debouncing settings in the config next. If there are suggestions for resolving or removing this alarm I would greatly appreciate it.

breiler commented 3 weeks ago

You probably have the status report setting to report limit switches which might not be compatible with LabVIEW. https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9#10---status-report-maskbinary

Try setting it to the default value $10=3

The alarm is likely the machine telling you to home it before using. Deactivate homing if you aren't using it: https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9#22---homing-cycle-bool

N-Tinga commented 3 weeks ago

Exactly the issue, I had changed it to view the state of the limit switches while I was trying to get the homing sequence to run. Not sure why LabVIEW does not like it, but setting $10=1 or $10=3 works, sending an alarm that still allows LabVIEW to run as normal. After running the homing sequence in LabVIEW, the Alarm changes to Idle. Thanks for you help and quick reply!