V2 firmware endstop configuration
I'm trying to con figure the x and y hardware end stops in V2 firmware. Z is BLtouch. These are my current settings in configuration.h v1.0.3:
// ################ Endstop configuration #####################
// ################ Endstop configuration #####################
#define MULTI_ZENDSTOP_HOMING 0
#define ENDSTOP_PULLUP_X_MIN true
#define ENDSTOP_X_MIN_INVERTING true
#define MIN_HARDWARE_ENDSTOP_X true
#define ENDSTOP_PULLUP_Y_MIN true
#define ENDSTOP_Y_MIN_INVERTING true
#define MIN_HARDWARE_ENDSTOP_Y true
#define ENDSTOP_PULLUP_Z_MIN true
#define ENDSTOP_Z_MIN_INVERTING false
#define MIN_HARDWARE_ENDSTOP_Z true
#define ENDSTOP_PULLUP_Z2_MINMAX true
#define ENDSTOP_Z2_MINMAX_INVERTING false
#define MINMAX_HARDWARE_ENDSTOP_Z2 false
#define ENDSTOP_PULLUP_X_MAX true
#define ENDSTOP_X_MAX_INVERTING false
#define MAX_HARDWARE_ENDSTOP_X false
#define ENDSTOP_PULLUP_Y_MAX true
#define ENDSTOP_Y_MAX_INVERTING false
#define MAX_HARDWARE_ENDSTOP_Y false
#define ENDSTOP_PULLUP_Z_MAX true
#define ENDSTOP_Z_MAX_INVERTING false
#define MAX_HARDWARE_ENDSTOP_Z false
#define ENDSTOP_PULLUP_X2_MIN true
#define ENDSTOP_PULLUP_Y2_MIN true
#define ENDSTOP_PULLUP_Z2_MINMAX true
#define ENDSTOP_PULLUP_X2_MAX true
#define ENDSTOP_PULLUP_Y2_MAX true
#define ENDSTOP_X2_MIN_INVERTING false
#define ENDSTOP_Y2_MIN_INVERTING false
#define ENDSTOP_X2_MAX_INVERTING false
#define ENDSTOP_Y2_MAX_INVERTING false
#define MIN_HARDWARE_ENDSTOP_X2 false
#define MIN_HARDWARE_ENDSTOP_Y2 false
#define MAX_HARDWARE_ENDSTOP_X2 false
#define MAX_HARDWARE_ENDSTOP_Y2 false
#define X2_MIN_PIN -1
#define X2_MAX_PIN -1
#define Y2_MIN_PIN -1
#define Y2_MAX_PIN -1
#define Z2_MINMAX_PIN -1
#define max_software_endstop_r true
#define min_software_endstop_x false
#define min_software_endstop_y false
#define min_software_endstop_z false
#define max_software_endstop_x true
#define max_software_endstop_y true
#define max_software_endstop_z true
#define DOOR_PIN -1
#define DOOR_PULLUP 1
#define DOOR_INVERTING 1
#define ENDSTOP_X_BACK_MOVE 5
#define ENDSTOP_Y_BACK_MOVE 5
#define ENDSTOP_Z_BACK_MOVE 2
#define ENDSTOP_X_RETEST_REDUCTION_FACTOR 3
#define ENDSTOP_Y_RETEST_REDUCTION_FACTOR 3
#define ENDSTOP_Z_RETEST_REDUCTION_FACTOR 3
#define ENDSTOP_X_BACK_ON_HOME 1
#define ENDSTOP_Y_BACK_ON_HOME 1
#define ENDSTOP_Z_BACK_ON_HOME 0
#define ALWAYS_CHECK_ENDSTOPS 1
#define MOVE_X_WHEN_HOMED 0
#define MOVE_Y_WHEN_HOMED 0
#define MOVE_Z_WHEN_HOMED 0
there doesn't seem to be any configuration in V2 in configuration.h but in configuration_io.h there are these settings:
there doesn't seem to be any configuration in V2 in configuration.h but in configuration_io.h there are these settings:
// Define our endstops solutions
// You need to define all min and max endstops for all
// axes except E even if you have none!
ENDSTOP_SWITCH_HW(endstopMotorXMax, IOEndstopXMax, -1, true)
ENDSTOP_SWITCH_HW(endstopMotorYMax, IOEndstopYMax, -1, true)
ENDSTOP_SWITCH_HW(endstopMotorZMax, IOEndstopZMax, -1, true)
ENDSTOP_NONE(endstopXMin)
ENDSTOP_NONE(endstopYMin)
ENDSTOP_NONE(endstopZMin)
ENDSTOP_NONE(endstopXMax)
ENDSTOP_NONE(endstopYMax)
ENDSTOP_MERGE3(endstopZMax, endstopMotorXMax, endstopMotorYMax, endstopMotorZMax, Z_AXIS, true)
ENDSTOP_SWITCH_HW(endstopZProbe, IOEndstopZProbe, ZPROBE_AXIS, false)
These settings do not seem to register when the end stop is triggered. I'm not sure how to edit these settings to get the desired results. The end stops are normally open wired to xmin, ymin, zmin pins. zmax pin is for filament runout sensor. Would I change the lines to:
ENDSTOP_SWITCH_HW(endstopMotorXMin, IOEndstopXMin, -1, true)
ENDSTOP_SWITCH_HW(endstopMotorYMin, IOEndstopYMin, -1, true)
ENDSTOP_SWITCH_HW(endstopMotorZMin, IOEndstopZMin, -1, true)
ENDSTOP_NONE(endstopyMax)
// ENDSTOP_MERGE3(endstopZMax, endstopMotorXMax, endstopMotorYMax, endstopMotorZMax, Z_AXIS, true)
ENDSTOP_SWITCH_HW(endstopZProbe, IOEndstopZProbe, ZPROBE_AXIS, true)
This is on a MKS Rumba32 board, single xyz drives, single nozzle, dual extruder, BLtouch, cartesian printer.
// Servo for z-probe
IO_OUTPUT(Servo1Pin, 4)
SERVO_ANALOG(ZProbeServo, 0, Servo1Pin, 500, 2500, 1473)
// Set to nullptr for no zprobe or &endstopName for a switch
#undef ZPROBE_ADDRESS
#define ZPROBE_ADDRESS &endstopZProbe
These settings do not seem to register when the end stop is triggered. I'm not sure how to edit these settings to get the desired results. The end stops are normally open wired to xmin, ymin, zmin pins. zmax pin is for filament runout sensor. Would I change the lines to:
ENDSTOP_SWITCH_HW(endstopMotorXMin, IOEndstopXMin, -1, true)
ENDSTOP_SWITCH_HW(endstopMotorYMin, IOEndstopYMin, -1, true)
ENDSTOP_SWITCH_HW(endstopMotorZMin, IOEndstopZMin, -1, true)
ENDSTOP_NONE(endstopXMin)
ENDSTOP_NONE(endstopYMin)
ENDSTOP_NONE(endstopZMin)
ENDSTOP_NONE(endstopXMax) ENDSTOP_NONE(endstopyMax)
// ENDSTOP_MERGE3(endstopZMax, endstopMotorXMax, endstopMotorYMax, endstopMotorZMax, Z_AXIS, true)
ENDSTOP_SWITCH_HW(endstopZProbe, IOEndstopZProbe, ZPROBE_AXIS, true)
// Servo for z-probe
IO_OUTPUT(Servo1Pin, 4)
SERVO_ANALOG(ZProbeServo, 0, Servo1Pin, 500, 2500, 1473)
// Set to nullptr for no zprobe or &endstopName for a switch
#undef ZPROBE_ADDRESS
#define ZPROBE_ADDRESS &endstopZProbe
This is on a MKS Rumba32 board, single xyz drives, single nozzle, dual extruder, BLtouch, cartesian printer.
Comments
IO_INPUT_PULLUP(IOEndstopZProbe, ORIG_Z_MIN_PIN)
ENDSTOP_SWITCH_HW(endstopZProbe, IOEndstopZProbe, ZPROBE_AXIS, false)
For mechanical end stops you should always enable pullup like
IO_INPUT_INVERTED_PULLUP(IOEndstopYMin, ORIG_Y_MIN_PIN)
Switch inverted if signal is wrong oriented.
ENDSTOP_SWITCH_HW(endstopZMin, IOEndstopZMin, Z_AXIS, false)
would make more sense on a cartesian printer. Your example was from a delta which requires a different logic.
and the compile failed:
is a problem with text encoding. Are you using visual studio code with utf-8 encoding?
The problem is that some spaces normally at start/end got copied with different encoding so it is now wrong encoded. Try to delete all spaces at start and and and see if the errors reduce. Googling the error message also gives you many hints on this special problem.
// Define your endstops are defined as
No.
You have no motor endstops so you must replace endstopMotorXMin by endstopXMin and also remove the matching ENDSTOP_NONE and remove the motor endstops from the motor drivers.
IO_INPUT_INVERTED_PULLUP(IOEndstopXMin, ORIG_X_MIN_PIN)
ENDSTOP_NONE(endstopZMin)
but the Z axis does not move when homing, just makes a lot of noise.
IO_OUTPUT_INVERTED(IOZ1Dir, ORIG_Z_DIR_PIN) >moves in wrong direction
Filament detector is added at the end. See Cartesian/Felix Pro 1 as example which also has two detectors. But these are for rotary encoder so adjust to switch variant accordingly.
My BLTouch code is identical to the Deltatower RUMBA32 example with some changes to offsets and so on in configuratio.h and configuratio_io.h. My hardware setup is the servo goes to cpu pin PD15 defined as PWM2_PIN in rumba32.h. The signal pins go to ORIG_Z_MIN_PIN. I don't see any references to Servo1Pin other than in the code block following // Servo for z-probe in configuration_io.h. How do I tell what pin Servo1Pin is referencing?
For the Filament sensors I did grab the code from the Cartesian/Felix Pro 1 example and changed the pin assignment. I have 2 filament sensors, 1 for each extruder, both detectors are wired to ORIG_Z_MAX_PIN. My question still stands, where do I define FilamentDetector1 from the Cartesian/Felix Pro 1 example? If I use the code as is the compile fails, this from vscode:
FilamentDetector<<error-type>> FilamentDetector1
and this compilation error:
For serve there are 2 places in Configuration.h you need to change as well
and
should help here telling you have a servo. Docs miss that part:-(
For filament detector:
FILAMENT_DETECTOR(FilamentDetector1, ORIG_Z_MAX_PIN, ToolExtruder1)
ORIG_Z_MAX_PIN is wrong. You need a IO_INPUT... class that defines Z_MAX_PIn as input here!
These are already in configuation.h
#define NUM_SERVOS 1
For filament detector I would need to define Z_MAX_PIn in io_input.h?
#define IO_INPUT(FilamentDetector2, ORIG_Z_MAX_PIN)
I won't be able to test until tomorrow but Thank You again!
FILAMENT_DETECTOR(FilamentDetector1, IOFilamentDetector1, ToolExtruder1)
If signal is wrong way around use IO_INPUT_INVERTED_PULLUP
this goes to configuration_io.h
FILAMENT_DETECTOR(FilamentDetector1, IOFilamentDetector1, ToolExtruder1)
IO_INPUT_PULLUP(IOFilamentDetector1, ORIG_Z_MAX_PIN)
FILAMENT_DETECTOR(FilamentDetector1, IOFilamentDetector1, ToolExtruder1)
is correct. All goes in contiguration_io.h
You only change configuration.h and configuration_io.h anything else means you are programming the firmware to do something it can not do normally.
Z axis now moves. There are some strange things happening with the probe, if I run M119 with all the enstops triggered and the zprobe retracted and this set: IO_INPUT_PULLUP(IOEndstopZProbe, ORIG_Z_MIN_PIN) I get this
Send: N18 M119*19 Recv: endstops hit: x_min:H y_min:H Z-probe state:L
when I think it should be Z-probe state:H
but the Zaxis homes and crashes into the nozzle...the zprobe never deploys.
if I invert the pullup on the zprobe:
this is what I expected however the zaxis does not move and the zprobe does not deploy.
After further examination inverting the pullup only changes the state from low to high regardless of whether the probe is stowed or not.
This is getting closer to being functional but still stuck on getting the BLTouch to respond. The BLTouch does cycle through its' startup routine every time I turn on the printer, the BLTouch drops the probe 2x and stows but then never responds to any commands after that. No response to M340 P0 S500, M340 P0 S600. Maybe those commands aren't valid in this firmware. What commands deploy and stow the probe in this firmware so I can test?
this is the code I've got for the BLTouch
configuration_io.h:
Configuration.h:
The self test always happens when probe gets powered. That way you know it would work if it gets the signal.
M119 is not useful with bltouch/3dtouch. The high signal only last 10-100ms so it is normally low. Only in error state it is constantly high.
Are you using hwardware pwm for some pins? It is important not to use a pin with interrupt in use internally like servo timer. Looking into the docs I saw there is no list in hardware pwm telling which ones are allowed. Need to correct that.
IO_OUTPUT(Servo1Pin, 4)
you reference pin number 4, where is that set or defined?