Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Prusa MMU 2.0 support #11859

Closed
revilor opened this issue Sep 17, 2018 · 302 comments

Comments

Projects
None yet
@revilor
Copy link
Contributor

commented Sep 17, 2018

I will try to add support for the Prusa MMU 2.0 to Marlin as soon as I have a unit at hand. So just to avoid reinventing the wheel: is anybody already working on MMU 2.0 integration?

@brandstaetter

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2018

I guess Prusa will publish their sources, so we probably we should wait for that?

@rmoravcik

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2018

Prusa already released source code of their firmware with MMU support.
https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/mmu.cpp

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 18, 2018

I walked through the Prusa sources already. Nothing too complex, but we'll have to generalize, implement the serial communication based on the HAL, etc. to make the MMU usable with as many printers as possible.

@thinkyhead thinkyhead changed the title Question: Anybody working on Prusa MMU 2.0 support? [FR] Prusa MMU 2.0 support Sep 19, 2018

@FNeo31

This comment has been minimized.

Copy link

commented Sep 20, 2018

So I didn't buy an MMU from Prusa I made one myself. My trouble right now os just the communication. Like I try to explain below.

The system is simple and just need messages system by Serial to work independently. Just an add-in system.

Objective:

Connect One Multi-Material unit to a printer with communication by Serial on pins Rx2Tx2 (MEGA + RAMPS 1.4 configuration)

What's needed:

Make a Clone of all movements of extruder E0 to other motor (E1) same way that we can make with the Axis like Z and Z2.

Instead of Make some tool change, pick the T number and send it by Serial on format "T1." or "T2." or "T3." , Etc. To change the tool on multi material unit.

just continue the print after receive "OK." for example.

I know, this isn't a trouble is an improve to new generations of printers with a lot of material with just one extruder noozle and with direct drive extruding with just one motor on head.

Can you help me?

If you are available to help me I'll post here all the hardware and the code of Multi Material Unit after test and check that os works well.

This was what I posted on #11879

@thinkyhead

This comment has been minimized.

Copy link
Member

commented Sep 20, 2018

It shouldn't be too tricky to implement, except that right now we don't support a second serial connection in the AVR version of Marlin. So that would need to be added in.

Does it really need multiple extruders to be defined in Marlin and multiple sets of stepper signal pins? It was my understanding that a single E0 extruder is all that's needed from the Marlin side, and the steppers on the MMU are controlled by its onboard MCU.

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2018

@FNeo31 is your MMU based on the PCB and firmware published by Prusa? I'm building one myself, waiting for the PCB at the moment.

From my understanding there is no replication of extruder movements to the MMU. The MMU loads the filament into the extruder and then moves out of the way. The extruder will then pull the filament just through the MMU box. Otherwise you would have to take care for some slack in the filament path should extruder and MMU get out of sync (like the Mosaic Palette+ does).

@thinkyhead

This comment has been minimized.

Copy link
Member

commented Sep 20, 2018

Just peeked at the MALYAN_LCD which uses Serial1, and evidently we can do that on AVR very easily. So strike my previous comment about serial.

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2018

It shouldn't be too tricky to implement, except that right now we don't support a second serial connection in the AVR version of Marlin. So that would need to be added in.

Does it really need multiple extruders to be defined in Marlin and multiple sets of stepper signal pins? It was my understanding that a single E0 extruder is all that's needed from the Marlin side, and the steppers on the MMU are controlled by its onboard MCU.

That's also my understanding, yes.

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2018

Just peeked at the MALYAN_LCD which uses Serial1, and evidently we can do that on AVR very easily. So strike my previous comment about serial.

I already created PR #11880 to enable additional uarts. But I'll have a look at the MALYAN_LCD.

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2018

Just peeked at the MALYAN_LCD which uses Serial1, and evidently we can do that on AVR very easily. So strike my previous comment about serial.

I already created PR #11880 to enable additional uarts. But I'll have a look at the MALYAN_LCD.

Ok, MALYAN_LCD uses Arduino Serial1 directly. But to provide MMU support also for boards other than AVR some abstraction in the HAL will be required, I guess.

@thinkyhead

This comment has been minimized.

Copy link
Member

commented Sep 20, 2018

The HALs all provide some kind of emulation of the Arduino Serial# ports, so things like MALYAN_LCD ought to work with any MCU.

@radsonpatrick

This comment has been minimized.

Copy link

commented Sep 27, 2018

Hello, how are you ?, I'm trying to develop the adaptation for marlin I believe that the most complex part will be interpreting the gcode sent by the serial to select the filament and its respective size

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 27, 2018

@radsonpatrick My MMU build is still missing the control board, so for the moment I'm using one Arduino Mega2560 + RAMPS for Marlin and another Mega2560 emulating the MMU 2 unit. This way I can implement the serial communication without an actual MMU. I have the initial setup routine (requesting version, buildnr and FINDA status from the MMU) working with my emulator. Next step will be to implement the filament load/unload commands. If you are interested I can push the current state to my github repository.

