Skip to content

Heats and dries wet filaments to improve print quality and longevity.

License

Notifications You must be signed in to change notification settings

jjsch-dev/filament_dryer_rp2040

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DIY Dehumidifier for 3D Printer Filaments

This project is a dehumidifier for 3D printer filaments that uses Arduino and Raspberry Pi modules. It heats and dries wet filaments to improve the quality and durability of your prints. It also has some cool features such as:

  • A slow temperature ramp that prevents thermal shock and damage to the filaments.
  • A heater temperature monitor that protects the equipment from overheating.
  • A spool turn counter that tracks how much filament you have used or left.
  • A PWM controller that turns on and off the heater based on the spool rotation speed.
  • A PWM cut timer that stops the heater after a certain time period for safety reasons.
  • A lid sensor that shuts off the heater when you open the lid to access the filaments.
  • An auto-tuning algorithm that adjusts the PID constants for optimal temperature control.
  • A USB interface that plots the graph of the system response and allows firmware updates.

The project uses a Raspberry Pi Pico instead of an Arduino Nano because it has more RAM and flash memory, which are needed for storing data and running complex algorithms.

I worked on the development of this project alongside with my friend Manuel. He made the 3D model design of the enclosure and all its printable components. Plese use the following link DIY Dehumidifier for 3D Printer Filaments to get the step and the 3mf files.

alt text

alt text

Assembly Video

As the equipment has many parts, an assembly manual in this instance of the project becomes slow to produce, so we decided from Fusion 360 to generate a video where, in addition to seeing the dehumidifier explode, the assembly steps, screws and magnets are shown.

All the magnets are placed under pressure (the holes have almost no play) and they must also be glued with cyanoacrylate so that the temperature does not loosen them.

The cap handle and optical sensor bracket screws are parkers, the rest are M2x5 or M3x10/12.

assembly_video_9m.mp4

Temperature control

The temperature control module is based on the QuickPID library which has an advanced anti-windup mode which prevents deep saturation and reduces overshoot.

The task of calculating the PID constants is based on the same author's sTune library which uses an open-loop PID auto-tuner using a novel s-curve kneepoint test method.

Measurement of the humidity and temperature of the box

The equipment uses the SHT21 sensor from Sensirion to measure the humidity and temperature of the box. This sensor can be purchased as a mounted module from Adafruit or other suppliers. To read the data from the sensor, the HTU21D library is used through the I2C port.

alt text

Thermistors for Over Temperature Protection

The heaters can reach very high temperatures that can damage the system or cause a fire. As the box is printed in Petg a protection system was implemented that turns off the heaters when a temperature above a 80 degrees is detected. The system uses two thermistors of 100 KHOM at 25ºC and a B of 3950K ±1% to measure the temperature of each heater. Thermistors are resistive sensors that vary their value according to temperature. However, due to the deviation of the associated hardware (4k7 resistance and reference voltage of the analog-digital converter), it is necessary to calibrate the thermistors to improve their accuracy. The calibration is done using as reference the temperature of the SHT21 sensor that measures the temperature of the thermal box and has an accuracy of 0.5%. The calibration consists of calculating a factor that is applied to the thermistor library readings to correct their value. This factor is stored in the Arduino’s EEPROM memory for use in future measurements. The calibration can be done from the Calib menu on the LCD when temperatures are stabilized.

alt text

Since there is no Arduino module for the thermistors, the divider resistor and filter capacitor are installed on the berry pico board as shown in the picture.

alt text

Note: For now the thermistor library does not include the pull request that adds compatibility with arduinopico, so use this link to download the modified one.

User Interfase

The user interface is based on a 0.96-inch OLED screen that displays text and uses the Adafruit_SSD1306 library through an I2C interface.

alt text

For user input, we use a rotary encoder and the EncoderButton library, which depends on the Encoder Library and the EncoderLibrary Bounce2 libraries.

alt text

Note: For now the Encoder library does not include the pull request that adds compatibility with arduinopico, so use this link to download the modified one.

Heater

To heat the box, two 3D printer beds are used as heating elements.

alt text

And two 15A mofsets that regulate the power with PWM channels.

alt text

To homogenize the environment of the box, a 4010 fan cooler is used that for now turns on at 100%.

alt text

Moisture Ventilation

So that the moisture from the filament that evaporates when heating the box goes outside, a ventilation valve is incorporated that is activated by an Servo SG92.

