Abschluss
Dependencies: mbed mbed-rtos X_NUCLEO_IHM02A1
Revision 44:d5481d289b78, committed 2019-05-19
- Comitter:
- scherfa2
- Date:
- Sun May 19 20:46:32 2019 +0000
- Parent:
- 43:b7984ec90227
- Commit message:
- Abschluss
Changed in this revision
ST_DUO.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ST_DUO.cpp Fri May 17 17:32:33 2019 +0000 +++ b/ST_DUO.cpp Sun May 19 20:46:32 2019 +0000 @@ -119,8 +119,13 @@ DisplaySendeString("Filament einlegen..."); gotoxy(1,4); DisplaySendeString(" Abbruch"); + Set_Servo_Bad_Fil(); + + Stepper_3_SetPara(100, 100); + Stepper_1_SetPara(100, 100); Stepper_1_Run('V', 300); + Stepper_3_Run('V', 300); StatusDUO=DUO_EINLEGEN; } @@ -170,15 +175,22 @@ DisplaySendeString("schnitten"); Stepper_1_Stop(); + Stepper_3_Stop(); Stepper_3_Leerlauf(); Stepper_3_SetPara(100, 100); Stepper_1_SetPara(100, 100); - Set_Cutter(500, 0, 1); + Set_Cutter(550, 0, 1); motors2[0]->move(StepperMotor::FWD, 128*400*4); motors[0]->move(StepperMotor::BWD, 128*400*0.3); - Set_Cutter(600, 0, 1); + Set_Cutter(650, 0, 1); + + DisplaySendeBefehl(0x01); + gotoxy(1,1); + DisplaySendeString("Filament wird ge-"); + gotoxy(1,3); + DisplaySendeString("schnitten"); motors2[0]->wait_while_active(); motors[0]->move(StepperMotor::FWD, 128*400*0.3); @@ -188,6 +200,7 @@ Set_Servo_Good_Fil(); Stepper_1_SetHome(); Stepper_1_Run('V', 300); + //Stepper_3_Run('V', 300); DisplaySendeBefehl(0x01); @@ -214,9 +227,11 @@ DisplaySendeString(" Abbruch"); Stepper_1_SetPara(TRAVELSPEED+100, TRAVELACC+300); + Stepper_3_SetPara(TRAVELSPEED+100, TRAVELACC+300); Stepper_1_GoHome(); Set_Servo_Bad_Fil(); Stepper_1_Run('V', 300); + Stepper_3_Run('V', 300); StatusDUO=DUO_FILA_BAD1; } @@ -235,7 +250,9 @@ { Stepper_1_Leerlauf(); Stepper_2_SetPara(300, 300); + Stepper_1_SetPara(300, 300); Stepper_2_Run('V', 300); + Stepper_1_Run('V', 300); DisplaySendeBefehl(0x01); gotoxy(1,1); @@ -269,10 +286,18 @@ Stepper_2_SetPara(100, 100); Stepper_1_SetPara(100, 100); - Set_Cutter(500, 0, 1); + Set_Cutter(550, 0, 1); motors[1]->move(StepperMotor::FWD, 128*400*4); motors[0]->move(StepperMotor::BWD, 128*400*0.3); - Set_Cutter(600, 0, 1); + Set_Cutter(650, 0, 1); + + DisplaySendeBefehl(0x01); + gotoxy(1,1); + DisplaySendeString("Schlechtes Filament "); + gotoxy(1,3); + DisplaySendeString("erkannt. "); + gotoxy(1,2); + DisplaySendeString("Wird geschnitten! "); motors[1]->wait_while_active(); motors[0]->move(StepperMotor::FWD, 128*400*0.3); @@ -294,7 +319,9 @@ { Stepper_2_Stop(); Set_Servo_Bad_Fil(); - Stepper_3_Leerlauf(); + Stepper_1_SetPara(TRAVELSPEED+100, TRAVELACC+300); + Stepper_3_SetPara(TRAVELSPEED+100, TRAVELACC+300); + Stepper_3_Run('V', 300); Stepper_1_Run('V', 300); DisplaySendeBefehl(0x01); @@ -328,10 +355,16 @@ Stepper_3_SetPara(100, 100); Stepper_1_SetPara(100, 100); - Set_Cutter(500, 0, 1); + Set_Cutter(550, 0, 1); motors2[0]->move(StepperMotor::FWD, 128*400*4); motors[0]->move(StepperMotor::BWD, 128*400*0.3); - Set_Cutter(600, 0, 1); + Set_Cutter(650, 0, 1); + + DisplaySendeBefehl(0x01); + gotoxy(1,1); + DisplaySendeString("Filament wird ge-"); + gotoxy(1,3); + DisplaySendeString("schnitten"); motors2[0]->wait_while_active(); motors[0]->move(StepperMotor::FWD, 128*400*0.3); @@ -358,6 +391,16 @@ { Stepper_1_SetHome(); + DisplaySendeBefehl(0x01); + gotoxy(1,1); + DisplaySendeString("Schlechtes Filament "); + gotoxy(1,3); + DisplaySendeString("erkannt. "); + gotoxy(1,2); + DisplaySendeString("Zu erst Spleissen. "); + gotoxy(1,4); + DisplaySendeString(" Abbruch"); + StatusDUO=DUO_FILA_CUT3_2; } @@ -378,9 +421,8 @@ gotoxy(1, 1); DisplaySendeString("ACHTUNG:"); gotoxy(1, 2); - DisplaySendeString("SPLEISSENUNG!!!"); + DisplaySendeString("SPLEISSUNG!!!"); - Stepper_2_MarkPos(); // Stepper_1_SetPara(PRECISIONSPEED, PRECISIONACC); // Stepper_1_Move('V', 0.11*400); @@ -388,16 +430,16 @@ Stepper_1_SetPara(PRECISIONSPEED, PRECISIONACC); Stepper_2_SetPara(PRECISIONSPEED, PRECISIONACC); - motors[0]->move(StepperMotor::BWD, 128*400*0.25); - motors[1]->move(StepperMotor::BWD, 128*400*0.26); + motors[0]->move(StepperMotor::BWD, 128*400*0.22); + motors[1]->move(StepperMotor::BWD, 128*400*0.23); Set_Spleisser(ARConTIME, ARCoffTIME, REPETITONS); motors[0]->wait_while_active(); motors[1]->wait_while_active(); - motors[0]->move(StepperMotor::FWD, 128*400*0.13); - motors[1]->move(StepperMotor::FWD, 128*400*0.14); + motors[0]->move(StepperMotor::FWD, 128*400*0.10); + motors[1]->move(StepperMotor::FWD, 128*400*0.11); Set_Spleisser(ARConTIME, ARCoffTIME, REPETITONS+2); @@ -408,9 +450,9 @@ Stepper_1_SetPara(FILSPEED, FILACC); Stepper_2_SetPara(FILSPEED, FILACC); - motors[0]->move(StepperMotor::BWD, 0.55*400*128); + motors[0]->move(StepperMotor::BWD, 0.65*400*128); Thread::wait(10); - Stepper_2_Move('R', 0.65*400); + Stepper_2_Move('R', 0.85*400); DisplaySendeBefehl(0x01); DisplaySendeBefehl(0x0C); @@ -424,15 +466,11 @@ Stepper_1_SetPara(TRAVELSPEED+200, SLOWACC); Stepper_2_SetPara(TRAVELSPEED+200, SLOWACC); - motors[0]->move(StepperMotor::FWD, 128*400*0.8); - motors[1]->move(StepperMotor::FWD, 128*400*0.8); + motors[0]->move(StepperMotor::FWD, 128*400*1.5); + motors[1]->move(StepperMotor::FWD, 128*400*1.5); motors[0]->wait_while_active(); motors[1]->wait_while_active(); - - Stepper_1_Leerlauf(); - - Stepper_2_GoMark(); - + StatusDUO = DUO_SPLEISSEN_GOOD; } @@ -453,26 +491,25 @@ gotoxy(1, 1); DisplaySendeString("ACHTUNG:"); gotoxy(1, 2); - DisplaySendeString("SPLEISSENUNG!!!"); + DisplaySendeString("SPLEISSUNG!!!"); - Stepper_2_MarkPos(); // Stepper_1_SetPara(PRECISIONSPEED, PRECISIONACC); // Stepper_1_Move('V', 0.11*400); - Stepper_1_SetPara(PRECISIONSPEED, PRECISIONACC); + Stepper_1_SetPara(PRECISIONSPEED, PRECISIONACC); Stepper_2_SetPara(PRECISIONSPEED, PRECISIONACC); - motors[0]->move(StepperMotor::BWD, 128*400*0.25); - motors[1]->move(StepperMotor::BWD, 128*400*0.26); + motors[0]->move(StepperMotor::BWD, 128*400*0.22); + motors[1]->move(StepperMotor::BWD, 128*400*0.23); Set_Spleisser(ARConTIME, ARCoffTIME, REPETITONS); motors[0]->wait_while_active(); motors[1]->wait_while_active(); - motors[0]->move(StepperMotor::FWD, 128*400*0.13); - motors[1]->move(StepperMotor::FWD, 128*400*0.14); + motors[0]->move(StepperMotor::FWD, 128*400*0.10); + motors[1]->move(StepperMotor::FWD, 128*400*0.11); Set_Spleisser(ARConTIME, ARCoffTIME, REPETITONS+2); @@ -483,9 +520,9 @@ Stepper_1_SetPara(FILSPEED, FILACC); Stepper_2_SetPara(FILSPEED, FILACC); - motors[0]->move(StepperMotor::BWD, 0.55*400*128); + motors[0]->move(StepperMotor::BWD, 0.65*400*128); Thread::wait(10); - Stepper_2_Move('R', 0.65*400); + Stepper_2_Move('R', 0.85*400); DisplaySendeBefehl(0x01); DisplaySendeBefehl(0x0C); @@ -499,15 +536,11 @@ Stepper_1_SetPara(TRAVELSPEED+200, SLOWACC); Stepper_2_SetPara(TRAVELSPEED+200, SLOWACC); - motors[0]->move(StepperMotor::FWD, 128*400*0.8); - motors[1]->move(StepperMotor::FWD, 128*400*0.8); + motors[0]->move(StepperMotor::FWD, 128*400*1.5); + motors[1]->move(StepperMotor::FWD, 128*400*1.5); motors[0]->wait_while_active(); motors[1]->wait_while_active(); - - Stepper_1_Leerlauf(); - - Stepper_2_GoMark(); - + StatusDUO = DUO_SPLEISSEN_BAD; } @@ -550,23 +583,29 @@ Stepper_2_SetPara(100, 100); Stepper_1_SetPara(100, 100); - Set_Cutter(500, 0, 1); + Set_Cutter(550, 0, 1); motors[1]->move(StepperMotor::FWD, 128*400*4); motors[0]->move(StepperMotor::BWD, 128*400*0.3); - Set_Cutter(600, 0, 1); + Set_Cutter(650, 0, 1); + + DisplaySendeBefehl(0x01); + gotoxy(1,1); + DisplaySendeString("Filament wird ge-"); + gotoxy(1,3); + DisplaySendeString("schnitten"); motors[1]->wait_while_active(); motors[0]->move(StepperMotor::FWD, 128*400*0.3); motors[0]->wait_while_active(); - // wait(10); + // wait(10); Set_Servo_Good_Fil(); Stepper_1_SetHome(); Stepper_2_SetPara(400, 300); - motors[1]->move(StepperMotor::FWD, 128*400*4); - motors[1]->wait_while_active(); - Stepper_2_Run('V', 150); - + // motors[1]->move(StepperMotor::FWD, 128*400*); + // motors[1]->wait_while_active(); + Stepper_2_Run('V', 150); + StatusDUO = DUO_FILA_BAD2; } @@ -870,7 +909,7 @@ { EntryDuoFertigGood(); } - if(LS_3 == 0) + else if(LS_3 == 0) { EntryDuoSpleissenBad(); } @@ -891,7 +930,7 @@ { EntryDuoFertigGood(); } - if(Fila_Good == false) //für Test->==true wenn gedrückt(heisst Filament ist schlecht) + else if(Fila_Good == false) //für Test->==true wenn gedrückt(heisst Filament ist schlecht) { EntryDuoSpleissenVorbeBad2(); }