There is no gcode send to or from the MMU by the way. The printer firmware sends simple commands like "Unload filament", "Switch to filament x", "Load filament" to the MMU which answers "ok" when the command has been executed.

@Lyr3x

This comment has been minimized.

Copy link

commented Sep 27, 2018

Do you already have som documentation how you build everything? Or is it just a RAMPS +
spare Mega2560 for now?
It would be nice if you can push everything to a repository that we can have a look. I am more then willing to support 👍

@radsonpatrick

This comment has been minimized.

Copy link

commented Sep 27, 2018

I want to understand, so he does not cut filaments in size? than a cutting blade would be serious for that, but that's more sense, would not it just interpret the M600 code?

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 27, 2018

The spare Mega2560 is emulating the MMU until I have a working MMU2 unit. Connecting the real MMU2 to the printer board is quite straightforward.

But first a short disclaimer: the following info is without guarantee, it's based on the assembly guide and the schematics for the control board published on Prusa's github repository. So if you kill your MMU2 by connecting it to any printer other than the Prusa Mk3, don't blame me for that.

Ok, so to hook up the MMU to a RAMPS board you can follow https://manual.prusa3d.com/Guide/3.+Electronics+and+MMU2+unit+assembly/757?lang=en down to Step 40.

The power cable (green) will go to your power supply. Prusa uses 24V on the Mk3, but 12V should be fine for the MMU steppers, too.

The signal cable (pink) has the following connections

  • +5V - blue wire
  • RX - white wire
  • TX - green wire
  • RESET - brown wire

So on the RAMPS board you will connect

  • the blue wire to a free 5V pin,
  • RESET to a free digital pin,
  • RX (white) to pin 16 (TX2)
  • TX (green) to pin 17 (RX2)

If you have an LCD connected to AUX-4, pins 16 and 17 could be an issue, depending on the display at use. But UART0 is USB, and the pins of UART1 and UART3 are used for endstops, so UART2 is the only remaining serial to communicate with the MMU2.

SoftwareSerial might be an option in case pins 16 and 17 are used for the display, or for printer boards which have no serial connection at all.

@radsonpatrick

This comment has been minimized.

Copy link

commented Sep 28, 2018

I'm not using the prusa, I'm using marlin 1.1.9, so it will not be useful to me, I watched some videos and I understood the operation, so your already in what stage? charging the filament? communication with the main arduino?,I want to be a DIY

@FNeo31

This comment has been minimized.

Copy link

commented Sep 28, 2018

I'm working in a MMU system made by me to the tool seletor on MMU and positioning I'm using a 28YBJ-48 stepper with a ULN 2003 drivers to be more compact. For the MMU board I'm using one Arduino nano with ATmega 328.

I'll Change the pin -Y to the position of X+ top put the end stop of Y and conect the serial2 of mega+ramps1.4 to the nano.

The extruder motor I will clone to feed motor on MMU. Direct controlled by main board. Instead of blade I Will put a gate stop.

PS I don't have a PRUSA too

@radsonpatrick

This comment has been minimized.

Copy link

commented Sep 28, 2018

If you need help with something I am at your disposal. Do you have photos of the project? will you use the same desing as mmu2.0?

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Sep 28, 2018

@FNeo31 @radsonpatrick I'm building a Prusa MMU2 myself based on the sources published on Prusa's github repository. If everything works out - missing part is the controller board - I'll have an exact clone of the original Prusa MMU2.

Therefore what I'm implementing in Marlin is based on the firmware and communication protocol for Prusa's MMU2. If your self-designed MMU units behave in exactly the same manner they should work, too.

@radsonpatrick

This comment has been minimized.

Copy link

commented Sep 28, 2018

Is your documentation of the development of your project in github?

@radsonpatrick

This comment has been minimized.

Copy link

commented Oct 1, 2018

@revilor If you need help I'm giving my whatsaap to exchange ideas about this upgrade.

@GMagician

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2018

OT @revilor don't know if you need it or not but on aliexpress there is a mmu2 board clone available.
A question about your project, there are some parts in mmu2 that are not easily on the market (brass tubes on carriage and brass nut for ptfe come in my mind) where did you found them?

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2018

OT @GMagician Brass tubes were no problem here in Germany, 6mm outer and 5mm inner diameter like this https://ebay.us/xATVqt Cutting to 25mm length is no problem as Brass is easy to work with. The selector is not moving too fast, so I guess reducing the openings in the printed part to 5.1mm or so and go without the brass tubes should work fine, too.

For the PTFE mount I modified the printed part using the published OpenSCAD file. I reduced the center hole to a diameter of 5mm, tapped an M6x1 thread and directly screwed in the pneumatic connector. On Twitter I have a photo https://twitter.com/revilor3d/status/1043900826257960961.

