Passaggio a MK 4.2.9 November 08, 2016 02:10PM |
Registered: 7 years ago Posts: 174 |
Arduino:1.7.11 (Mac OS X), Scheda:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)" In file included from Configuration_Store.cpp:39:0: base.h:14:24: fatal error: src/macros.h: No such file or directory #include "src/macros.h" ^ compilation terminated. Errore durante la compilazione Questo report potrebbe essere più ricco di informazioni con "Mostra un output dettagliato durante la compilazione" abilitato in "File > Impostazioni"
Arduino:1.6.8 (Mac OS X), Scheda:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)" Opzioni di compilazione cambiate, ricompilo tutto In file included from sketch/base.h:52:0, from /Users/karnhack/Desktop/MK/MK.ino:216: sketch/src/sanitycheck.h:1710:8: error: #error DEPENDENCY ERROR: HEATER_0_PIN not EXIST for this board #error DEPENDENCY ERROR: HEATER_0_PIN not EXIST for this board ^ exit status 1 Errore durante la compilazione per la scheda Arduino/Genuino Mega or Mega 2560. Questo report potrebbe essere più ricco di informazioni con l'opzione "Mostra un output dettagliato durante la compilazione" abilitata in File -> Impostazioni
Re: Passaggio a MK 4.2.9 November 08, 2016 05:10PM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 08, 2016 05:39PM |
Registered: 7 years ago Posts: 174 |
Quote
MagoKimbra
Non ho mica capito nulla... 1.7.11 dove l'hai presa???
Cmq con la 1.6.12 l'ultima uscita ho scaricato il tuo overall l'ho messo dentro la cartella del fw e compila senza errori...
Re: Passaggio a MK 4.2.9 November 08, 2016 05:59PM |
Registered: 7 years ago Posts: 174 |
Arduino:1.6.12 (Mac OS X), Scheda:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)" In file included from sketch/base.h:52:0, from /Users/karnhack/Desktop/MK/MK.ino:216: sketch/src/sanitycheck.h:1710:8: error: #error DEPENDENCY ERROR: HEATER_0_PIN not EXIST for this board #error DEPENDENCY ERROR: HEATER_0_PIN not EXIST for this board ^ exit status 1 Errore durante la compilazione per la scheda Arduino/Genuino Mega or Mega 2560. /Users/karnhack/Desktop/For Linear and Pulley/Anycubic_Kossel/Anycubic_Kossel.ino Questo report potrebbe essere più ricco di informazioni abilitando l'opzione "Mostra un output dettagliato durante la compilazione" in "File -> Impostazioni"
Re: Passaggio a MK 4.2.9 November 08, 2016 06:01PM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 08, 2016 06:21PM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 08, 2016 06:41PM |
Registered: 7 years ago Posts: 174 |
// Effective X/Y positions of the three vertical towers. #define SIN_60 0.8660254037844386 #define COS_60 0.5 #define DELTA_TOWER1_X -SIN_60*DELTA_RADIUS // front left tower #define DELTA_TOWER1_Y -COS_60*DELTA_RADIUS #define DELTA_TOWER2_X SIN_60*DELTA_RADIUS // front right tower #define DELTA_TOWER2_Y -COS_60*DELTA_RADIUS #define DELTA_TOWER3_X 0.0 // back middle tower #define DELTA_TOWER3_Y DELTA_RADIUS
Re: Passaggio a MK 4.2.9 November 09, 2016 02:24AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 05:31AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 08:15AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 08:21AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 08:27AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 08:27AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 08:56AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 08:57AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 09:10AM |
Registered: 7 years ago Posts: 174 |
Quote
MagoKimbra
No, fan pin è quella per il pezzo... Dove ce l'avevi attaccata prima la fan che raffreddava l'hotend??
La Fan Pin 2 ce l'hanno solo alcune schede...
Re: Passaggio a MK 4.2.9 November 09, 2016 09:23AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 09:38AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 09:51AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:00AM |
Registered: 7 years ago Posts: 174 |
#ifdef FAN_SOFT_PWM static unsigned char soft_pwm_fan; #endif #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \ (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1) || \ (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1) static unsigned long extruder_autofan_last_check; #endif #if EXTRUDERS > 3 # error Unsupported number of extruders #elif EXTRUDERS > 2 # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2, v3 } #elif EXTRUDERS > 1 # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2 } #else # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1 } #endif // Init min and max temp with extreme values to prevent false errors during startup static int minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP ); static int maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP ); static int minttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 0, 0, 0 ); static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 16383, 16383, 16383 ); //static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; /* No bed mintemp error implemented?!? */ #ifdef BED_MAXTEMP static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; #endif #ifdef TEMP_SENSOR_1_AS_REDUNDANT static void *heater_ttbl_map[2] = {(void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE }; static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; #else static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE ); static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN ); #endif static float analog2temp(int raw, uint8_t e); static float analog2tempBed(int raw); static void updateTemperaturesFromRawValues(); #ifdef WATCH_TEMP_PERIOD int watch_start_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0); unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0); #endif //WATCH_TEMP_PERIOD #ifndef SOFT_PWM_SCALE #define SOFT_PWM_SCALE 0 #endif //=========================================================================== //============================= functions ============================ //=========================================================================== void PID_autotune(float temp, int extruder, int ncycles) { float input = 0.0; int cycles=0; bool heating = true; unsigned long temp_millis = millis(); unsigned long t1=temp_millis; unsigned long t2=temp_millis; long t_high = 0; long t_low = 0; long bias, d; float Ku, Tu; float Kp, Ki, Kd; float max = 0, min = 10000; if ((extruder > EXTRUDERS) #if (TEMP_BED_PIN <= -1) ||(extruder < 0) #endif ){ SERIAL_ECHOLN("PID Autotune failed. Bad extruder number."); return; } SERIAL_ECHOLN("PID Autotune start"); disable_heater(); // switch off all heaters. if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; bias = d = (MAX_BED_POWER)/2; } else { soft_pwm[extruder] = (PID_MAX)/2; bias = d = (PID_MAX)/2; } for(; { if(temp_meas_ready == true) { // temp sample ready updateTemperaturesFromRawValues(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; max=max(max,input); min=min(min,input); if(heating == true && input > temp) { if(millis() - t2 > 5000) { heating=false; if (extruder<0) soft_pwm_bed = (bias - d) >> 1; else soft_pwm[extruder] = (bias - d) >> 1; t1=millis(); t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(millis() - t1 > 5000) { heating=true; t2=millis(); t_low=t2 - t1; if(cycles > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER)PID_MAX))-20); if(bias > (extruder<0?(MAX_BED_POWER)PID_MAX))/2) d = (extruder<0?(MAX_BED_POWER)PID_MAX)) - 1 - bias; else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); if(cycles > 2) { Ku = (4.0*d)/(3.14159*(max-min)/2.0); Tu = ((float)(t_low + t_high)/1000.0); SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); Kp = 0.6*Ku; Ki = 2*Kp/Tu; Kd = Kp*Tu/8; SERIAL_PROTOCOLLNPGM(" Clasic PID "); SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp); SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd); /* Kp = 0.33*Ku; Ki = Kp/Tu; Kd = Kp*Tu/3; SERIAL_PROTOCOLLNPGM(" Some overshoot ") SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp); SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd); Kp = 0.2*Ku; Ki = 2*Kp/Tu; Kd = Kp*Tu/3; SERIAL_PROTOCOLLNPGM(" No overshoot ") SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp); SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd); */ } } if (extruder<0) soft_pwm_bed = (bias + d) >> 1; else soft_pwm[extruder] = (bias + d) >> 1; cycles++; min=temp; } } } if(input > (temp + 20)) { SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); return; } if(millis() - temp_millis > 2000) { int p; if (extruder<0){ p=soft_pwm_bed; SERIAL_PROTOCOLPGM("ok B:"); }else{ p=soft_pwm[extruder]; SERIAL_PROTOCOLPGM("ok T:"); } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); temp_millis = millis(); } if(((millis() - t1) + (millis() - t2)) > (10L*60L*1000L*2L)) { SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); return; } if(cycles > ncycles) { SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the Kp, Ki and Kd constants into Configuration.h"); return; } lcd_update(); } } void updatePID() { #ifdef PIDTEMP for(int e = 0; e < EXTRUDERS; e++) { temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki; } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / bedKi; #endif } int getHeaterPower(int heater) { if (heater<0) return soft_pwm_bed; return soft_pwm[heater]; } #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \ (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1) || \ (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1) #if defined(FAN_PIN) && FAN_PIN > -1 #if EXTRUDER_0_AUTO_FAN_PIN == FAN_PIN #error "You cannot set EXTRUDER_0_AUTO_FAN_PIN equal to FAN_PIN" #endif #if EXTRUDER_1_AUTO_FAN_PIN == FAN_PIN #error "You cannot set EXTRUDER_1_AUTO_FAN_PIN equal to FAN_PIN" #endif #if EXTRUDER_2_AUTO_FAN_PIN == FAN_PIN #error "You cannot set EXTRUDER_2_AUTO_FAN_PIN equal to FAN_PIN" #endif #endif void setExtruderAutoFanState(int pin, bool state) { unsigned char newFanSpeed = (state != 0) ? EXTRUDER_AUTO_FAN_SPEED : 0; // this idiom allows both digital and PWM fan outputs (see M42 handling). pinMode(pin, OUTPUT); digitalWrite(pin, newFanSpeed); analogWrite(pin, newFanSpeed); } void checkExtruderAutoFans() { uint8_t fanState = 0; // which fan pins need to be turned on? #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE) fanState |= 1; #endif #if defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1 if (current_temperature[1] > EXTRUDER_AUTO_FAN_TEMPERATURE) { if (EXTRUDER_1_AUTO_FAN_PIN == EXTRUDER_0_AUTO_FAN_PIN) fanState |= 1; else fanState |= 2; } #endif #if defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1 if (current_temperature[2] > EXTRUDER_AUTO_FAN_TEMPERATURE) { if (EXTRUDER_2_AUTO_FAN_PIN == EXTRUDER_0_AUTO_FAN_PIN) fanState |= 1; else if (EXTRUDER_2_AUTO_FAN_PIN == EXTRUDER_1_AUTO_FAN_PIN) fanState |= 2; else fanState |= 4; } #endif // update extruder auto fan states #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 setExtruderAutoFanState(EXTRUDER_0_AUTO_FAN_PIN, (fanState & 1) != 0); #endif #if defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1 if (EXTRUDER_1_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_1_AUTO_FAN_PIN, (fanState & 2) != 0); #endif #if defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1 if (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN && EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) setExtruderAutoFanState(EXTRUDER_2_AUTO_FAN_PIN, (fanState & 4) != 0); #endif } #endif // any extruder auto fan pins set void manage_heater() { float pid_input; float pid_output; if(temp_meas_ready != true) //better readability return; updateTemperaturesFromRawValues(); for(int e = 0; e < EXTRUDERS; e++) { #ifdef PIDTEMP pid_input = current_temperature[e]; #ifndef PID_OPENLOOP pid_error[e] = target_temperature[e] - pid_input; if(pid_error[e] > PID_FUNCTIONAL_RANGE) { pid_output = BANG_MAX; pid_reset[e] = true; } else if(pid_error[e] < -PID_FUNCTIONAL_RANGE || target_temperature[e] == 0) { pid_output = 0; pid_reset[e] = true; } else { if(pid_reset[e] == true) { temp_iState[e] = 0.0; pid_reset[e] = false; } pTerm[e] = Kp * pid_error[e]; temp_iState[e] += pid_error[e]; temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]); iTerm[e] = Ki * temp_iState[e]; //K1 defined in Configuration.h in the PID settings #define K2 (1.0-K1) dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]); pid_output = constrain(pTerm[e] + iTerm[e] - dTerm[e], 0, PID_MAX); } temp_dState[e] = pid_input; #else pid_output = constrain(target_temperature[e], 0, PID_MAX); #endif //PID_OPENLOOP #ifdef PID_DEBUG SERIAL_ECHO_START(" PIDDEBUG "); SERIAL_ECHO(e); SERIAL_ECHO(": Input "); SERIAL_ECHO(pid_input); SERIAL_ECHO(" Output "); SERIAL_ECHO(pid_output); SERIAL_ECHO(" pTerm "); SERIAL_ECHO(pTerm[e]); SERIAL_ECHO(" iTerm "); SERIAL_ECHO(iTerm[e]); SERIAL_ECHO(" dTerm "); SERIAL_ECHOLN(dTerm[e]); #endif //PID_DEBUG #else /* PID off */ pid_output = 0; if(current_temperature[e] < target_temperature[e]) { pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current_temperature[e] > minttemp[e]) && (current_temperature[e] < maxttemp[e])) { soft_pwm[e] = (int)pid_output >> 1; } else { soft_pwm[e] = 0; } #ifdef WATCH_TEMP_PERIOD if(watchmillis[e] && millis() - watchmillis[e] > WATCH_TEMP_PERIOD) { if(degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) { setTargetHotend(0, e); LCD_MESSAGEPGM("Heating failed"); SERIAL_ECHO_START; SERIAL_ECHOLN("Heating failed"); }else{ watchmillis[e] = 0; } } #endif #ifdef TEMP_SENSOR_1_AS_REDUNDANT if(fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) { disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Extruder switched off. Temperature difference between temp sensors is too high !"); LCD_ALERTMESSAGEPGM("Err: REDUNDANT TEMP ERROR"); } #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE Stop(); #endif } #endif } // End extruder for loop #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \ (defined(EXTRUDER_1_AUTO_FAN_PIN) && EXTRUDER_1_AUTO_FAN_PIN > -1) || \ (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1) if(millis() - extruder_autofan_last_check > 2500) // only need to check fan state very infrequently { checkExtruderAutoFans(); extruder_autofan_last_check = millis(); } #endif
Re: Passaggio a MK 4.2.9 November 09, 2016 10:08AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:18AM |
Registered: 7 years ago Posts: 174 |
#define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
Re: Passaggio a MK 4.2.9 November 09, 2016 10:20AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:20AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:25AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:28AM |
Registered: 10 years ago Posts: 6,409 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:32AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 10:45AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 09, 2016 11:07AM |
Registered: 7 years ago Posts: 174 |
Re: Passaggio a MK 4.2.9 November 11, 2016 10:32AM |
Registered: 7 years ago Posts: 174 |