Skip to content

aamott/petinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PETInator

ko-fi

Firmware for bottle-to-filament machines

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.

Example setup

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.

Alt text

Alt text

Alt text

Features

  • 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

Wokwi

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 Simulatorand 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

Example Setup Parts

Definitely Salvageable

Instructions

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.

  1. Clone this code into your Arduino directory: git clone https://github.com/aamott/petinator.git
  2. Open in the Arduino IDE.
  3. Install these libraries:
    • LiquidCrystal I2C
    • AutoPID
    • ThermistorLibrary
    • LiquidMenu
    • LiquidCrystal
    • ezButton
    • FastAccelStepper
  4. 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.
  5. Wire it up, either by the pinouts listed in configuration.h or matching Wokwi.
  6. Upload the code to your Arduino (or ESP32).
  7. Test and tune the PID values and motor speed as needed and reupload.

How to Contribute

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.