The most challenging part for me was the stepper with a 130mm shaft for the pulleys. I could not find one on the market so I modified a stepper I had laying around and replaced the shaft with a 150mm long 5mm smooth rod, photo also on twitter.

Thanks for the tip regarding the controller board. I have all the soldering equipment so doing it myself should be fine. But good to know there is a fallback should I screw up.

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2018

My latest sources are now in my repository: https://github.com/revilor/Marlin/tree/MMU2

Check Configuration_adv.h and feature/Prusa_MMU2.

@makerbitter

This comment has been minimized.

Copy link

commented Oct 8, 2018

Hello, is fully compatible MMU2 with Marlin? I'm finishing my MMU2 clone (Arduino+ramps+drv8825) , it will work with Marlin?

@thinkyhead

This comment has been minimized.

Copy link
Member

commented Oct 8, 2018

Good question. Please try it and let us know!

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

yeah, reached the max as the mmu2 wouldn't go any further so looking if there is a fw limit

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

but i dont know how to open / edit hex files

@Minims

This comment has been minimized.

Copy link

commented Apr 27, 2019

You have to rebuild from source, infos is in README :
https://github.com/prusa3d/MM-control-01

I have setup my max to ~110cm. Here is my 1.0.5 MMU2 Fw
if you want to try.

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Tbh I've tried the max length on the mmu2 and there is almost 700 mm between mmu2 and extruder so should be okay, cut the ptfe a little short to make sure it always hits the gears

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Is it possible to create a g code file that is purely just tool changes for like an hour, simple stress test of the mmu

@Minims

This comment has been minimized.

Copy link

commented Apr 27, 2019

I think it can be possible. Gcode for tool change is :

T0
T1
T2
T3
T4

But this will only make change on MMU, so will load/unload from MMU to Gear.

If you want to make test from MMU to nozzle, You might need to add some gcode to make load & ramming sequence from gear to nozzle.

@Minims

This comment has been minimized.

Copy link

commented Apr 27, 2019

Here is example for original Prusa , but later this has to be done by Slic3r as I understand. I have not go further for now.

; ramming sequence
M83 ; E relative
G1 E1.0 F1000
G1 E1.0 F1500
G1 E2.0 F2000
G1 E1.5 F3000
G1 E2.5 F4000
G1 E-15.0 F5000
G1 E-14.0 F1200
G1 E-6.0 F600
G1 E10.0 F700
G1 E-10.0 F400
G1 E-50.0 F2000
G4 ; wait for E moves to finish
; ramming and unload from hotend done

T<n> ; tool change

; feed filament from the extruder gears to the nozzle
M83 ; E relative
G1 E7.2 F562
G1 E14.4 F871
G1 E36.0 F1393
G1 E14.4 F871
G1 E50.0 F198
@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

I remember seeing similar within the marlin 2 code, maybe slightly varying values,

Need to take it into work with me so I can get it back up and worming on my rig

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Hopefully they add the filament run out feature and being able to use teo filament sensors, but for the minute do you know of the best prints to use as initial calibration, I presume going from 2 filaments and progressing upwards

@Minims

This comment has been minimized.

Copy link

commented Apr 27, 2019

I will try the Prusa example "Geecko". Originally used with 3 filaments, but I will replace the third color with the first one.
2 colors for the beginning seems a good idea to me.
The first thing is to have a working tool change during the print. I am block here.
1st unload ok,
2nd load to gears ok,
load from gear to nozzle before resuming print fails. it starts before filament reach my nozzle (Bowden tube of 60cm)
At this point I found that you have to manage a filament buffer, or auto rewind spool, because I have 2m of filament back on tool change...

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Yeah I'm designing a system to have 5 spools in a line on individual axle with a rewind centre, chucking the buffer straight out

For the filament issue you can individually load and calibrate each Bowden length, there were people who had similar issues, where every filament loaded to the nozzle fine apart from one

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Auto-Rewind Spool Holder found on #Thingiverse https://www.thingiverse.com/thing:3200204

  • just the axle part

Universal Auto-Rewind Spool Holder found on #Thingiverse https://www.thingiverse.com/thing:3338467

  • full spool holder

@Minims

@Minims

This comment has been minimized.

Copy link

commented Apr 27, 2019

I don't think you can calibrate the 5 filaments for gears to nozzle. if it possible I din't know how.

I have calibrate "bowden" length for the 5 filaments. I mean length from MMU to Extruder Gear. Filament can be catch by the E gear. This part is Ok.
Load Filament to Nozzle from LCD, is OK too for all 5 filaments.
I'm trying to tune "Filament parking position" in Slic3r as revilor suggest, but I had not enough time to make new tests for now.

@Minims