alt text

To control it, the internal Servo library of the arduinopico porting is used, which is based on the PIO of the Rasperry Pi Pico RP2040.

  • The valve is made up of three parts: a rectangular hole in the box cover with a 45-degree chamfer to increase the contact surface, the valve that has a 0.2 mm offset, and a post that, in addition to being the stop, supports the magnet that brings the door to the closed position. To fasten it, two M2 * 5 screws are used.

alt text

alt text

  • When the servo arm moves down and stops pushing on the valve, the magnets attract each other and create a force of approximately 300 grams to close the vent.

alt text

  • To open the valve, the servo moves the arm approximately 45 degrees, it should be noted that the servo makes the most effort at the beginning, and the plastic gear version can make a torque of 1.5 kg per centimeter.

alt text

  • The servo arm is a combined part between 3D printing and injection that is sold with the kit. This is because in addition to the fact that the shaft rack is difficult to print, heat easily warps common printed plastics.

alt text

Door lid sensor

The door lid sensor is a mechanical switch with an anti-bounce circuit that detects if the lid of the heater is open or closed. The switch is connected to GP22 of the digital pins of the Arduino board and reads either HIGH or LOW depending on the state of the lid.

alt_text

If the lid is open, the Arduino displays a message on the LCD screen saying “Open Lid” and turns off the heater by setting the output pin of the mofset to LOW. This prevents overheating and potential fire hazards.

If the lid is closed, the Arduino waits for a signal from the operator or the start system that detects the reel’s rotation to resume operation and control the heater using a PID algorithm based on the readings from the temperature and humidity sensor.

alt_text

Install the arm on the servo

alt text

  • Once the electronics of the equipment have been assembled and the firmware downloaded, connect it to the USB and select turn off the equipment in the menu so that the servo turns to the closed position.

alt text

  • Insert the lever that comes with the servo kit more or less at 95° with respect to the vertical of the drawer as shown in the figure.

alt text

  • Insert the PETG printed lever and use the long screw that comes with the kit to attach the parts to the servo shaft.

alt text

  • Go to the menu and turn on the equipment.

alt text

  • The arm should go up as the image shows.

alt text

  • To adjust the positions use the menu (close/open) to modify the opening and closing angles, pay special attention that in the open position the valve has play and does not touch the magnet post, and in the close position it does not touch the valve so the servo doesn't jam hard and get hot.

alt text

Odometer

One of the axes where the filament spool rests has a 6-position encoder so that an optical Sensor TCRT5000 Infrared Reflection detects its movement.

alt text

alt text

One of the functions is to turn on the equipment when it detects that the reel has started to rotate and also to turn off the equipment when it no longer rotates in a certain time.

It also counts the number of turns that the spool has given since the last reset, transforming the pulses into turns by setting the diameter of the spool.

Spool rollers

The rollers where the spool rests are made up of two parts: a threaded bar M8 * 95mm that gives resistance to deformation by temperature and an ABS cover that positions them. In order for the spool to rotate as smoothly as possible, the axis is supported by two 608 ZZ bearings.

alt text

The two ABS covers are different: the used for the optical encoder has three parts, two of a light color (silver or white) and one in black so that the contrast is as high as possible. The second cover is formed by two equal pieces and the color is indistinct.

alt text

The ABS covers are threaded so that they are taut when adjusted.

Odometer sensitivity adjustment

In order for the TTL output (D0) of the odometer sensor to change when the roller is moved (from white to black and vice versa), the comparator sensitivity must be adjusted with the potentiometer.

  • Use an allen key to unscrew the cap on the back of the box and insert a screwdriver until it contacts the potentiometer.

alt text

  • Turn the potentiometer until the sensor status indicator turns off.

alt text

  • Rotate the roller by hand until it turns back on, repeat this operation until you are sure the sensor detects transitions from white to black.

alt text

Go to the setup menu to verify that the turns counter (t) increases as the reel rotates.

alt text

Menu

The configuration menu maintains a simplified operation from the time when the Arduino Nano was used, which has little RAM and FLASH memory, this is not the case with the Berry.

When the device is in information mode, it displays three lines of data.

alt text

  • The first on the left shows the current temperature of the box and on the right the set one (0 = device off).
  • The second line shows the remaining operating time.
  • The third is the relative humidity of the box.

To enter the configuration menu you have to press the encoder.

alt text

