-
Software-Update for Cutting-List
03/14/2017 at 19:50 • 0 commentsAs i said, i updated the interface of my machine. The result of a few hours of programming is now that you can programm a list of cables to cut. That means you can say: " yeah i want 2x 4cm and 5x 10cm ". Then you only habe to press the buttons and the machine does his job. :) This is a huge step in the possibilities you have with my project !! I hope you like it !! In a few days i will post the code :)
-
Interface Update
03/12/2017 at 16:37 • 0 commentsI added a few buttons for a new menu, where you can programm a list of cables to cut.
-
I2C-Update
03/12/2017 at 12:01 • 0 commentsFinally the I2C-LCD-Chip arrived .. So let's update it!!
-
Project-Information
03/10/2017 at 07:20 • 0 commentsI plan to update my project!! I talked to a few people and found some nice thinks that could be improved!! 1.Ethernet-access 2.better machine-menu 3.getting the hole thing faster 4.programmable cutting-list 5.wire stripping? 6.what would you think i can add on? Greetings from Bavaria !! :) -
Cutting-Code
03/04/2017 at 14:26 • 0 comments/* * Author: Christoph Kirschner * Created: 01.01.2016 * Description: Automatischer Kabelschneider */ #include <LiquidCrystal.h> #include <Stepper.h> // Anzahl der Schritte, die für eine Umdrehung benötigt werden #define STEPS 400 // Spannungsgrenzwerte der ersten 5 Knöpfen int voltages[5][2] = {{1005, 1016}, {510, 520}, {90, 110}, {170, 185}, {930, 932}}; // Sorgt dafür, dass die Knöpfe nur jede Millisekunde ausgelesen werden unsigned long lastButtonReadTime = 0; // Zählt wie viele Millisekunden eine Spannungänderung anlag unsigned int changedVoltageTime = 0; // Letzte entprellte Eingangsspannung int lastButtonVoltage = 0; // Zur Wahl von Kabellänge oder Stückzahl bool changeLength = true; // Kabellänge der zu schneidenden Kabel unsigned int cableLength = 0; // Stückzahl der zu schneidenden Kabel unsigned int cableNumber = 0; // Bibliotheken initializieren LiquidCrystal lcd(12, 11, 5, 4, 3, 2); Stepper stepper(STEPS, 6, 7, 8, 9); // Prädeklarationen void checkButton(int voltage); void pressButton(int buttonIndex); void startCutting(); bool isPliersCompressed(); bool isPliersOpen(); void cutt(); void lcdDisplay(unsigned int alreadyCutted); /********************************************** Initializiere Bibliotheken und zeige Boot-Nachricht **********************************************/ void setup() { Serial.begin(9600); // LCD-Display hat 16 Spalten und 2 Zeilen lcd.begin(16, 2); // rpm des Steppermotors stepper.setSpeed(30); lcd.setCursor(0, 0); lcd.print("Welcome!"); delay(1000); // System is starting... lcd.clear(); lcd.setCursor(0, 0); lcd.print("System is"); lcd.setCursor(0, 1); lcd.print("starting..."); cutt(); // System is ready now! lcd.clear(); lcd.setCursor(0, 0); lcd.print("System is"); lcd.setCursor(0, 1); lcd.print("ready now!"); delay(2000); lcdDisplay(0); } /********************************************** Hauptloop mit Knopfentprellung **********************************************/ void loop() { if (lastButtonReadTime != millis()) { int voltage = analogRead(A0); // Zählt die ms, bei denen eine andere als letzte Spannung anlag if (voltage != lastButtonVoltage) { changedVoltageTime++; } else if (changedVoltageTime > 0) { changedVoltageTime--; } // Wenn die letzten 50ms eine andere Spannung als letzte anlag if (changedVoltageTime >= 50) { changedVoltageTime = 0; lastButtonVoltage = voltage; if (voltage > 0) { checkButton(voltage); } } lastButtonReadTime = millis(); } } /********************************************** Führt die entsprechende Aktion je nach Spannung aus **********************************************/ void checkButton(int voltage) { for (int i = 0; i < 5; i++) { // Voltage wird gegenüber min und max Grenzwert verglichen. if (voltage >= voltages[i][0] && voltage <= voltages[i][1]) { pressButton(i); lcdDisplay(0); return; } } } /********************************************** Aktion des entsprechenden Knopfes wird ausgeführt **********************************************/ void pressButton(int buttonIndex) { switch (buttonIndex) { case 0: Serial.println("Auswahl"); changeLength = !changeLength; break; case 1: if (changeLength && cableLength < 100) { cableLength++; Serial.println("Length + 1"); } else if (cableNumber < 100) { cableNumber++; Serial.println("Number + 1"); } break; case 2: if (changeLength && cableLength > 0) { cableLength--; Serial.println("Length - 1"); } else if (cableNumber > 0) { cableNumber--; Serial.println("Number - 1"); } break; case 3: Serial.println("Start"); startCutting(); break; case 4: Serial.println("Einzug"); stepper.step(50); cutt(); break; } } /********************************************** Schneide entsprechende Anzahl der Kabel mit entsprechender Länge ab **********************************************/ void startCutting() { lcd.noCursor(); for (unsigned int i = 1; i <= cableNumber; i++) { stepper.step(cableLength * 17.9); cutt(); lcdDisplay(i); } } /********************************************** Gibt an, ob die Zange zusammengezogen ist **********************************************/ bool isPliersCompressed() { delay(50); if (analogRead(A1) == 0 && analogRead(A2) != 0){ delay(10); return analogRead(A1) == 0 && analogRead(A2) != 0; }else{ return false;} } /********************************************** Gibt an, ob die Zange ganz offen ist **********************************************/ bool isPliersOpen() { delay(50); if (analogRead(A2) == 0 && analogRead(A1) != 0){ delay(10); return analogRead(A2) == 0 && analogRead(A1) != 0; }else{ return false; } } /********************************************** Mit der Zange einmal das Kabel abschneiden **********************************************/ void cutt() { // Zuziehen solange die Zange nicht ganz zusammengedrückt ist digitalWrite(13, HIGH); while (!isPliersCompressed()) { delay (10); } // Öffnen solange die Zange nicht ganz offen ist digitalWrite(13, LOW); delay(50); digitalWrite(10, HIGH); while (!isPliersOpen()) { delay(10); } if (isPliersOpen()== true) { digitalWrite(10, LOW);} delay(50); } /********************************************** Gibt die Länge, den Ist- und den Sollwert der Kabel am LCD aus. **********************************************/ void lcdDisplay(unsigned int alreadyCutted) { lcd.clear(); lcd.noCursor(); // Erste Zeile lcd.setCursor(0, 0); lcd.print("Kabell.:"); lcd.setCursor(9, 0); lcd.print(cableLength); lcd.setCursor(12, 0); lcd.print("cm"); // Zweite Zeile lcd.setCursor(3, 1); lcd.print(alreadyCutted); lcd.setCursor(6, 1); lcd.print("/"); lcd.setCursor(9, 1); lcd.print(cableNumber); // Setzte den blinkenden Cursor auf den ausgewählten Wert // wenn gerade kein Schneidevorgang läuft if (alreadyCutted == 0) { lcd.cursor(); if (changeLength) { lcd.setCursor(9, 0); } else { lcd.setCursor(9, 1); } } }
-
Let it cut!!
03/04/2017 at 10:06 • 2 commentsI made a small video of the machine cutting some cables. I hope you like it !! :)