Étape 19 : Troisième tour de l’extrudeuse Code !
Ce peu d’extrudeuse conrol fonctionne bien avec l’acide polylactique (PLA).
Vous pouvez par certains ici si vous êtes interessé : https://ultimachine.com/
Arduino Code / / /
//
/ * CONTRÔLE DE L’EXTRUDEUSE
CE QU’IL FAIT :
-RÉGLEMENTER LE TEMP PAR PWM
-EXÉCUTEZ LE MOTEUR PAS À PAS DE PINCEMENT ROUE EXTRUDEUSE QUAND IL EST DANS UNE PLAGE DE TEMPÉRATURES PROPER
-EN COURS D’EXÉCUTION PAS À PAS DE CONSEIL EASYDRIVER
*/
S’éteint pas à pas, si temp est trop faible [NOTE: à l’aide de EasyDriver Conseil, tirez autoriser broche haute pour éteindre
Éteignez chaleur si trop chaud
transformer la façon dont la chaleur up si trop froid
baisser le feu au milieu de si
CECI EST BASÉ SUR LE CODE ET LES MODÈLES DE
page Web http://dev.www.reprap.org/bin/view/Main/Temperature_Sensor_1_1
Table de correspondance de thermistance pour le capteur de température RepRap cartes mères (http://make.rrrf.org/ts)
Fait avec createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py)
./createTemperatureLookup.py--r0 = 100000--t0 = 25--r1 = 0--r2 = 4700--bêta = 4066--max-adc = 1023
#define THERMISTOR_PIN 0
#define heatPin 11 //heat niveau
#define EstepPin 5 //set extrudeuse pas pour pin12
#define EdirPin 6 //set étape direction pour moteur pas à pas pin11
#define EenablePin 12 / /
#define LED 13
lowTemp octets = 95 ; >>> si dessous lowTemp, extrudeuse est ensuite désactivé - degF
minTemp octets = 100 ; >>>> La valeur MIN TEMP ici >>>>>>-degF
maxTemp octets = 105 ; >>>> SET MAX TEMP ici >>>>>>-degF
maxRaw octets = 690 ;
minRaw octets = 700 ;
cool octets = 0 ; chauffe-eau hors tension
octet chaud = 255 ; feu moyen
octet chaud = 255 ; faire chauffer assez haut >> max serait 255, mais je ne veux pas brûler le chauffage
R0 : 100000
T0 : 25
R1: 0
R2 : 4700
bêta : 4066
Max adc: 1023
#define NUMTEMPS 20
court-temptable [NUMTEMPS] [2] = {}
{1}, 841
{54, 255},
{107, 209},
{160, 184},
{213, 166},
{266, 153},
{319, 142},
{372, 132},
{425, 124},
{478, 116},
{531, 108},
{584, 101},
{637, 93},
{690, 86},
{743, 78},
{796, 70},
{849, 61},
{902, 50},
{955, 34},
{1008, 3}
};
void setup()
{
Serial.Begin(9600) ;
Serial.println ("départ température exerciseur.") ;
pinMode (heatPin, sortie) ;
pinMode (EstepPin, sortie) ;
pinMode (EdirPin, sortie) ;
pinMode (EenablePin, sortie) ;
}
void loop()
{
rawvalue int = analogRead(THERMISTOR_PIN) ;
int celsius = read_temp() ;
int fahrenheit = (((celsius * 9) / 5) + 32) ;
Serial.Print ("temp actuel:") ;
Serial.Print(Celsius) ;
Serial.Print ("C /") ;
Serial.Print(Fahrenheit) ;
Serial.println("F") ;
Serial.Print ("Raw valeur:") ;
Serial.println(RawValue) ;
Serial.println("") ;
//
contrôle du chauffage de l’extrudeuse et moteur pas à pas, basé sur la température
//
Si (celsius < = minTemp) {//if temp trop faible - désactiver stepper
analogWrite (heatPin, chaud) ; Si temp trop faible-tour chaleur à max
digitalWrite(EenablePin,HIGH) ; Si temp trop faible - désactiver le stepper
digitalWrite(LED,HIGH) ;
//??? Tout arrêter si temp trop bas???
}
Si ((celsius > = lowTemp) & & (celsius < = minTemp)) {/ / si temp sous gamme LED clignotement lent
analogWrite (heatPin, chaud) ; Si temp sous gamme - tourner extrudeuse jusqu'à max
digitalWrite(EenablePin,LOW) ; si chaud assez puis allumez stepper
}
Si ((celsius > = minTemp) & & (celsius < = maxTemp)) {//if temp en gamme - LED ON
analogWrite (heatPin, chaud) ; Si temp se trouve dans la gamme - garder au chaud extrudeuse
digitalWrite(EenablePin,LOW) ; si chaud assez puis allumez stepper
}
Exécutez extrudeuse moteur pas à pas
digitalWrite(EdirPin,LOW) ;
digitalWrite(EstepPin,HIGH) ;
delayMicroseconds(2) ;
digitalWrite(EstepPin,LOW) ;
Delay(1) ;
Delay(1000) ;
}
int read_temp()
{
int rawtemp = analogRead(THERMISTOR_PIN) ;
int current_celsius = 0 ;
octet i ;
pour (i = 1; i si (temptable [i] [0] > rawtemp)
{
realtemp int = temptable [i-1] [1] + (rawtemp - temptable[i-1][0]) * (temptable [i] [1] - temptable[i-1][1]) / (temptable [i] [0] - temptable[i-1][0]) ;
Si (realtemp > 255)
Realtemp = 255 ;
current_celsius = realtemp ;
rupture ;
}
}
Débordement : Nous avons juste fixer à 0 degrés celsius
Si (i == NUMTEMPS)
current_celsius = 0 ;
Return current_celsius ;
}