If you do not actually use a ramps board, it is better to avoid that for motherboard setting. Ramps had several versions which resulted in a confusing and stacking pin definition and nested #if conditions.
In configuration.h, use MOTHERBOARD=99 and then go in pins.h and find this motherboard=99 and work with that pin definition instead. I find it better. I took what i used for pins, and i changed endstops MIN to -1 so you do not get in faults with them. Replace the #if motherboard 99 condition with the following:
The pins locations are based on convenience, you could change pins almost anywhere else. Only the thermistor pins have to be on an analog pin (A0-A15).
The firmware has some checks in many places, for example if when an endstop is triggered. In your previous post i think you had both min and max endstops defined, and not shorted to ground, so both were basically triggered. I dont know what firmware does in that situation with both endstops triggered but its understandable that problems would occur. If a min endstop is triggered, the firmware will ignore commands to move it below that point and will move only to one direction opposite of the min endstop. If you have both min and max endstop triggered, thats a corner case in which who knows exactly what happens, perhaps the situation was not anticipated by programers, but anyway its understandable why it did not worked.
Also if you want to change dir/stp/en you can also test Z, X or Y axes, but probably not E. Probably you will get errors at extruder and that is to be expected because in defaults in configuration.h there is set to check the extruder temperature before extruding (you can set that to avoid this check).
You can also hack into the babystep function to fix 2 buttons, one to move the Z axis up and the other to move Z down. That is instead of using an encoder. But there are differences between these two setups. With encoder, it will make a move proportional to the angle of encoder rotation. With buttons it will simply move as long as you keep the button pressed, which also could be dangerous if it gets stuck or otherwise shorted.
In configuration.h, use MOTHERBOARD=99 and then go in pins.h and find this motherboard=99 and work with that pin definition instead. I find it better. I took what i used for pins, and i changed endstops MIN to -1 so you do not get in faults with them. Replace the #if motherboard 99 condition with the following:
#if MOTHERBOARD == 99 #ifndef __AVR_ATmega1280__ #ifndef __AVR_ATmega2560__ #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. #endif #endif #define KNOWN_BOARD 1 //#define LARGE_FLASH true #define Z_DIR_PIN 22 #define Z_ENABLE_PIN 24 #define Z_STEP_PIN 26 #define Z_MIN_PIN -1 //all min/max endstops disabled with -1 to avoid faults on them #define Z_MAX_PIN -1 #define X_DIR_PIN 23 #define X_STEP_PIN 25 #define X_ENABLE_PIN 27 #define X_MIN_PIN -1 #define X_MAX_PIN -1 #define Y_DIR_PIN 28 #define Y_STEP_PIN 30 #define Y_ENABLE_PIN 32 #define Y_MIN_PIN -1 #define Y_MAX_PIN -1 #define E0_DIR_PIN 29 #define E0_STEP_PIN 31 #define E0_ENABLE_PIN 33 //#define E1_DIR_PIN 34 //not used //#define E1_STEP_PIN 36 //#define E1_ENABLE_PIN 38 #define LED_PIN -1 //13 #define PS_ON_PIN -1 #define KILL_PIN -1 #define HEATER_0_PIN 7 //extruder #define HEATER_1_PIN -1 //extruder fan #define HEATER_2_PIN -1 #define HEATER_BED_PIN 4 #define FAN_PIN 5 #define TEMP_0_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! #define TEMP_1_PIN 2 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! #define TEMP_2_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! #define TEMP_BED_PIN 3 #define SDPOWER -1 #define SDSS 53 #define MISO_PIN 50 #define MOSI_PIN 51 #define SCK_PIN 52 #define BEEPER -1 #endif /* 99 */
The pins locations are based on convenience, you could change pins almost anywhere else. Only the thermistor pins have to be on an analog pin (A0-A15).
The firmware has some checks in many places, for example if when an endstop is triggered. In your previous post i think you had both min and max endstops defined, and not shorted to ground, so both were basically triggered. I dont know what firmware does in that situation with both endstops triggered but its understandable that problems would occur. If a min endstop is triggered, the firmware will ignore commands to move it below that point and will move only to one direction opposite of the min endstop. If you have both min and max endstop triggered, thats a corner case in which who knows exactly what happens, perhaps the situation was not anticipated by programers, but anyway its understandable why it did not worked.
Also if you want to change dir/stp/en you can also test Z, X or Y axes, but probably not E. Probably you will get errors at extruder and that is to be expected because in defaults in configuration.h there is set to check the extruder temperature before extruding (you can set that to avoid this check).
You can also hack into the babystep function to fix 2 buttons, one to move the Z axis up and the other to move Z down. That is instead of using an encoder. But there are differences between these two setups. With encoder, it will make a move proportional to the angle of encoder rotation. With buttons it will simply move as long as you keep the button pressed, which also could be dangerous if it gets stuck or otherwise shorted.