-
Notifications
You must be signed in to change notification settings - Fork 79
Quad Simple Input Module
This is a lower cost alternative the "Bulletproof" 4x Input Module. It uses an R/C filter and a Schmitt trigger to help with noise.
The switch connectors can be standard 0.1" headers, JST connectors or any 0.1" (2.5mm) pitch 3 pin connectors. Each switch circuit has a positive voltage supply that is jumper selectable for 5V or the primary input voltage (VMot).
This module can be used on CNC I/O Module Sockets #1,#2,#3,& #4
Note: Socket #2 uses GPIO_NUM_2 for the first channel. GPIO_NUM_2 must be either left unconnected/floating, or driven Low, in order to enter the serial bootloader. If you are having trouble loading a program and you have this module installed in module socket #2, you must either remove the module or change the state of the switch on the first channel. You can also upload firmware via WiFi or remove the ESP32 from the main board during programming
Examples
// 4x Switch input module on CNC I/O module Socket #1
// https://github.com/bdring/6-Pack_CNC_Controller/wiki/Quad-Simple-Input-Module
#define X_LIMIT_PIN GPIO_NUM_33
#define Y_LIMIT_PIN GPIO_NUM_32
#define Z_LIMIT_PIN GPIO_NUM_35
#define X2_LIMIT_PIN GPIO_NUM_34 // second x limit switch
#define DEFAULT_INVERT_LIMIT_PINS 0 // Sets the default for N.O. switches
// 4x Input Module in Socket #1
// https://github.com/bdring/6-Pack_CNC_Controller/wiki/Quad-Simple-Input-Module
#define X_LIMIT_PIN GPIO_NUM_33
#define Y_LIMIT_PIN GPIO_NUM_32
#define Z_LIMIT_PIN GPIO_NUM_35
#define PROBE_PIN GPIO_NUM_34
#define DEFAULT_INVERT_LIMIT_PINS 0
#define DEFAULT_INVERT_PROBE_PIN 0// 4x Switch Input module in socket #2
// https://github.com/bdring/6-Pack_CNC_Controller/wiki/Quad-Simple-Input-Module
#define CONTROL_RESET_PIN GPIO_NUM_2
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_25
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39
#define CONTROL_SAFETY_DOOR_PIN GPIO_NUM_36It cannot be used on CNC I/O Module Socket #5, because those are output only pins.
#define X_LIMIT_PIN
#define Y_LIMIT_PIN
#define Z_LIMIT_PIN
#define A_LIMIT_PIN
#define B_LIMIT_PIN
#define C_LIMIT_PIN
#define PROBE_PIN
#define CONTROL_CYCLE_START
#define CONTROL_SAFETY_DOOR_PIN
#define CONTROL_RESET_PIN
#define CONTROL_FEED_HOLD_PIN
// advanced users only! See https://github.com/bdring/Grbl_Esp32/wiki/Macro-Button-Feature
#define MACRO_BUTTON_1_PIN
#define MACRO_BUTTON_2_PIN
#define MACRO_BUTTON_3_PIN
#define MACRO_BUTTON_4_PINIn the open state, the signal is low. In the closed state the signal is high. The setting for N.O switches would be...
- $Limits/Invert=Off
- $Probe/Invert=Off
If the signal are inverted from what you want adjust these settings.
For control pins, you need to set #define INVERT_CONTROL_PIN_MASK to match the switches you defined and the switch type (N.O. or N.C.) you are using. It is a 4 bit value with a default of B1111. The bit order is Cycle Start | Feed Hold | Reset | Safety Door.
For N.O switches set the bits to 0 like B0000.
For N.C switches set the bits to 1 like B1111.
The value of bits for switches you have not define does not matter.
You can put it in your machine definition file like this.
#ifdef INVERT_CONTROL_PIN_MASK
# undef INVERT_CONTROL_PIN_MASK
#endif
#define INVERT_CONTROL_PIN_MASK B0001You can set the defaults in your machine definition with...
#define DEFAULT_INVERT_LIMIT_PINS 0
#define DEFAULT_INVERT_PROBE_PIN 0
- Assembly
- Setup
- Jumper Setup
- Setting Up Motors
- Socket Pin Numbering
- StallGuard setup
- Expansion connector
- FluidNC Config Files