Quantcast
Channel: Reprap Forum - Controllers
Viewing all articles
Browse latest Browse all 10211

Re: About Pin Number Question?

$
0
0
#define Z_MIN_PIN 18
#define Z_MAX_PIN 19

These are endstops pins. Normally only a MIN is used, one per axis. The mechanical endstop configuration is with internal pullups enabled on that pin, and the mechanical pullup is used as "normally connected" hence it always puts the internal pullup current to ground. So to trick the firmware in thinking you have a endstop there, just put a jumper on it, or otherwise short that pin to ground. For testing purposes and such. In case the endstop gets hit, it disconnects, and the internal pullup raises the line to 5v, and the uC reads 5V on that pin immediatelly.

The MAX pin is typically not used (set as -1), because after homing the firmware knows its limits, so it sort of uses software endstops. Meaning if your Z axis is set for 100mm high in config, and you home it and then order it a 101mm move, it will only move 100mm because it will not move above that "software" limit which is set by the configured length of that axis. Also to note, you can use only one pin for all 3 endstops, connected in series, with the condition that firmware is set in such a way that after hitting an endstop, it retracts from it 2-3 mm away, such that endstop is back in continuity again. But thats not typical.

Mechanical endstops have 3 pins, from which two of them are as NC "normally connected", meaning they are conducting when endstop is not pressed, and they disconnect when endstop is pressed. You can measure this with a multimeter. These two pins, one goes to gnd, and one goes to the gpio pin defined as MIN in pins.h. You also need to enable internal pullup on that pin in firmware. If not enabled in firmware, then you need a phisical pullup, that is 10k resistor from that pin to 5v line. Thats all, cheers.

Viewing all articles
Browse latest Browse all 10211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>