Good morning all I am busy building a CNC router machine. I am at the point now where I am installing the proximity sensors (NPN type). I am a newbie in the CNC world so excuse me if I ask simple questions. I use CNCJS and have enabled hard limits through $21=1. After I activated it I got the following message: CNCjs 1.10.2 [Grbl] Connected to COM4 with a baud rate of 115200 Grbl 1.1f ['$' for help] client> $$ $0=10 (Step pulse time, microseconds) $1=25 (Step idle delay, milliseconds) $2=0 (Step pulse invert, mask) $3=0 (Step direction invert, mask) $4=0 (Invert step enable pin, boolean) $5=0 (Invert limit pins, boolean) $6=0 (Invert probe pin, boolean) $10=1 (Status report options, mask) $11=0.010 (Junction deviation, millimeters) $12=0.002 (Arc tolerance, millimeters) $13=0 (Report in inches, boolean) $20=0 (Soft limits enable, boolean) $21=0 (Hard limits enable, boolean) $22=0 (Homing cycle enable, boolean) $23=0 (Homing direction invert, mask) $24=25.000 (Homing locate feed rate, mm/min) $25=500.000 (Homing search seek rate, mm/min) $26=250 (Homing switch debounce delay, milliseconds) $27=1.000 (Homing switch pull-off distance, millimeters) $30=1000 (Maximum spindle speed, RPM) $31=0 (Minimum spindle speed, RPM) $32=0 (Laser-mode enable, boolean) $100=500.000 (X-axis travel resolution, step/mm) $101=500.000 (Y-axis travel resolution, step/mm) $102=500.000 (Z-axis travel resolution, step/mm) $110=500.000 (X-axis maximum rate, mm/min) $111=500.000 (Y-axis maximum rate, mm/min) $112=500.000 (Z-axis maximum rate, mm/min) $120=10.000 (X-axis acceleration, mm/sec^2) $121=10.000 (Y-axis acceleration, mm/sec^2) $122=10.000 (Z-axis acceleration, mm/sec^2) $130=200.000 (X-axis maximum travel, millimeters) $131=200.000 (Y-axis maximum travel, millimeters) $132=200.000 (Z-axis maximum travel, millimeters) ok feeder> G91 feeder> G0 X5 ok feeder> G90 ok ok feeder> G91 ok feeder> G0 X-30 feeder> G90 ok ok feeder> G91 feeder> G0 X30 ok feeder> G90 ok ok > $21=1 ok ALARM:1 (Hard limit) [MSG:Reset to continue] client> Grbl 1.1f ['$' for help] [MSG:���'|'$X' to unlock] client> $X [MSG:���������������������'|'$X' to unlock] ok ALARM:1 (Hard limit) [MSG:Reset to continue] client> $X client> Grbl 1.1f ['$' for help] [MSG:���'|'$X' to unlock] client> $X [MSG:���������������������'|'$X' to unlock] ok ALARM:1 (Hard limit) [MSG:Reset to continue] > From here nothing I do seems to work. So I disabled my Arduino Uno R3 board and disable the Hard Limits again. After that CNCjs work again and can I do test runs. Is there anything else that I must do?
You may need to set $5 depending on whether the switches are NO or NC. FWIW, I would enable homing and soft limits and leave hard limits alone.
I don’t think you need to do anything to UGS, you just need to set up your grbl controller. Homing: Set up the Homing Cycle Set your machine travel in $130…132 and enable soft limits in $20 Grbl v1.1 Configuration
Thanks for the info. I do however see that you need limit switches to do your homing, which bring me back to my original challenge.
The link I posted above to setting up the homing cycle walks you through setting up the limit switches too. Are your sensors NO or NC? Use the troubleshooting tab on Control to verify that the limit switches are operating correctly before enabling homing.
What kind of sensor? If inductive, is it PNP or NPN? If you are having issues, microswitches are easy, cheap, and accurate.
Especially Xtension Limit Switch Kit (and little known fact, more repeatable than inductives - they drift quite a bit depending on the flux of the magnetic field as well as temperature)
Just a status update. I have connected a micro switch to the x axis. Cncjs showed the same message as described in my original post. I do not know what to do next. I need to home my machine and I do need some limits. O yes and the power to the control box is earthed.
Are your microswitches normally closed? Your original post suggests that you had a permanent "triggered" signal from your sensor. Try changing $5 to 1. Alex.
Hi Alex. I connected the switches as normally open as the proximity sensors were that. I will try $5 =1 and will get back to you.
Arduino, with NO switches = $5=0 Sure you wired correct pins (Using a CNC shield? Cheap Chinise Chinese knockoff clone with the Z switch on the wrong pin? Or proper Protoneer original. Or followed Grbl Wiki and wired correctly directly to Arduino?) Use CONTROL instead of CNCJS see which switch is triggered - probably just one not all OpenBuilds Software: OpenBuilds CONTROL and OpenBuilds CAM - FREE software to run your CNC, Laser, Plasma or Pen Plotter > Troubleshooting tab Or, ran the 6-30v Inductives (typical) powered off PSU, and burned out the limits inputs (max 5V)
Hi Peter You gave me a mouth full to think about. What I can tel you is that my uno r3 is original. I believe that I wired it correctly. There is something that do bother me and that is how can a micro switch and a proximity sensor give me the same error/alarm if they operate in totally different ways.
The limits you were having trouble with. Inductives needs voltage divider or reverse diode, limit switches can be wired wrong too. Also so we can check you have the right pins Connecting Grbl etc
Hi Guys. I want to use my proximity sensors and have read that I will need to use 10Kohm pull up resistors. Where do I install them?
On a Blackbox : plug and play On a Arduino. No pull ups. But you need to run NPN type, on 6-30v. Then to prevent damaging the arduino, level shift the signal. Not as easy it looks. To install an inferior sensor (terrible repeatability). Their only advantage is waterproofness. Not worth it
Thanks for the reply Peter. I bought the NPN sensors to do my limits but it seems now that I must accept that I am not going to use them and write it of as school fee's.
Hmm. I was wondering if I could find out what type of output circuit they had, but there isn't sufficient information. ('Open Collector' NPN outputs can be connected straight to an Arduino, but I can't tell if these are Open Collector or not, so wouldn't like to risk it.)
I tried connecting them directly. When I enable $21 after connecting them that is when the alarm message appears.
Without wiring pics we can't confirm. But keep in mind they need at least 6v (so run them off PSU) - BUT BUT BUT some of them do float at supply voltage (PSU voltage into 5V GPIO = dead arduino) thus usually circuitry in between (optocoupler, reverse biased diode, voltage divider etc) If you powered them off 5V they won't be "on" thus always locked off
I did an of machine test. I connected the blue wire to ground and the brown to positive on my 24v power supply. I connected the black wire to pin 9 on the Arduino board. Nothing weird about that. It is just as soon as the limits are enabled nothing happens, so something needs to added or remove to make it work. The other strange bit for me is that I was under the impression that the led on an NPN sensor will be off and only comes on when an obstacle is sensed. All my the led's on the connected sensors were on without any obstacles present and goes of when an obstacle is sensed.