Using the rotary encoder you can explore all the menu items, and when you need to modify a value, you have to press the encoder button, if it is editable the item is marked by inverting the colors.

alt text

Use the rotary encoder to modify the value of the element, which can be numeric or a list of options. When the rotary encoder button is pressed, in addition to saving the value in the eeprom memory, editing ends.

Menu List

  • Exit press the button to exit the menu.
  • Turn turns the temperature control on/off.
  • Temp select the temperature of the box, the range is from 40 to 60 ° Celcius. 0 = disabled.
  • Time select temperature control run time in hours, range is from 1 to 72 hours. 0 = disabled.
  • Tune On to allow the device to calculate the PID constants and save them to the eeprom. It is advisable to do it with a full spool and starting from room temperature.
  • Therm select the number of thermistors that sense the temperature of the heater to prevent it from melting the bed supports (80°Celsius). At least one is recommended.
    • cali calibrate the thermistors to improve their accuracy. It is important to calibrate them when temperatures are stabilized (12 hs OFF) to get better results.
  • Heat displays the temperature of the heating element. Use the thermistor that is hotter.
  • Odom activates the functions of turning on (Start) the heating element when the reel rotates, or turning off (Stop) when it has stopped for a while. (Both) activates both functions.
    • off time in minutes that it waits to turn off the heater when the spool stops spinning.
    • dia diameter in millimeters of the spool to convert pulses to turns.
    • t number of turns that the reel has given since the last reset of the counter. Move the encoder to the left to reset it.
  • Open position in degrees of the servo when the vent door is open. Typically 90 degrees.
  • Close position in degrees of the servo when the vent door is closed. Typically 43 degrees.
  • Kp proportional constant of the PID controller.
  • Ki integrative constant of the PID controller.
  • Kd derivative constant of the PID controller.
  • Frst On to restore all parameters to factory.
  • V firmware version.

Schematic

alt text

alt text

Assembly of electronics version one alt text

Assembly of electronics version two alt text

A Guide to PID and Auto Tune for Temperature Regulation

The auto tune is a process that adjusts the PID constants to optimize the performance of the equipment.

By default, the equipment has some PID constants that allow it to operate, but they are not optimal as they depend on several factors such as:

  • The power supply voltage
  • The resistance of the electrical wires
  • The impedance of the heater
  • The air flow that moves the fan

Therefore, it is necessary to run the auto tune menu at least once. To do it correctly, the following conditions must be met:

  • The equipment has not been used for a long time and both temperature sensors (box and heater) are equal to room temperature

  • A full filament spool is used because it modifies the air flow

When running the auto tune, it is expected that the system reaches a stable temperature without oscillations or overheating. Below is a graph with an un-tuned system. It can be seen that the it tends to rise very fast in temperature and exceed 80°C when removing box lid. On other hand, synchronized system maintains a more constant and controlled temperature.

alt text

Note: Off and Open in the graph refer to whether the user turned off the device or removed the lid of the box, respectively.

Power Supply

The main power supply is 12V 20A, which is responsible for powering the heaters, the fan, and through a swicthing step-down supplying the 5V to the Berry Pico, which in turn uses the internal 3.3V regulator to power the CPU and the rest of the electronics.

The 5V step-down is connected to the berry pico with a shotcky diode so that the board can be simultaneously connected to a PC's USB, for example, to get system response via a serial port.

alt text

Before installing the 5V supply, set the output voltage to 5.5V to compensate for diode drop.

The thermistors are connected to the ADC_REF so that the end of the positive resistive divider matches the reference of the analog-to-digital converter.

To connect the power supply to the equipment, it is recommended to use a 1.5 mm (16AWG) section cable to avoid falls, in this case we use a 70-thread speaker cable. The length should not exceed 2 meters.

If the output voltage can be adjusted, regulate it to 12.5V to compensate for the losses in the connection cable and in the power switch.

alt text

Power Switch and Connector

In order for the wiring to support the power consumed by the equipment, a KCD4 ROCKER SWITCH ON OFF DPST 4 PIN and a 4-pin GX Aviation Connector were chosen, to divide into two 10A maximum circuits (one for each heater).

alt text

Download the firmware in Raspberry Pi Pico

Hold down the BOOTSEL button while plugging the board into USB. The uf2 file filament_dryer_rp2040.ino.uf2 should then be copied to the USB mass storage device that appears. Once programming of the new firmware is complete the device will automatically reset and be ready for use.

