首先通过一张图来了解限位开关的工作原理:
如图两种工况解析:
⒈未触碰弹片:
限位开关 COM 与 NC 导通,+5v电压经VCC发出-->NC-->COM-->S,芯片引脚接收到 +5v 信号。
⒉触碰弹片:
限位开关 COM 与 NO 导通,芯片引脚电压经S-->COM-->NO-->G, 被下拉至 0v 电压。
在Marlin固件中限位开关设置为:
#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
交流群QQ:460937369 进群验证码:STJ