Code Monkey home page Code Monkey logo

marlin-mackerel's Introduction

========================== Mackerel - Firmware for Lyman Extruder Controller

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

Quick Information

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.

This firmware is based on Marlin 3D Printer Firmware but also has many original parts.

Marlins eat Mackerels and 3D printers consume filament.

Features:

  • 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.

Limitations and Possible Improvements

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.

Implemented G Codes:

  • None

M Codes

  • M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C)

Configuring and compilation:

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

Running the Lyman Extruder

See http://www.thingiverse.com/thing:265375 for the extruder build and operation.

  1. Turn on the heater โ€“ select Preheat ABS from the Main Menu.
  2. Wait until temp hits setpoint (185 deg). Beeper will go. Can press knob to shut off.
  3. Turn on the motors โ€“ select Resume Extruder from the Main Menu.
  4. 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.
  5. Switch to Extruder Auto Con from the Main Menu to go to automatic control of the puller motor.
  6. Can Clear Statistics on the Main Menu to start collecting data now that filament is under control.
  7. Select Pause Extruder on the Main Menu when finished with run.
  8. Select Cooldown on the Main Menu to shut off heater.

marlin-mackerel's People

Contributors

cftechno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marlin-mackerel's Issues

Option to use a stepper motor as Winder

I am building my own filament extruder and I would like to use Mackrel as firmware. In my defign I would like to use a stepper motor to drive spool winder.

  • NEMA 17 motors are more easily accessible and people usually have them on hand.
  • In the future this opens a path to controll the spool more precisely in relation to the puller and wind filament neatly turn by turn.

I would like to also keep the option to use 12V DC motor as winder. To do this there would be something like USE_WINDER_STEPPER directive in the config file. The directive would switch between logic that drives the D8 pin and logic that drives the stepper winder, lets call it W_AXIS.

The idea is to repurpose X axis of the printer board as a winder W axis if USE_WINDER_STEPPER is defined. The extruder does not use the X,Y,Z axes anyway.

To make the stepper work we need to re-enable the X stepper logic. Specific issue with X,Y,Z axes is they have software endstops. We need to disable those if USE_WINDER_STEPPER is defined.

Logic of resuming and stopping the extrusion needs to be changed to not enable winder using winderSpeed variable. Feedrate settings can remain unchaned, the logic of planing moves will handle Winder RPM setting as is. Other than that minor changes to the menu is needed to include winder in Move axes menu.

Extruder motor not starting

Hi,

I have the following issue :
It beeps when reaching min temperature, fan is starting and puller motor starts but motor extruder doesn't. I switched the motors and the pins e0 with e1 to check if any issues with the driver on the ramps=> none.
I use 3 jumpers on E0 instead of a switch and it shows E RPM Off when reaching temperature. Any suggestions ? Thank you ๐Ÿ—ก๏ธ

I also get this when upload Mackerel ๐Ÿ’ฏ

In file included from sketch\Mackerel.h:23:0,
from sketch\thermistortables.h:4,
from sketch\Configuration.h:847,
from C:\Users\control\Desktop\Firmaware\Mackerel\Mackerel.ino:33:
sketch\pins.h:499:0: warning: "X_MAX_PIN" redefined
#define X_MAX_PIN -1 //FMM remove definition for limit pins to speed the stepper interrupt.

sketch\pins.h:445:0: note: this is the location of the previous definition
#define X_MAX_PIN 2

sketch\pins.h:500:0: warning: "Y_MAX_PIN" redefined
#define Y_MAX_PIN -1

sketch\pins.h:451:0: note: this is the location of the previous definition
#define Y_MAX_PIN 15

sketch\pins.h:501:0: warning: "Z_MAX_PIN" redefined
#define Z_MAX_PIN -1

sketch\pins.h:457:0: note: this is the location of the previous definition
#define Z_MAX_PIN 19

sketch\pins.h:502:0: warning: "X_MIN_PIN" redefined
#define X_MIN_PIN -1

