Compatible with PlatformIO and Arduino IDE
Simulation with stepper motor puller
Bottle-to-filament machines are what I call the likes of Petamentor and The Recreator 3D. These machines use hacked PID controllers and PWM motor controllers or 3D printer parts running Marlin. If pultrusion is going to grow, it should be controlled from one board without having to use an entire Marlin interface.
Introducing the PETInator, a full firmware with PID temperature control, stepper or DC motor control, and a lot of room for growth. Follow the wiring in the demo or using the pinout inside configuration.h. Most changes should be made inside configuration.h, including default stepper speed, default temperature, and pinout.
Here are a few pictures of what I'm using. It's a jumbled mess of noncommital wiring, but that's because once I'm satisfied with its pulling force, I intend to make the smallest pullstruder you've ever seen. Please forgive the poor photo quality. When I'm happy with the puller V1, I'll take better photos.
- Stepper-driven and PWM-motor-driven puller options
- Uncluttered interface (with room for improvement...)
- PID temperature control (with Marlin-like settings, including Thermistor ID)
- Start pulling when temperature reached
- Auto-pause puller when temperature gets too low
This project features a Wokwi simulation! To use it, open this project in VS Code and install the Wokwi extension. Then, hit Ctrl+p
and type Wokwi: Start Simulator
and run it. The first time, it will prompt you to get a license key.
Or try the online simulator (almost always up to date): Simulation with stepper motor puller
- Hotend like this
- Heatblock (I like the volcano)
- Nozzles (get the cheap ones)
- Silicon Sock or another kit
- Heater (12v or 24v, just match your power supply)
- Thermistor
- Stepper motor - If you can, just upgrade your extruder and steal its stepper. I love the SuperFly remix and this stepper
OR - DC Gear Motor
- Stepper Driver, like the A4988. Solder a 47uf or more capacitor across
VMOT
andGND
. Bigger is fine.
OR - PWM motor driver
- Arduino Nano or Uno
- A Mosfet (solder a 200 ohm or so resistor across R5)
- 1602 LCD with I2C
- 3 buttons - or the bougie choice. Wire it like the bottom picture for an always-on LED.
- Power supply - close to 60 watts at 12v or 100 watts 24v. Thrift stores are a good bet.
- Power switch - For a wired power supply or a plug-in power supply
- Power plug or pre-wired if using a plug-in supply
- Various wires. Salvage from a USB cable if you need. Power wires can be salvaged from the hotend. You don't need more than they provide.
- 90 degree corner bracket. Mine is IKEA!
- A 200 ohm or so resistor for the Mosfet. Go a little higher if needed.
- 47uf or more capacitor for the stepper driver. Bigger is fine.
The most helpful visual is probably this simulation on Wokwi: Simulation with stepper motor. Although this uses a stepper motor, you can also use a PWM driven DC motor with the driver connected to the step pin. Just comment out USES_STEPPER
in configuration.h
and set DEFAULT_SPEED
as appropriate.
- Clone this code into your Arduino directory:
git clone https://github.com/aamott/petinator.git
- Open in the Arduino IDE.
- Install these libraries:
- LiquidCrystal I2C
- AutoPID
- ThermistorLibrary
- LiquidMenu
- LiquidCrystal
- ezButton
- FastAccelStepper
- Edit
configuration.h
according to your needs. If you're using the same layout as in Wokwi, including a non-I2C display, just copy the configuration from there. - Wire it up, either by the pinouts listed in
configuration.h
or matching Wokwi. - Upload the code to your Arduino (or ESP32).
- Test and tune the PID values and motor speed as needed and reupload.
Check the Issues tab and look for issues marked with "good first issue".
When making changes, the try to do the following:
- Maintain the default Arduino code formatting. If you need to, open the arduino editor and use the auto-format option (Ctrl+T) before committing your changes.
- Leave comments. The best comment is clear code, but comments are the Rosetta Stone to a budding coder. Essential in configuration files.
- Be somewhat granular in your commits. This is a good practice in general. It makes it easy to back out small changes without losing a lot of work.
- Upload any photos you find on the discussion tab.