This is the second and final part about my pneumatic slotter. You are advised to watch part 1 first if you have not already done so. That is located at • DIY Super Slotter, Bro...
This second video ties up a few loose ends as well as describing the control with an Arduino. A schematic is shown in the video and here follows the Arduino programme. Feel free to copy and use it if you want to build a similar control.
--------------------------------------
int myDelay; // myDelay = 0 to 1023 from 0 to 1 second
boolean setToGO = false ;
define maxTime 2 // multiplier for myDelay to get delay in msec.
void setup() {
myDelay = maxTime * analogRead(A1); // Initial dwell period
pinMode(9, OUTPUT) ;
pinMode(2, INPUT_PULLUP) ;
pinMode(3, INPUT_PULLUP) ;
digitalWrite(9, LOW); // Air must be on first, then this pulls ram up.
attachInterrupt(digitalPinToInterrupt(2), myStart, FALLING);
attachInterrupt(digitalPinToInterrupt(3), myStop, RISING);
delay(500); // have a rest
digitalWrite(9, HIGH); //Pushes ram down to start cycle
}
void myStart() {
setToGO = true;
}
void myStop() {
digitalWrite(9, LOW); // Turn off solenoid valve to lift ram
}
void loop() {
if (setToGO) {
delay(myDelay); // Dwell period before sending ram down.
digitalWrite(9, HIGH); // Turn on solenoid valve to plunge down
setToGO = false; // Reset ready for next cycle
}
myDelay = maxTime * analogRead(A1); // Get requested dwell, can be changed by pot on the fly
}
Негізгі бет Ғылым және технология Making motorcycle clutch housings and keyways.
Пікірлер: 2