sketch\pins.h:444:0: note: this is the location of the previous definition
#define X_MIN_PIN 3

sketch\pins.h:503:0: warning: "Y_MIN_PIN" redefined
#define Y_MIN_PIN -1

sketch\pins.h:450:0: note: this is the location of the previous definition
#define Y_MIN_PIN 14

sketch\pins.h:504:0: warning: "Z_MIN_PIN" redefined
#define Z_MIN_PIN -1

sketch\pins.h:456:0: note: this is the location of the previous definition
#define Z_MIN_PIN 18

report max min filament width

I wrote a comment on thingiverse to include max and min filament width in the display. Alternating those two values with average on the display. And clearing it when "clear statistics" is selected.

I can't make 1.75mm filament

Hi,

In the actual firmware the desired diameter goes from 1.70 to 1.80 directly. Anyone knows what do I need to change for being able to set 1.75mm diameter?

Thank you!

Adapt firmware

Hi Filipmu!

I bought a machine to make filament but it is not performing as good as I would like, so I decided I will add a filament sensor and connect it, through ramps 1.4, to the puller, displaying all necessary information in a 2004 LCD (RPM of the puller motor - measured diameter of filament in mm - filament feed rate at puller in mm/sec - lenght of filament produced in mm - average measured filament diameter - minimum measured filament diameter - maximum measured filament diameter).

For what I am seeing, it is contemplated in the firmware, but I want it to be an isolated system, that only controls the puller speed due to the real time readings of filament diameter, because the other parts of the machine run ok and I don't want to change them because I don't have the current firmware. The seller is not answering my mails and isn't giving me support as he promised.

Can you help me a bit telling me what do I have to modify to achieve this? I am really frustrated with the machine I have and I think this is the solution.

I would appretiate it a lot.

Thank you and greetings from Argentina!

Santiago Serrano.

Extruder speed

Might it be an idea to have an option to set extruder speed before first having to select "resume extruder" and then "Tune" ? Specially when directly at start the extruder will stall. When a stall happens I rather first select "pause extruder" and then change the speed then letting the stall continue and select "tune" and changing the extruder speed.

Temp setting

When you want to change the temperature before starting the preheat procedure the default value is 0 and not the predefined value.

error uploading

Hi, i downloaded the files but when i try to upload it i get a error
and it stops uploading could you help fix it??

regards Danny Geurts

Arduino: 1.6.13 (Windows 10), Board:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from sketch\Mackerel.h:23:0,

             from sketch\thermistortables.h:4,

             from sketch\Configuration.h:847,

             from D:\Downloads\Marlin-Mackerel-master\Marlin-Mackerel-master\Mackerel\Mackerel.ino:33:

sketch\pins.h:499:0: warning: "X_MAX_PIN" redefined

   #define X_MAX_PIN -1 //FMM remove definition for limit pins to speed the stepper interrupt.

^

sketch\pins.h:445:0: note: this is the location of the previous definition

 #define X_MAX_PIN           2

^

sketch\pins.h:500:0: warning: "Y_MAX_PIN" redefined

#define Y_MAX_PIN -1

^

sketch\pins.h:451:0: note: this is the location of the previous definition

 #define Y_MAX_PIN          15

^

sketch\pins.h:501:0: warning: "Z_MAX_PIN" redefined

   #define Z_MAX_PIN -1

^

sketch\pins.h:457:0: note: this is the location of the previous definition

 #define Z_MAX_PIN          19

^

sketch\pins.h:502:0: warning: "X_MIN_PIN" redefined

   #define X_MIN_PIN -1

^

sketch\pins.h:444:0: note: this is the location of the previous definition

 #define X_MIN_PIN           3

^

sketch\pins.h:503:0: warning: "Y_MIN_PIN" redefined

   #define Y_MIN_PIN -1

^

sketch\pins.h:450:0: note: this is the location of the previous definition

 #define Y_MIN_PIN          14

^

sketch\pins.h:504:0: warning: "Z_MIN_PIN" redefined

   #define Z_MIN_PIN -1

