This software has a GPL license. Please do not use this code in products (3D printers, CNC etc) that are closed source or are crippled by a patent. https://gnu.org/licenses/gpl.html
This firmware was designed in conjunction with Hugh Lyman to control a Lyman filament extruder with geared stepper motors. It is currently designed to support the RAMPS 1.4 with Smart LCD 2004 and depends on a prototype filament width sensor. It replaces much of the control electronics in the current design with one controller. It can control the extruder motor, puller motor, Extruder heater (PID) with thermistor, winder motor, filament cooling fan and has input for a filament width sensor. The processes and menus have been adapted to control a filament extruder. This code is currently in design, development, and testing and so might not be ready for casual users.
- Blob sensor - an option for an additional filament width sensor input allows for PID control of extruder speed based on measuring the 'blob'. Where 'blob' is the molten filament that is immediately extruded out of the barrel of the extruder.
- PID loops for puller and blob have been tuned a bit more, with a slower sampling time and puller loop using a spatial based sampling. Also the filament diameter input is converted to better units for control. They are squared to reflect the cross-sectional area and for the puller, the inverse is used.
- Optional IOT connectivity - Serial output of JSON that can be used to create MQTT messages. Requires an ESP32 board and this project: https://github.com/filipmu/ESP32_Serial_to_AWS_IOT
- UI allows more fine grained control of filament width setting, PID settings.
- Config has new PID parameters
- Uses the usual 115200 baud (can be configured)
This firmware is based on Marlin 3D Printer Firmware but also has many original parts.
Marlins eat Mackerels and 3D printers consume filament.
- Allows complete control of a Lyman Filament Extruder via LCD menus.
- Controls an extruder screw motor (geared stepper motor) so that it runs at a fixed RPM that can be set with the LCD.
- Controls a Puller motors (geared stepper motor) calibrated in mm/sec. Can also be quickly adjusted with the LCD.
- Accurate temperature control of extruder barrel (Uses Marlin temperature PID control and allows for auto-tuning)
- With the filament diameter sensor, accurate filament diameter control.
- Displays statistics (average, min, max) of filament diameter.
- Displays length of filament extruded.
- Allows selection of different thermistors (like Marlin)
- Can connect with Pronterface or Repetier Host to view the extruder temperature trending curves.
- Smooth motion control of extruder and puller geared stepper motors (Uses the Marlin motion control)
- Has an input for mechanical switch to allow quick control of the extruder motor.
- Parameters saved in EEPROM (like Marlin).
- Ability to control speed of the brushed DC winder motor.
- ON/OFF control of the filament cooling fan.
The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
G-code and M-code control of the firmware is limited to M303 Autotune. More work is needed to make the codes relevant to a Lyman filament extruder.
This sofware only supports the RAMPS 1.4 and SMART LCD 2004. More work is needed to make it compatible with other hardware. Much of the Marlin code that handled board selection is still there, but needs to be updated.
Software requires a filament diameter sensor: http://www.thingiverse.com/thing:89044 . Work is needed to make the software flexible to run without this feature.
Motor speed control is handled by generating a sequence of position instructions in the code. It would be better to control the speed of the motors directly. This would require changing the guts of the step pulsing routine. I wanted to keep that intact.
Filament control is with a PID loop, but there is dead time in between where the filament is extruded and where it is measured. A Smith Predictor would be a better way to control it. The firmware has untested Smith Predictor code but I commented it out since it seemed more complicated to tune (more parameters in additon to PID) and may not be as robust.
Only uses 2 stepper outputs, so there is room for leveraging the other 3 outputs to control other steppers.
Add means to save run statistics in the SD card. Could capture system data at regular intervals for analysis later.
- None
- M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C)
Install the arduino software IDE/toolset v1.x.x http://www.arduino.cc/en/Main/Software
Download the firmware https://github.com/filipmu/Marlin-Mackerel Use the "Download Zip" button on the right.
Start the arduino IDE.
Select Tools -> Board -> Arduino Mega 2560
Select the correct serial port in Tools ->Serial Port
Open Marlin.pde
Click the Verify/Compile button
Click the Upload button If all goes well the firmware is uploading
See http://www.thingiverse.com/thing:265375 for the extruder build and operation.
- Turn on the heater – select Preheat ABS from the Main Menu.
- Wait until temp hits setpoint (185 deg). Beeper will go. Can press knob to shut off.
- Turn on the motors – select Resume Extruder from the Main Menu.
- Adjust the Puller motor speed via the knob to achieve close to the filament diameter desired (2.8mm). Can use the Tune menu or Control menu to make adjustments to motor speeds, etc.
- Switch to Extruder Auto Con from the Main Menu to go to automatic control of the puller motor.
- Can Clear Statistics on the Main Menu to start collecting data now that filament is under control.
- Select Pause Extruder on the Main Menu when finished with run.
- Select Cooldown on the Main Menu to shut off heater.