This comment has been minimized.

Copy link

commented Apr 27, 2019

Auto-Rewind Spool Holder found on #Thingiverse https://www.thingiverse.com/thing:3200204

  • just the axle part

Universal Auto-Rewind Spool Holder found on #Thingiverse https://www.thingiverse.com/thing:3338467

  • full spool holder

@Minims

I'm looking to this one on my side : https://www.thingiverse.com/thing:3228827

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Sometimes have risk of noting

The first one I showed you or in fact both of them will re wind up to 8 full times which should be more than enough, I had a spool with a 1/4 left and less than 3 rotations pulled in atleast 750mm

@0lympu5

This comment has been minimized.

Copy link

commented Apr 27, 2019

Ah yeah, I remember because you're using Bowden system, maybe over compensate by a little, and get the last section slow so if it's too far it can ooze out

@0lympu5

This comment has been minimized.

Copy link

commented Apr 28, 2019

@revilor is there any potential to further expanding the mmu2 functionality in marlin 2, to include the same features as in the current prusa fw?

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Apr 28, 2019

Sorry folks, there will be no MMU2S support in Marlin from my side in the near future. For now I don't have the time to implement it and as my printer carries a Bondtech extruder at the moment I also do not have the hardware to test this kind of stuff.

For a bowden setup you would have to design your own (opto)mechanical "filament reached the extruder gears" sensor to make it work, so it's not just Marlin. And to find a generic solution in Marlin to support as many printers as possible and not just MK3 clones with a MK3S extruder will also take some time and effort I'm not able to invest on a voluntary basis at the moment.

@0lympu5

This comment has been minimized.

Copy link

commented Apr 28, 2019

@revilor did you get rid of your laser sensor then ?

@revilor

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

@0lympu5 No, the laser sensor sits on top of the Bondtech

@0lympu5

This comment has been minimized.

Copy link

commented Apr 29, 2019

@revilor Does it function as a usual filament sensor, the same as the mk3s one I have hooked up, no communication with mmu2 but will detect a filament run out if mmu2 finda doesn't or doesn't load correctly ?

@0lympu5

This comment has been minimized.

Copy link

commented May 6, 2019

Cany anyone help me, I have a mmu hooked up and running well on ramps and @Minims version of the firmware, using the R4 design with filament sensor.

The mmu has been calibrated with Bowden tubes to reach the extruder but once it reaches the jaws it continues to spin and even pick up speed, creating a lot of pressure inside the hot end, any ideas?

@Minims

This comment has been minimized.

Copy link

commented May 7, 2019

R4 with IR Sensor like MK3S ?
Is it while printing ? or while 'load filament to nozzle' from LCD Menu ?

@0lympu5

This comment has been minimized.

Copy link

commented May 7, 2019

yes it is the r4 with the chimney set up supplied with the mmu2s kit.
Only noticed while using the lcd, re calibrated bowden length and i know its not that, have not tried a print yet as thought it would fail due to this issue.

@Minims

This comment has been minimized.

Copy link

commented May 7, 2019

Have you kept my value for load to nozzle ? because it's for my Bowden setup. you have to go back to original value. same thing for ramming sequence.

@0lympu5

This comment has been minimized.

Copy link

commented May 7, 2019

Is that the section within config.adv because o thought it was that a first but compared it to another file and it was the same but maybe I got the files mixed up, had a few attempts tbh, any idea what the original values should be?

@Minims

This comment has been minimized.

Copy link

commented May 7, 2019

original value fitting MK3 (not S)

    #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
    #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
      {  7.2,  562 }, \
      { 14.4,  871 }, \
      { 36.0, 1393 }, \
      { 14.4,  871 }, \
      { 50.0,  198 }

    #define MMU2_RAMMING_SEQUENCE \
      {   1.0, 1000 }, \
      {   1.0, 1500 }, \
      {   2.0, 2000 }, \
      {   1.5, 3000 }, \
      {   2.5, 4000 }, \
      { -15.0, 5000 }, \
      { -14.0, 1200 }, \
      {  -6.0,  600 }, \
      {  10.0,  700 }, \
      { -10.0,  400 }, \
      { -50.0, 2000 }

@0lympu5

This comment has been minimized.

Copy link

commented May 7, 2019

I'm pretty sure those are the values I have
I'm presuming first number is speed and then distance ?

@Minims

This comment has been minimized.

Copy link

commented May 7, 2019

first is distance, second is speed. It's relative values.

mk3s is a bit shorter than mk3. So if you have the correct values , I would try to replace :
{ 7.2, 562 }, \
by

{ 3.0, 562 }, \

@0lympu5

This comment has been minimized.

Copy link

commented May 7, 2019

Okay, by that logic I might've seen the speed and not the distance, I did notice a load unload value in the filament config menu branch in the range of 500 to 600 so I must have your values on place somewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.