Welcome! Log In Create A New Profile

Advanced

Passaggio a MK 4.2.9

Posted by karnhack 
Passaggio a MK 4.2.9
November 08, 2016 02:10PM
Salve a tutti,
vorrei aggiornare il firmware della stampante per installare nel breve futuro un lbtouch.
Ieri notte ho provato a fare la prima configurazione spulciando nel configuration.h originale (che allego) e mettendo più dati possibili.
Al momento facendo una verifica di compilazione con Arduino 1.7.11 mi riporta il seguente errore:

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"

UP con arduino 1.6.8
In effetti i pin li ho disabilitati tutti in quanto non erano presenti sul configuration.h originale

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


Grazie in anticipo per l'interesse.

Edited 3 time(s). Last edit at 11/08/2016 03:11PM by karnhack.


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Attachments:
open | download - Configuration_Overall.h (44.3 KB)
Re: Passaggio a MK 4.2.9
November 08, 2016 05:10PM
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...


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 08, 2016 05:39PM
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...

Ora che me lo fai notare ho sbagliato a scaricare l'ultima versione, sono andato su arduino.org anziché .cc


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 08, 2016 05:59PM
In ogni caso anche scaricando la versione corretta (1.6.12) mi da lo stesso errore:

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"

Credo che il problema dipenda dal fatto che ho disabilitato HEATER_0_PIN ... L'ho disabilitato perché non c'è nessun ridferimento nel configuration.h originale



Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 08, 2016 06:01PM
E perché??? Lascia quello originale se lo togli è normale che non lo trova...
Nel configuration.h originale non ci sono i pin, i pin si trovano nella scheda pin... Ma se lasci quello di default, lui usa quelli definiti dalla tua board...


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 08, 2016 06:21PM
Figo l'ho appena caricato! un primo passo è stato fatto smiling smiley
XYZ mi danno un punto interrogativo... ma i Tower Adjustment non dovrebbero trovarsi anche nel configuration.h originale?

Edited 1 time(s). Last edit at 11/08/2016 06:31PM by karnhack.


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 08, 2016 06:41PM
Non capisco bene questo passaggio:


Del Delta height non trovo nulla e nel configuration.h trovo solo questi dati riguardo le torri:

// 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


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 02:24AM
No Marlin originale non ha gli aggiustamenti per le torri e gli endstop...
Lascia tutto come trovi quello che non vedi nel vecchio... Poi dopo aggiusterai quando farai le calibrazioni...


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 05:31AM
Quando do G28 sale fino agli endstop e assegna un altezza di 276.09 (che non capisco dove l'abbia presa) in quanto in Delta height ho messo 300. In ogni caso, l'unica differenza è che dopo il comando i motori fanno un leggerissimo rumore.
Quando vado ad abbassare l'asse Z per capire l'altezza g1z0 mi rimane sopra e se gli do valori negativi come g1z-10 non si muove... le altre volte spuntando "clamp manual moves" da pronteface ho risolto ma questa volta non va oltre.
Non capisco su che stringa devo agire per modificare l'altezza

Edited 1 time(s). Last edit at 11/09/2016 05:48AM by karnhack.


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 08:15AM
Ok dopo qualche tentativo sono arrivato a una calibrazione grossolana.
Innanzitutto vorrei essere certo di aver capito che XYZ corrispondono corrispettivamente a ABΓ (o sbaglio ordine?)
In ogni caso facendo le prove con il foglietto di carta come spessore ho ottenuto
0 mm al centro del piatto
1.3 mm sul lato Z
0.1 mm sul lato Y
-0.2 mm sul lato X
che più o meno erano i valori che ottenevo col vecchio firmware.

Tralasciando la calibrazione che non è l'oggetto di discussione di questo post, ho fatto una prova di stampa ed ho rilevato i seguenti problemi:
1- La ventola di raffreddamento dell'estrusore non si avvia (funziona solo la ventola che raffredda l'estruso)
2- l'estruso non esce dall'ugello? il motore che spinge il filo gira dal verso giusto ma forse va troppo lento?
3- Quando annullo la stampa la stampante va in loop ripetendo il movimento che stava compiendo (durante la stampa) all'infinito


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 08:21AM
L'hai settata la ventola? Hai detto qualìè il pin dove l'hai attaccata??
Il motore gira e trascina il filo? Hai impostato i giusti step per mm
Si forse c'è un bug sullo stop devo controllare su quella versione..


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 08:27AM
No probabilmente non ho impostato il pin della ventola, la trovo su marlinkimbra o va aggiunta manualmente? Per gli step ora controllo se corrispondono alla vecchia configurazione

Edited 1 time(s). Last edit at 11/09/2016 08:27AM by karnhack.


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 08:27AM
Si lo trovi sulla parte temperature..

Edited 1 time(s). Last edit at 11/09/2016 08:28AM by MagoKimbra.


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 08:56AM
Sia Fan Pin che Fan2 Pin mi danno un errore di dipendenza


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 08:57AM
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...


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 09:10AM
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...

Non ho toccato nulla, è attaccata dove era prima... ho una scheda trigorilla con tre pin FAN0 FAN1 FAN2, le ventole sono collegate a FAN0 e FAN2


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 09:23AM
Il problema è che non ho riferimenti ai pin nel vecchio configurator.h


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 09:38AM
EXTRUDER_0_AUTO_FAN_PIN si trova solo nel file temperature.cpp (del vecchio firmware) non vedo altri riferimenti


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 09:51AM
Si quello che pin avevi li..


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 10:00AM
Ehm... non ci capisco una fava:

#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(;winking smiley {

    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)sad smileyPID_MAX))-20);
            if(bias > (extruder<0?(MAX_BED_POWER)sad smileyPID_MAX))/2) d = (extruder<0?(MAX_BED_POWER)sad smileyPID_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


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 10:08AM
Non in quel file, mi sembra era in configuration_adv.h
Cnq dove diamine l'hai attaccata la fan per l'hotend?


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 10:18AM
Fisicamente sul pin FAN2

Su configuration_adv.h l'unico riferimento è questo:
#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


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 10:20AM
Ma come - 1 ma allora prima non c'è l'avevi


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 10:20AM
Ma come - 1 ma allora prima non c'è l'avevi


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 10:25AM
Si l'avevo, la ventola partiva appena accendevo la stampante.
Ho allegato il vecchio firmware


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Attachments:
open | download - For Linear and Pulley.zip (597.8 KB)
Re: Passaggio a MK 4.2.9
November 09, 2016 10:28AM
E allora non era controllata dal fw, va a 12v fissi...


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Re: Passaggio a MK 4.2.9
November 09, 2016 10:32AM
Ma non c'è un modo per individuare sto maledetto numero del pin sulla scheda?


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 10:45AM
Trovato! era il pin 44... la ventola ora è controllata dal firmware smiling smiley


Edited 1 time(s). Last edit at 11/09/2016 11:16AM by karnhack.


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 09, 2016 11:07AM
Ho fatto una prova di stampa, salvo piccoli aggiustamenti di calibrazione va tutto una meraviglia, grazie mago una birra non te la toglie nessuno! smileys with beer


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Re: Passaggio a MK 4.2.9
November 11, 2016 10:32AM
Alla fine ho installato l'MK4duo


Gianluca

Kossel K2 [ø 0.4 - 1.75] | Ruramps 1.1 | TMC2100 | MK4duo | KISSlicer
Website - Thing
Sorry, only registered users may post in this forum.

Click here to login