Z Limit switches

Hi Guys,

I’m in the process of installing 2 limit switches on my Meticulous Z set up right now, for use with the M2 board ( Due Board )

I’m assuming there are pins already assigned for this on the Arduino Due, Can anyone point me to an article?

I know there have been discussions, but I am not aware of a solution.
I will surely watch this thread. Limit switches would be very useful.

Here are some previous discussions:

Hope these help. I haven’t tried limit switches, but I remembered there were some previous conversations.

I do not see any aux pins on the board therefore there is no way to do this on a hardware level. Might be some software settings? that allow it?

the TLE5206 board and original board may or may not have aux pins depending on what version you got, but looks like the DUE does not

What are the pins on the green Phoenix on the left for then?

2 Likes

2 Z+ and 2 Z- could indicate that z-limit switches are supported on the hardware side.
The next 2 questions would be:

  • are they supported by the firmware
  • are they supported by the software
1 Like

I’m sorry, none of these seem to cover the new Arduino DUE board & new motor shield.

According to what I have read, the Arduino DUE shield is based on grbl.

Is this the correct documentation here?

grbl absolutely supports limit switches. They are generally wired in series, so that the two switches at each end of any axis generate only one signal. i.e. the Z max and Z min limit switch will generate a single Z limit signal, but the software knows which way it was driving the axis so it assumes the limit switch in that direction is the one that was reached. Not that it matters, as the firmware just stops the motors and generates an alarm condition in any case.

I can’t see that any work has been done to tailor grbl’s limit switch behaviour to Maslow. It might be ok just for Z-axis range checking, but it won’t work with homing. In terms of which pin to connect then if it’s not obvious from the PCB decals then you could look at the firmware to see which pin is defined for the Z limit, then look at the PCB to see if that pin goes anywhere.

If the limit switch code is present then activating that pin will cause an alarm (and the motors will stop). Most grbl senders (such as bCNC) will recognise the alarm and show an indication on-screen.

Ah, it seems there is a later version:

It also seems that DISABLE_HW_LIMITS is defined, and therefore the limit detection code is not included. Can anyone confirm this?

yes it appears to be set by default, but you can simply comment it out if you want to use the hardware limits. There are plenty of pins available to hook up a wire. You could ohm out the z+ and z- phoenix plug contacts to a pin on the board and assign the interrupt to that pin if it isn’t in there correctly.

1 Like

Thank you, please pardon my ignorance, I’m relatively new to all this.
I see the Z+ & Z- on the board, but I’m not clear on how to go about the rest.

I was trying encourage you to go for it, not expect you to know immediately how to do it. I’ll pop my board later today and then I can hopefully tell you the pin numbers for the Z+ and Z-. It would help if @makermadecnc or @makermade could chime in and tell us the pullup/pulldown pin status of the Z+ an Z- connectors on the board and whether to wire them to ground or to power for toggle, though with a 50/50 shot, we could figure it out pretty quick. Is there no documentation on that board from makermade in a pdf setup document or anything? I am still fighting with a position error on my board, so I have to sort that out before I can do much more to help with this. I was about to set up the z axis auto zero on Leroy, my classic maslow, but life, so that isn’t done yet. Please post back if/when you learn more.

1 Like

No details in docs that I’ve found. Just a basic setup guide.
Can I use the green Phoenix block points on the Due, or is that for something else?

I’ve been hounding them…
no answers from them. I’m guessing they have their hands full

Thanks I really appreciate it.

Could you post a photo of your actual board? I can see different boards and different schematics (which don’t match) in various places on the 'net. If you could post a photo then we can see which one you have and work from there.

I’m not sure the limit switches are properly implemented anyway, but we’ll see.

Somewhere between pin 34 and 43 the truth could be. But without access to the M2 firmware, no chance to check from that side. Perhaps @zaneclaes knows if limit switches are able to be set in makerverse. He’s doing a great job to make makerverse work with the ‘older’ hardware.

1 Like

AFAIK, if the pins are wired correctly, this is just a matter of turning on the setting. Using Makerverse (latest version) you can find the “hard limits” in the settings to flip it on (I enabled “soft limits” by default).

1 Like

The M2 board right to left:
Z+ connects to 5 V
Z+ connects to pin 13 (160 ohm)
Z- connects to 5 V
Z- connects to pin 17 (160 ohm)

It looks to me like you need a contact switch. They would function by touching them together. There is a z limit bit in the cpu_map.h file of the due firmware, so try it with a jumper wire and drive the z axis and touch the Z+ pins together and it should limit. Same for the Z- pins. I believe they are set as a pulldown, so when the pin that is initially set low gets pulled high, it triggers the interrupt and executes the z hardware stop code.

$21=1

turns hardware limits on. I tried shorting out the Z+ pins and then the Z- pins after telling the system to move and nothing happened, but I didn’t have a motor hooked up to it and moving either, but as @zaneclaes said, it should be workable once enabled in the settings.

2 Likes

grbl only supports a single input for limit switches in each axis. In the source code the Z-axis limit is configured for pin 12.

According to the schematic, pin 13 is not connected (N/C) and pin 17 is called AUX1.

Again, I am looking here:

There is, shall we say, room for improvement in the project documentation. Especially since the schematic and board images do not match the photo above of the “DUE SHIELD v2.0due” with L298P motor drivers. If I’m looking in the wrong place then please enlighten me.

1 Like

@ame for the M2 shield, I got the numbers I reported with an ohm meter. The schematic doesn’t have the laser connection on it or the Z+ or Z- connections. It is a dated schematic before makermade did their proprietary shield that most people have. EDIT: I say proprietary because I don’t know of a published schematic.

Ok, well if it’s proprietary or merely not-yet-documented then I’m not interested. The firmware is under the GPL, so must be available, but I don’t see that the hardware details must be made available. It would be a lot more helpful if they were, however.

3 Likes