alt text

System Response

The device can plot the system response over USB using the Arduino serial plotter.

The curves below show how humidity drops as time goes by and the temperature rises.

Reference

  • SetPoint selected temperature for the box (40 to 60° Celsius).
  • BoxTemp box temperature.
  • BoxHumidity relative humidity of the box.
  • PWM power of the heaters (0 to 100%).
  • BedMax maximum temperature that heater can reach (80° Celsius).
  • BedTemp heaters temperature.

60 degree graph alt text

55 degree graph alt text

50 degree graph alt text

45 degree graph alt text

40 degree graph alt text

3D Printed Parts

Most of the pieces that make up the equipment are manufactured by the FDM method of 3D printing. Because the equipment can reach 60° Celcius, the box is printed in petg that resists between 5 and 10 degrees more than PLA; and the rollers, having to support the weight of the filament spool, use ABS.

alt text

The lid that contains the vent valve and the bottle for the silica gel are printed in PLA and the fixing magnets are glued with cyanoacrylate to resist deformation due to the plastic's temperature.

The male pneumatic connector can be rotated 180 degrees so that the outlet is horizontal or vertical.

alt text

Click on the link to have a 3D view of the equipment model developed by Manuel Vela.

Bill of Materials

The following is a complete list of materials including 3D printed parts, electronic components, fasteners, and miscellaneous.

1
ImageDescriptionU/MQTY
2
Raspberry Pi Pico Rp2040PCS1
3
Si7021 I2c humidity and temperature sensorPCS1
4
Oled display 0.96 blue 128x64 I2c Sh1106 Gm009605v4PCS1
5
Power supply step-down DC-DC 1.5 A 26v 3a Mp1584 regulatorPCS1
6
Axial fan cooler 40 x 40 mm 12VPCS1
7
Rotative encoder KY-040PCS1
8
NTC 100K B3950 ThermistorsPCS2
9
Heat bed Mk2b 12v/24v for 3d printerPCS2
10
Quick connect term female FDD1.25-250 0.250" (6.35mm) 16-22 AWG with capPCS4
11
PWM Mosfet Modul 5-36v 15a 400WPCS3
12
Infrared sensor Tcrt5000PCS1
13
Mini Servo Tower Pro Sg90 9gPCS1
14
KCD4 heavy duty switch 15a 250vPCS1
15
GX16 Aviation Butt-Joint Straight Connector Metal ShellPCS1
16
Interlock switch PP4003 with fusePCS1
17
Dupont 2.54 mm female metalic connectorPCS8
18
Dupont 2.54 mm female plastic connector 4 waysPCS2
19
Flat cable 4 Conductors AwgMTS0,6
20
16GA speaker wireMTS2
21
Bearing 608zzPCS4
22
Neumatic joint for hotend M10 (reference: Creality Ender 3)PCS1
23
Neodymium magnet D5xH3 mmPCS28
24
DIN 912 Allen screw M2 x 0,4 x 5 mmPCS16
25
DIN 912 Allen screw M3 x 0,5 x 10 mmPCS2
26
DIN 912 Allen screw M3 x 0,5 x 12 mmPCS5
27
DIN 912 Allen screw M3 x 0,5 x 20 mmPCS5
28
M3 x 0,5 mm Square nutPCS7
29
Parker self tapping screw #4 D2,9 mm x L3/8"PCS12
30
Threaded rod M8 x 1,25 mm, lenght 95 mmPCS2
31
dry_box_baseBottom_v1.2PCS1
32
bearing_top_cover_v1.0PCS4
33
optic_support_v1.0PCS1
34
racord_base_v1.2PCS1
35
special_screw_v1PCS1
36
handle_base_v1.1PCS1
37
handle_v1.1PCS1
38
dry_box_baseTop_v1.2PCS1
39
dry_box_top_v1.2PCS1
40
magnet_gate_base_v1.0PCS1
41
arm_servoPCS1
42
dry_box_gate_v2.0PCS1
43
electronics_case_mb_cover_v1.5PCS1
44
electronics_case_mb_bottom_v1.2PCS1
45
stepdown_support_v1.2PCS1
46
LCD-knob_v2 v2PCS1
47
axis_cover_shortPCS1
48
axis_cover_jointPCS1
49
axis_cover_longPCS1
50
axis_cover_nutPCS2

About

Heats and dries wet filaments to improve print quality and longevity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published