Jam Mitigation Sensor for 3DPrinting

Jam Mitigation Sensor for 3D Printing
(AKA JMS3DPrinting)
Jim Stana
Owner
JMS3DPrinting.com
(files available at blog portion of above website)
Presented on Arduino Day, 3 28 2015
Copyright JMS3DPrinting.com
1
Problem Statement
• When using a 3D printer, the print
can fail for several reasons:
– 1. Filament crosses on reel and jams or
large loop falls outside of reel and
wraps around axle.
– 2. Nozzle becomes clogged and
filament fails to feed
– 3. Filament can run out
(this is more predictable)
In all cases above, the reel will stop moving
Copyright JMS3DPrinting.com
2
Challenges
• Rate at which filament reel turns is not constant
– 1. Varies with print settings (.15 vs .25 mm layers)
– 2. Will be slowest with full reel
– May also have delays during some portions of print
• Reel sizes are not standard (ID, OD, Flange width)
• I suck at electronics (retired mechanical engr)
• I really suck at code
I chose to try and fail repeatedly rather than stay
stuck in hand wringing mode.
Copyright JMS3DPrinting.com
3
Challenges cont.
Variation in spool sizes make creating an interface more challenging
Filament Spool sizes
ID (in) OD (in) Width (in) Flange thk Type
Wt (gms) Brand
1.5
7.625
3.164
0.238 plastic
221 Makergeeks white
2.25
7.875
2.5
0.18 plastic
174 Makergeeks flesh
1.5
7.875
2.43
0.12 cardboard
170 Afinia white
2.06
8
2.838
0.202 plastic
Inventables, Neon Orange
2.09
7.875
2.19
0.184 plastic
240 Afinia yellow
2.055
8
2.87
0.195 plastic
Makershed blue
2.04
7.81
2.46
0.144 plastic
UV red
1.54
7.625
3.355
0.235 plastic
Makergeeks silver
Internal diameter and width
of filament reels vary considerably
Copyright JMS3DPrinting.com
4
Solution
• I decided to go with an IR sensor and
sensor disk approach to detect reel
motion (or lack there-of) and trigger an
alarm.
– 1. Utilizes my knowledge of IR sensors
as used in business machines at Xerox
– 2. Uses my new knowledge of
Arduino
– 3. If successful, use on my 3D Printer
and submit to Make magazine
Initial prototype with
cardboard disk
A disk with fine slots will be used to provide an indication of motion to a sensor
Copyright JMS3DPrinting.com
5
Solution Path
• Took Arduino course Dec 2014 to learn how to:
– A. Power IR source and read in output of IR sensor
– B. Illuminate an LED to show when sensor was blocked/unblocked
– C. Turn on speaker alarm to signal when reel stops moving
– D. Report times that sensor is on or off to determine error setting
• Robotics club members helped me troubleshoot IR sensor circuit in
January, finally was able to duplicate and solder together recently.
• Constructed sensor disk out of cardboard for initial trial using 1/2 inch
increments and then 3D printed sensor disk with 0.12 inch incr.
• Modeled and 3D printed sensor holder after circuit prove out
• Wrote Arduino code to collect data on how long sensor stays on during
normal print and also to signal a failure when max time is exceeded.
Above process took about 4 months from class to working prototype
Copyright JMS3DPrinting.com
6
Working Solution Photos
3D printed sensor
disk and hub hung
onto sensor mount
Arduino board and
breadboard for speaker
driver and sensor LED
Copyright JMS3DPrinting.com
7
Circuit Diagram
I include physical characteristics to aid in ensuring the device is wired correctly
for those of us who are clueless reading these sorts of diagrams.
Copyright JMS3DPrinting.com
8
Code for sensor and alarm
// set limit beyond longest time encountered during normal print.
// sensor is on input 12, output 6 is for speaker alarm, count = 100 ms increment
//this section defines the variables
unsigned int count = 0;
int lastSwitch = HIGH;
int curSwitch = HIGH;
bool alarm = false;
//this section sets up initial values and defines pinouts
void setup()
{
pinMode(12, INPUT);
//input from IR sensor
pinMode (6,OUTPUT);
// output to speaker transistor
pinMode (4,OUTPUT);
// LED output to show that sensor is working
Serial.begin(9600);
curSwitch = digitalRead(12); // input 12 is IR sensor
}
// continued on next slide
I am sure many could improve on this code.
Copyright JMS3DPrinting.com
9
Code for sensor and alarm cont.
void loop()
{
lastSwitch = curSwitch;
delay (100);
curSwitch = digitalRead(12);
if (curSwitch == 1)
digitalWrite(4,HIGH);
else digitalWrite(4,LOW);
if (curSwitch == lastSwitch)
count++ ;
else
{Serial.println(count);
count = 0;
}
if (count > 150 && !alarm)
{
tone (6,400);
alarm = true;
}
}
//turns on LED to show sensor is working
// count in 100 msec increments
//can monitor times with serial monitor
//may have to adjust alarm time of 15 sec
//alarm tone
Copyright JMS3DPrinting.com
10
Status and Issues 3/26/2015)
Installed on my Afinia 3D printer.
Demonstrated that it can detect large loop jump and cross thread filament type jams
Using sensor during actual printing to gather experience. Have had one false alarm.
May have to vary fault setting by printer speed settings.
Current code must start after first extrusion of filament otherwise alarm will sound
during printer warm up.
Richard, of the Orlando Robotics and Makers Club, created a Mouse App that listens
for an error signal from the Arduino and pauses the printer. (code is listed on
reference pages after acknowledgements.)
Working on a better version of the reel mount which will accept a variety of sizes.
(Initial design only accepts 1.5 inch ID reel. I will upload upgrades after testing.)
Copyright JMS3DPrinting.com
11
Acknowledgements
• My thanks to the following members of the Orlando Robotics
and Makers Club
– Kevin, for inviting me to join the club
– Neil and Richard, for teaching the Arduino course
– Steve, for helping me get the sensor circuit working
– Richard (again) for writing the Windows mouse app that
allows the Arduino to pause the printer after a failure is
sensed and plays a Wav file.
I would not have been able to be successful at this project without the
collaboration of club members with complementary skills to my mechanical
engineering background.
Copyright JMS3DPrinting.com
12
Instructions
• Print hub, sensor mount and 4 sensor quadrants. May have to
ream out sensor mtg holes. Detector hole has 2 mm wide slot. I
used cellophane tape to keep 4 quadrant edges together. Filament
reel can be double back taped to sensor disk. Current design only
works with 1.5 inch ID reels. (watch for enhancements)
• Drill holes in top of sensor mount for 4 pin header. Solder wires,
resistors and IR source and detector and insert into mount.
• Assemble speaker driver and LED onto breadboard and connect
Arduino.
• Upload software to Arduino.
• Use serial port monitor to determine maximum times (in 100 msec
incr) of sensor motion for your printer during a typical print.
• Set maximum plus margin in code and upload code to Arduino.
• For a new print, start Arduino after initial filament reel motion has
occurred.
Copyright JMS3DPrinting.com
13
Follow on – Printer pause function
• Sequence of use
– Start printer printing. Bring up pause command
box
– Plug in Arduino to USB com port
– Bring up Arduino software
– Bring up Mouse app. Select USB port and define
mouse coordinates of pause button
– Start Mouse app running.
– If error encountered, mouse will pause printer but
Arduino must be reset to start print again.
Copyright JMS3DPrinting.com
14
Screen shot of Mouse App and Printer
software
Mouse coordinates of Printer Pause button are set in Mouse jump to Position settings
prior to initiating pushing start button of Mouse (Stop button shown)
Copyright JMS3DPrinting.com
15
Arduino code for Mouse app version
// set limit beyond longest time encountered during normal print.
// sensor is on input 12, output 6 is for speaker alarm, count = 100 ms increment
//this section defines the variables
unsigned int count = 0;
int lastSwitch = HIGH;
int curSwitch = HIGH;
bool alarm = false;
//this section sets up initial values and defines pinouts
void setup()
{
pinMode(12, INPUT);
Mouse app is included in
pinMode (6,OUTPUT);
download zip file.
pinMode (4,OUTPUT);
Serial.begin(9600);
curSwitch = digitalRead(12); // input 12 is IR sensor
}
void loop()
//continued on next slide
Copyright JMS3DPrinting.com
16
{
Mouse pause version continued
lastSwitch = curSwitch;
delay (100);
curSwitch = digitalRead(12);
if (curSwitch == 1)
digitalWrite(4,HIGH);
else digitalWrite(4,LOW);
if (curSwitch == lastSwitch)
count++ ;
else
{
count = 0;
}
if (count > 150 && !alarm)
{
Serial.println("E"); // Send serial command "E" for error to PC software
tone (6,400);
alarm = true;
}
}
Copyright JMS3DPrinting.com
17