^

sketch\pins.h:456:0: note: this is the location of the previous definition

 #define Z_MIN_PIN          18

^

In file included from sketch\Mackerel.h:23:0,

             from sketch\Mackerel_main.cpp:36:

sketch\pins.h:499:0: warning: "X_MAX_PIN" redefined

   #define X_MAX_PIN -1 //FMM remove definition for limit pins to speed the stepper interrupt.

^

sketch\pins.h:445:0: note: this is the location of the previous definition

 #define X_MAX_PIN           2

^

sketch\pins.h:500:0: warning: "Y_MAX_PIN" redefined

#define Y_MAX_PIN -1

^

sketch\pins.h:451:0: note: this is the location of the previous definition

 #define Y_MAX_PIN          15

^

sketch\pins.h:501:0: warning: "Z_MAX_PIN" redefined

   #define Z_MAX_PIN -1

^

sketch\pins.h:457:0: note: this is the location of the previous definition

 #define Z_MAX_PIN          19

^

sketch\pins.h:502:0: warning: "X_MIN_PIN" redefined

   #define X_MIN_PIN -1

^

sketch\pins.h:444:0: note: this is the location of the previous definition

 #define X_MIN_PIN           3

^

sketch\pins.h:503:0: warning: "Y_MIN_PIN" redefined

   #define Y_MIN_PIN -1

^

sketch\pins.h:450:0: note: this is the location of the previous definition

 #define Y_MIN_PIN          14

^

sketch\pins.h:504:0: warning: "Z_MIN_PIN" redefined

   #define Z_MIN_PIN -1

^

sketch\pins.h:456:0: note: this is the location of the previous definition

 #define Z_MIN_PIN          18

^

sketch\Mackerel_main.cpp:2408:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

     LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");

                                ^

In file included from sketch\SdFile.h:27:0,

             from sketch\cardreader.h:8,

             from sketch\Mackerel_main.cpp:50:

SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'

struct fpos_t {

    ^

In file included from sketch\Mackerel.h:10:0,

             from sketch\Mackerel_main.cpp:36:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:950:33: note: 'fpos_t' has a previous declaration here

extension typedef long long fpos_t;

                             ^

exit status 1
using typedef-name 'fpos_t' after 'struct'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Report filament width output to the serial

Might it be an idea to echo the filament width measurements with a time stamp and/or length info to the serial port so that a full audit of the filament run can be done after the extruding has been finished?

Beeper half-on at startup when nothing connected

To test new hardware, I connected the MEGA, RAMPS and LCD up and uploaded the firmware. Just after the splash screen, the beeper started a sickly screech. I think this is supposed to be the alarm for the min temperature in order to detect an bad thermistor. The problem is that the beeper is only half on because at this point, the BEEPER has not been set to output. Maybe it is set to INPUT_PULLUP which partially turns on the BEEPER?

Add this to the end of setup()

#if BEEPER > 0
SET_OUTPUT(BEEPER);
#endif

and the beeper will clearly sing out its displeasure at having no thermistor attached.

How can I change extruder stepper motor with a DC motor?

Hi,

I'm trying to swap the extruder stepper motor with a DC motor, as I got a geared one that should work well enough. My idea is to swap the winder motor with the stepper using the firmware, but I don't know which parts of the firmware I should change.

I have checked in the code and it seems I only need to change some stuff between the lines 722-877 on the Mackerel.h file. Is there anything else that I need to be aware of?

Theres a open source sensor by INFIDEL which i would like to implement due to its ease to make a manufacture.

can you please provide some help to implement that sensor in your firmware?
Is you sensor used in a closed loop control or is it just for monitoring the diameter?
link to the sensor im talking about : https://www.youmagine.com/designs/filament-diameter-sensor
link to the firmware for the sensor: https://github.com/drspangle/infidel-sensor
InFiDEL - Inline Filament Diameter Estimator (lowcost)
this sensor outputs data via i2c

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.