Marlin patch activare babystep Z cu 2 butoane April 24, 2014 09:37AM |
Moderator Registered: 13 years ago Posts: 1,352 |
(~) #define BABYSTEPPING (~) #ifdef BABYSTEPPING (~) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions (~) #define BABYSTEP_INVERT_Z false //true for inverse movements in Z (~) #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #define BABYSTP_GPIO_Z /*nbm alternate babystepping Z with 2 GPIO buttons (no lcd, no menu) */ #ifdef BABYSTP_GPIO_Z #define BABYSTP_GPIO_ZUP 46 // Babystep pin for up #define BABYSTP_GPIO_ZDN 48 // Babystep pin for down #define BABYSTP_GPIO_NUM 1 // Impact variable, sort of number of steps, default 1 #endif //BABYSTP_GPIO_Z #define BABYSTP_DLYU_FCT 1000 // only applies if babystep() in stepper.cpp is using delayMicroseconds() (~) #ifdef COREXY (~) #error BABYSTEPPING not implemented for COREXY yet. (~) #endif (~) #ifdef DELTA (~) #ifdef BABYSTEP_XY (~) #error BABYSTEPPING only implemented for Z axis on deltabots. (~) #endif (~) #endif (~) #endif
(~) #ifdef PIDTEMPBED (~) extern float bedKp,bedKi,bedKd; (~) #endif #ifdef BABYSTP_GPIO_Z void babystp_gpio_z_setup(); void babystp_gpio_z_read(); #endif /*BABYSTP_GPIO_Z*/ (~) #ifdef BABYSTEPPING (~) extern volatile int babystepsTodo[3]; (~) #endif
(~) //=========================================================================== (~) //============================= functions ============================ (~) //=========================================================================== #ifdef BABYSTP_GPIO_Z void babystp_gpio_z_setup() /*nbm actual pin setup*/ { SET_INPUT(BABYSTP_GPIO_ZUP); /*maybe simpler with pinmode etc, instead fastio*/ WRITE(BABYSTP_GPIO_ZUP,1); SET_INPUT(BABYSTP_GPIO_ZDN); WRITE(BABYSTP_GPIO_ZDN,1); } void babystp_gpio_z_read() /*nbm pin reading changing the babystepsTodo*/ { if ((READ(BABYSTP_GPIO_ZUP))==LOW) /*prioritize up and ignore case with both*/ { babystepsTodo[Z_AXIS]+=BABYSTP_GPIO_NUM; } else if ((READ(BABYSTP_GPIO_ZDN))==LOW) { babystepsTodo[Z_AXIS]+=BABYSTP_GPIO_NUM*(-1); } /*double check whats up and down*/ } #endif /*BABYSTP_GPIO_Z*/ (~) void PID_autotune(float temp, int extruder, int ncycles) (~) {
(~) void setup() (~) { #ifdef BABYSTP_GPIO_Z babystp_gpio_z_setup(); /*nbm call for _setup() from marlin_main void setup(){at the start...} */ #endif /*BABYSTP_GPIO_Z*/ (~) setup_killpin(); (~) setup_powerhold();
(~) target_temperature_bed = 0; (~) bed_max_temp_error(); (~) } (~) #endif (~) } #ifdef BABYSTP_GPIO_Z babystp_gpio_z_read(); /*nbm call for read() for babystepsTodo update*/ #endif /*BABYSTP_GPIO_Z*/ (~) #ifdef BABYSTEPPING (~) for(uint8_t axis=0;axis<3;axis++) (~) { (~) int curTodo=babystepsTodo[axis]; //get rid of volatile for performance
Re: Marlin patch activare babystep Z cu 2 butoane April 24, 2014 02:25PM |
Registered: 10 years ago Posts: 478 |
Re: Marlin patch activare babystep Z cu 2 butoane April 24, 2014 08:24PM |
Moderator Registered: 13 years ago Posts: 1,352 |
Re: Marlin patch activare babystep Z cu 2 butoane April 25, 2014 09:04AM |
Moderator Registered: 13 years ago Posts: 1,352 |
//wait a tiny bit (-) { (-) float x=1./float(axis+1); //absolutely useless (-) }cu
//wait a tiny bit // { // float x=1./float(axis+1); //absolutely useless // } delayMicroseconds(BABYSTP_DLYU_FCT);sau eventual se poate pastra si calculatia veche si doar adauga delayM...(...) dupa calculul cu float;
Re: Marlin patch activare babystep Z cu 2 butoane April 26, 2014 06:05PM |
Moderator Registered: 13 years ago Posts: 1,352 |
Re: Marlin patch activare babystep Z cu 2 butoane April 27, 2014 04:32PM |
Registered: 10 years ago Posts: 478 |
Re: Marlin patch activare babystep Z cu 2 butoane April 27, 2014 06:06PM |
Moderator Registered: 13 years ago Posts: 1,352 |
Re: Marlin patch activare babystep Z cu 2 butoane May 01, 2014 10:02AM |
Registered: 10 years ago Posts: 478 |
Re: Marlin patch activare babystep Z cu 2 butoane May 01, 2014 11:50AM |
Registered: 10 years ago Posts: 478 |
Re: Marlin patch activare babystep Z cu 2 butoane May 04, 2014 10:21PM |
Moderator Registered: 13 years ago Posts: 1,352 |
Re: Marlin patch activare babystep Z cu 2 butoane May 05, 2014 04:56PM |
Registered: 10 years ago Posts: 478 |
Re: Marlin patch activare babystep Z cu 2 butoane May 05, 2014 06:26PM |
Moderator Registered: 13 years ago Posts: 1,352 |
Re: Marlin patch activare babystep Z cu 2 butoane May 07, 2014 02:56PM |
Registered: 10 years ago Posts: 478 |
Re: Marlin patch activare babystep Z cu 2 butoane May 07, 2014 05:50PM |
Moderator Registered: 13 years ago Posts: 1,352 |
Re: Marlin patch activare babystep Z cu 2 butoane October 14, 2016 04:42AM |
Registered: 10 years ago Posts: 478 |