Dust Management
- gkas
- Vectric Wizard
- Posts: 1450
- Joined: Sun Jan 01, 2017 3:39 am
- Model of CNC Machine: Aspire, Axiom AR8 Pro+, Axiom 4.2W Laser
- Location: Southern California
Re: Dust Management
I'm wondering how well the gates perform after a period of use. The main problem would be jamming from excess sawdust. Would there be any way to sense 'no movement' after an open/close command? Or the alternative 'command completed'. Am I overthinking this?
- jimandi5000
- Vectric Wizard
- Posts: 1050
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact:
Re: Dust Management
My son asked me the same question. I ran the gate cycles open then close every 2.5 seconds for about 3 hours no issues. I would have ran the test but the wife was going nuts from the cycling noise.
Thanks,
Jim
Jim
- FixitMike
- Vectric Wizard
- Posts: 2173
- Joined: Sun Apr 17, 2011 5:21 am
- Model of CNC Machine: Shark Pro Plus (retired)
- Location: Burien, WA USA
Re: Dust Management
A somewhat simpler system is to have a current sensor for the circuits that power the tools that use the dust collector. I installed separate power strips for those circuits. Anything plugged into the power strips will turn on the dust collector. Manual gates at each machine are easy enough to use.
Good judgement comes from experience.
Experience comes from bad judgement.
Experience comes from bad judgement.
- gkas
- Vectric Wizard
- Posts: 1450
- Joined: Sun Jan 01, 2017 3:39 am
- Model of CNC Machine: Aspire, Axiom AR8 Pro+, Axiom 4.2W Laser
- Location: Southern California
Re: Dust Management
I think then that we'd be missing the 'geek factor' Nowhere did we note 'easy' as a decision point. Then we wouldn't be able to go out and order a bunch of new toys.
- jimandi5000
- Vectric Wizard
- Posts: 1050
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact:
Re: Dust Management
Hi all,
I got it working!!! Now let me be clear, it is a mess! Here is a copy of my code.
It is late so I will be posting some pictures this weekend.
I got it working!!! Now let me be clear, it is a mess! Here is a copy of my code.
Code: Select all
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_PWMServoDriver.h>
#include <TimeLib.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 20 chars and 4 line display
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
//=============================================================
int gate[17][13] = {
/* Array J45 But Servo LED Sen/Act Servo Servo Port IR Dust Dust Port
Number Port Pin Pin Pin Pin Close Open Active Sensor Light Relay Type
0 1 2 3 4 5 6 7 8 9 10 11 12 */
{0, 1, 0, 1, 31, A11, 210, 338, 1, 0, 0, 0, 1}, // * 12 disk Sand - Sensor (110)
{1, 2, 0, 2, 32, A12, 390, 520, 1, 0, 0, 0, 1}, // * Drum Sander - Sensor (110)
{2, 3, 0, 3, 33, A13, 200, 338, 1, 0, 0, 0, 1}, // * Belt Sander - Sensor (110)
{3, 4, 0, 4, 34, A14, 115, 260, 1, 0, 0, 0, 1}, // * Wire 18 Band saw - Sensor (220)
{4, 5, 0, 5, 35, A15, 115, 238, 1, 0, 0, 0, 1}, // * Drill press - Sensor (110)
{5, 6, 0, 6, 36, A10, 70, 250, 1, 0, 0, 0, 1}, // 4 inch Overhead Gate - Sensor (110)
{6, 7, 47, 6, 37, 0 , 70, 250, 1, 0, 0, 0, 2}, // 4 inch Flex hose - button
{7, 8, 48, 8, 38, 0 , 100, 250, 1, 0, 0, 0, 2}, // 4 inch Overhead Gate? - button
{8, 9, 49, 9, 39, 0, 90, 225, 1, 0, 0, 0, 4}, // CNC Mill - Run Relay
{9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5}, // Open
{10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5}, // Open
{11, 12, 0, 0, 0, 0, 0, 0, 1, A13, 51, 52, 0}, // Dust Collector
{12, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}, // CNC Mill - button
{13, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3}, // A Control - Button (Green)
{14, 0, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3}, // B Control - Button (Blue)
{15, 0, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3}, // C Control - Button (Yellow)
{16, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5} // Reset+Reset - Buttons (Red)
};
char * toolName[] = {
// 12345678901234567890
"12 inch Disk Sander ", // 0
"Drum Sander ", // 1
"1.5 inch Belt Sander", // 2
"18 inch Bandsaw ", // 3
"14 inch Drillpress ", // 4
"4 inch Flex Hose ", // 5
"4 inch Overhead Gate", // 6
"CNC Mill Dust Gate ", // 7
"Dust Collector ", // 8
"Port 9 not used ", // 9 Green button on box
"Port 10 not used ", // 10 tbd
"Port 11 not used ", // 11 tbd
"Dust Collector ", // 12
"A - Button (Green) ", // 13
"B - Button (Blue) ", // 14
"C - Button (Yellow) ", // 15
"All Gates Closed ", // 16
"Powered On ", // 17
"Powered Off ", // 18
"Pressed ", // 19
"====================", // 20
"4 inch Gate Open ", // 21
"3 inch Gate Open ", // 22
"System ", // 23
"Loading... ", // 24
"Ready... ", // 25
"Gate Open ", // 26
"Gate Closed ", // 27
"Code: ", // 28
"All Gates Closed ", // 29
"Powered On ", // 30
"Powered Off ", // 31
"Pressed ", // 32
"====================", // 33
"4 inch Gate ", // 34
"3 inch Gate " // 35
};
//=============================================================
// Notes
//=============================================================
float nVPP; //Voltage measured across resistor
float PressLen = 0;
float DustLevelCount = 100000;
float DustLevel = 1;
float DustLevelLenth = 300;
float vNumber[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
int aValue = 99;
String Button = "";
int StayOn = 0;
int Running = 0;
int debug = 0;
// ============================================================
void setup() { // Setup
pwm.begin();
pwm.setPWMFreq(60); //Default is 1000mS
Serial.begin(9600);
delay(1000);
debuger("Loading",1);
Display4("","System", "Start up");
debuger("Code", 1);
for(int i=0; i<18;i++){
debuger("0", 2);
if(gate[i][8] == 1 && gate[i][12] == 0){ //Dust Collector
pinMode(gate[i][9], INPUT); //IR Sencor
pinMode(gate[i][10], OUTPUT); //Relays
pinMode(gate[i][11], OUTPUT); //Relays
}
debuger("1", 2);
if(gate[i][8] == 1 && gate[i][12] == 1){
pinMode(gate[i][5], INPUT); //Sencor
}
debuger("2", 2);
if(gate[i][8] == 1 && gate[i][12] == 2){
pinMode(gate[i][2], INPUT_PULLUP); //Buttons
}
debuger("3", 2);
if(gate[i][8] == 1 && gate[i][12] == 3){
pinMode(gate[i][2], INPUT_PULLUP); //Control Buttons
}
debuger("4", 2);
if(gate[i][8] == 1 && gate[i][12] == 4){
pinMode(gate[i][2], INPUT_PULLUP); //CNC Relay
}
debuger("0", 2);
if(gate[i][8] == 1 && gate[i][4] > 0){
pinMode(gate[i][4], OUTPUT); //LEDs
}
}
delay(2000);
Cgate();
delay(5000);
debuger("Loaded Pin Settings", 1);
ResetVolts();
debuger("Loaded Code", 1);
}
//=============================================================
void debuger(String words, int Lev){ //Show data on the LED
if(Lev == debug)
{Serial.println(words) ;
}
}
//=============================================================
void loop(){ //Looping
PressLen = 0;
if (StayOn == 0){ // Sensor Sweep
debuger("***** Sensor Sweep *******", 1) ;
Button = "";
aValue = 13;
Display4("--------------------","Sweeping", "Sensors");
for(int i=0; i<18; i++){ // Sweeping Sensors
if(gate[i][8] == 1 && gate[i][12] == 1){ //Must be a Sensors
debuger("**", 2) ;
Running = 1;
debuger("------", 2);
nVPP = getVPP(gate[i][5]);
aValue = i;
debuger(aValue,2);
debuger(String(nVPP), 2);
while(nVPP > vNumber[aValue]){
Dust_On(); //Dust Collector On
Ogate(); //Gate Open
LED_On(aValue); //LED On
Running = 0;
DisplaySencor(aValue);
debuger(String(nVPP), 2);
Button = String(toolName[aValue]); //Tool Name Running
nVPP = getVPP(gate[aValue][5]);
}
if (Running == 0){
Dust_Off(); //Dust Collector Off
LED_Off(); //LED Off
Cgate(); //Gate Close
}
}
}
}
//"***** CNC Relay Sweep *******"
debuger("***** CNC Relay Sweep *******", 1) ;
for(int i=0; i<18; i++){ // CNC Relay
if(gate[i][8] == 1 && gate[i][12] == 4){ //Must be a CNC Relay
aValue = i;
debuger("***** CNC Relay *******", 2) ;
Running = 0;
while (digitalRead(gate[aValue][2]) == LOW){
Button = String(toolName[aValue]); //Tool Name Running
debuger("***** CNC Running *******", 2) ;
Display4(Button, Button, Button);
if (Running == 0){
Ogate(); //Gate Open
LED_On(aValue); //LED On
Dust_On(); //Dust Collector On
Running = 2;
}
}
if(Running == 2){
LED_Off(); //LED Off
Dust_Off(); //Dust Collector Off
Cgate(); //Gate Close
Running = 0;
}
}
}
//***** Button Sweep *******
debuger("***** Button Sweep *******", 1);
Display4("--------------------","Sweeping", "Buttons");
for(int i=0; i<18; i++){ // Sweeping Buttons
if(gate[i][8] == 1 && gate[i][12] == 2) {
aValue = i;
debuger("*+*", 2);
while (digitalRead(gate[aValue][2]) == LOW){
PressLen = PressLen + 101;
debuger("While " + String(PressLen), 2);
delay(500);
if (PressLen >= 500){
LEDs_On(); // All LED's On
}else{
LED_Off();
}
}
debuger("*-*", 2);
debuger(String(aValue), 2);
debuger(String(PressLen), 2);
if (PressLen >= 500){
if (StayOn == 0){
StayOn = 1;
debuger("Stay On", 2);
Ogate(); //Gate Open
Dust_On(); //Dust Collector On
PressLen = 0;
}
}
if(PressLen > 1 && PressLen < 500){
LED_Off(); //LED Off
StayOn = 0;
Dust_Off(); //Dust Collector Off
debuger("Stay Off", 2);
Cgate(); //Gate Close
}
}
}
//***** Control Button Sweep *******
debuger("***** Control Button Sweep *******", 1) ;
for(int i=0; i<18; i++){ // Control Button
if(gate[i][8] == 1 && gate[i][12] == 3){
aValue = i;
if(digitalRead(gate[aValue][2]) == LOW){
debuger("Control Button", 1);
debuger(String(aValue), 1);
ResetVolts();
Button = toolName[aValue];
if (aValue == 13){
debuger("-13-", 1);
LEDs_On(); //All LED's On
for(int x=0; x<18; x++){
if(gate[x][12] == 1) {
debuger(String(x), 1);
nVPP = getVPP(gate[x][5]);
debuger(String(nVPP), 1);
aValue = 20;
Display4("-Sensor Value-","Sensor Value: " + String(x), String(nVPP));
delay(2000);
}
}
LED_Off(); // LED Off
}
if (aValue == 14){
debuger("-14-", 1);
LEDs_On(); // All LED's On
for(int x=0; x<18; x++){
if(gate[x][6] > 1) {
debuger(String(x), 1);
aValue = 20;
Display4("-Gate Value-", String(toolName[x]), "Gate Cycling");
debuger("Gate Cycling the " + String(toolName[x]) ,1);
pwm.setPWM(gate[x][3], 0, gate[x][7]); //Gate Open
delay(3000);
pwm.setPWM(gate[x][3], 0, gate[x][6]); //Gate Open
delay(2000);
}
}
LED_Off(); // LED Off
}
if (aValue == 15){
debuger("-15-", 1);
LEDs_On(); // All LED's On
Ogates(); // Gates Open
Display4("-Gate Value-", "Dust Collector", "Run 15 Seconds");
Dust_On(); //Dust Collector On
delay(15000);
aValue = 20;
Display4("-Gate Value-", "Dust Collector", "Off");
Dust_Off(); //Dust Collector Off
delay(5000);
Cgate(); // Gate Close
LED_Off(); // LED Off
}
}
}
}
}
//=============================================================
void LED_Off(){ // All LED Off
//Display("All LEDs", "Off");
for(int i=0; i<18; i++){
if(gate[i][4] > 1){
digitalWrite(gate[i][4], LOW);
}
}
}
//=============================================================
void LEDs_On(){ // All LED's On
//Display("All LEDs", "On");
for(int i=0; i<18; i++){
if(gate[i][4] > 1){
digitalWrite(gate[i][4], HIGH);
}
}
}
//=============================================================
void ResetVolts(){ // Sets the Sensor Array
for(int a=0; a<18; a++){
if(gate[a][8] == 1 && gate[a][12] == 1){
vNumber[a] = getVPP(gate[a][5]) + 0.2;
debuger("Amp Value: ", 2);
debuger(String(vNumber[a]), 2);
}
}
}
//=============================================================
void Ogates(){ // Open All Gates
debuger("--- Open All Gates ---", 1);
delay(2000);
for(int a=0; a<18; a++){
if(gate[a][6] > 1){
pwm.setPWM(gate[a][3], 0, gate[a][7]);
}
}
}
//=============================================================
void Ogate(){ // Close Gates
pwm.setPWM(gate[aValue][3], 0, gate[aValue][7]); //Gate Open
}
//=============================================================
void Cgate(){ // Close All Gates
debuger("--- Closing Gates ---", 1);
delay(2000);
for(int a=0; a<18; a++){
if(gate[a][6] > 1){
pwm.setPWM(gate[a][3], 0, gate[a][6]);
}
}
}
//=============================================================
void LED_On(int x){ // LED On
debuger(Button + String(x) + " ", 1);
debuger("LED On", 2) ;
digitalWrite(gate[x][4], HIGH);
delay(250);
}
//=============================================================
void Dust_On(){ // Dust Collector On
debuger("Dust Collector On", 1);
Display4("--------------------","Dust Collector", "On ");
digitalWrite(gate[11][11], HIGH); // sets the Dust Collector On
}
//=============================================================
void Dust_Off(){ // Dust Collector Off
debuger("Dust Collector Off = 10 seconds", 1) ;
Display4("--------------------","Dust Collector", "Off in 10 seconds");
delay(5000); // Time to clear the line
debuger("Dust Collector Off = 5 seconds", 1) ;
Display4("--------------------","Dust Collector", "Off in 5 seconds");
delay(5000); // Time to clear the line
debuger("Dust Collector Off", 1);
Display4("--------------------","Dust Collector", "Off ");
digitalWrite(gate[11][11], LOW); // sets the Dust Collector Off
}
//=============================================================
void DustLevel_On(){ // Dust Collector Light On
debuger("Dust Collector Level Light On", 1) ;
Display4("--------------------","Dust Collector", "Level Light On");
digitalWrite(gate[11][10], HIGH); // sets the Dust Collector On
}
//=============================================================
void DustLevel_Off(){ // Dust Collector Light Off
debuger("Dust Collector Light Off", 1);
Display4("--------------------","Dust Collector", "Level Light Off");
digitalWrite(gate[11][10], LOW); // sets the Dust Collector Off
}
//=============================================================
void DisplaySencor(int X){ // Displays the sensor information
uint32_t now_time = millis();
lcd.init();
debuger("1a",2);
// Print a message to the LCD.
lcd.backlight();
debuger("2", 2);
lcd.clear();
lcd.setCursor(0,0);
debuger("2a", 2);
lcd.print("-- Voltage Sensor --");
lcd.setCursor(0,1);
String hr = String(hour());
String mn = String(minute());
String sc = String(second());
if (hr.length()==1){ hr = "0" + hr; }
if (mn.length()==1){ mn = "0" + mn; }
if (sc.length()==1){ sc = "0" + sc; }
lcd.print("Run Time: " + hr + ":" + mn + ":" + sc);
lcd.setCursor(0,2);
lcd.print(toolName[X]);
lcd.setCursor(0,3);
lcd.print(toolName[26]);
}
//=============================================================
void Display4(String Word1, String Word2, String Word3) { // Post info to LCD Display
uint32_t now_time = millis();
lcd.init();
// Print a message to the LCD.
debuger("1", 2);
lcd.backlight();
//lcd.clear();
lcd.setCursor(0,0);
debuger("1", 2);
if (DustLevelCount > 100){
DustLevel = getDist();
DustLevelCount = 0;
}
DustLevelCount = DustLevelCount + 1;
lcd.print("Dust Level = " + String(DustLevel));
lcd.setCursor(0,1);
String hr = String(hour());
String mn = String(minute());
String sc = String(second());
if (hr.length()==1){ hr = "0" + hr; }
if (mn.length()==1){ mn = "0" + mn; }
if (sc.length()==1){ sc = "0" + sc; }
lcd.print("Run Time: " + hr + ":" + mn + ":" + sc);
lcd.setCursor(0,2);
lcd.print(Word2);
lcd.setCursor(0,3);
lcd.print(Word3);
}
//=============================================================
float getDist(){ // Get Dust Level Distance from the dust bin
float result;
float readValue; //value read from the sensor
float maxValue = 0; //Store max value here
float minValue = 50000; //Store min value here
uint32_t start_time = millis();
while((millis() - start_time) < 1000){ //Sample for 1 Sec
debuger("a",2);
readValue = analogRead(gate[11][9]); //See if you have a new maxValue
debuger(String(readValue),2);
if (readValue > maxValue){
maxValue = readValue; //Record the maximum sensor value
}
if (readValue < minValue){
minValue = readValue; //Record the maximum sensor value
}
}
result = ((maxValue + minValue) * 0.5); //Convert the digital data to a voltage
debuger("Dust Level", 2) ;
debuger(String(result), 2) ;
debuger(String(DustLevelLenth), 2) ;
/*if (result > DustLevelLenth){
DustLevel_On();
}else{
DustLevel_Off();
}*/
return result;
}
//=============================================================
float getVPP(int Pin){ // Get Amp Level Reader
float result;
int readValue; //value read from the sensor
int maxValue = 0; //Store max value here
uint32_t start_time = millis();
while((millis()-start_time) < 50) //Sample for 1 Sec
{
readValue = analogRead(Pin); //See if you have a new maxValue
if (readValue > maxValue){
maxValue = readValue; //Record the maximum sensor value
}
}
result = (maxValue * 5.0)/1024.0; //Convert the digital data to a voltage
return result;
}
//=============================================================
It is late so I will be posting some pictures this weekend.
Last edited by jimandi5000 on Sat Feb 29, 2020 4:00 am, edited 1 time in total.
Thanks,
Jim
Jim
- highpockets
- Vectric Wizard
- Posts: 3667
- Joined: Tue Jan 06, 2015 4:04 pm
- Model of CNC Machine: PDJ Pilot Pro
- gkas
- Vectric Wizard
- Posts: 1450
- Joined: Sun Jan 01, 2017 3:39 am
- Model of CNC Machine: Aspire, Axiom AR8 Pro+, Axiom 4.2W Laser
- Location: Southern California
Re: Dust Management
Lookin good.....
- jimandi5000
- Vectric Wizard
- Posts: 1050
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact:
- jimandi5000
- Vectric Wizard
- Posts: 1050
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact:
- highpockets
- Vectric Wizard
- Posts: 3667
- Joined: Tue Jan 06, 2015 4:04 pm
- Model of CNC Machine: PDJ Pilot Pro
Re: Dust Management
Wow!!!! Fantastic Jim. Well designed and your code looks great....
Thanks for the pics....
Thanks for the pics....
John
Maker of Chips
Maker of Chips
- jimandi5000
- Vectric Wizard
- Posts: 1050
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact:
Re: Dust Management
Thanks High Pockets,
One of my next item is to re-pipe the shop... Okay, it is a mess... I need to move everything out, cleanup and re-setup the shop.
One of my next item is to re-pipe the shop... Okay, it is a mess... I need to move everything out, cleanup and re-setup the shop.
Thanks,
Jim
Jim
- highpockets
- Vectric Wizard
- Posts: 3667
- Joined: Tue Jan 06, 2015 4:04 pm
- Model of CNC Machine: PDJ Pilot Pro
Re: Dust Management
Looks pretty good to me...
Can't wait to get back into my shop....
Can't wait to get back into my shop....
John
Maker of Chips
Maker of Chips
- gkas
- Vectric Wizard
- Posts: 1450
- Joined: Sun Jan 01, 2017 3:39 am
- Model of CNC Machine: Aspire, Axiom AR8 Pro+, Axiom 4.2W Laser
- Location: Southern California
Re: Dust Management
That is one lotta work in a short time... It really looks great. How did you implement the dust level sensor. It's gotta be touchy to keep down the false positives.
- highpockets
- Vectric Wizard
- Posts: 3667
- Joined: Tue Jan 06, 2015 4:04 pm
- Model of CNC Machine: PDJ Pilot Pro
- jimandi5000
- Vectric Wizard
- Posts: 1050
- Joined: Wed Mar 11, 2015 6:50 pm
- Model of CNC Machine: Home Made 60 x 120
- Location: North Houston Tx.
- Contact:
Re: Dust Management
I used a infared distance module. I measure the height of the dust in the can and hold the light on based on the distance from the top of the can to the dust. If the dust is at the top, i don't run the dust collector and keep the red light flashing. I have to run the check before i run the dust collector, it is crazy values when it is running.
Thanks,
Jim
Jim