Welcome! Log In Create A New Profile

Advanced

Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe

Posted by cysign 
Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 18, 2020 10:59AM
Hi,
recently I neraly finished the hardware of my DIY 3D printer.
Just need to adjust stepperdriver-current, then connect steppers, and configure Marlin, before I can test-run my machine.


Here's what I think I need to setup:
5x TCM2209 for axis and 2 extruders (MS1/2/3: high, 1/16th SpreadCycle)

-Arduino Mega2560 using Ramps 1.6 (which seems to be configured as Ramps 1.4 as the punout is the same)

Bed: D8
Extruder0: D9
Extruder1: D10
Extruder0 Fan: D5 (connected using diodes to avoid inductive voltage, driven by BUZ11 FETs)
Extruder1 Fan: D4 (connected using diodes to avoid inductive voltage, driven by BUZ11 FETs)
Filament sensor 0: D6
Filament sensor 1: D11

microSD reader connected to AUX3

Display: HD44780 20x4 ii2 with PCF8574

Rotary encoder: button D31
rotary-pins: D35 & D37

Inductive sensor for z-probing: z-min (dont remember if signal needs to be high or low when aluminium bed is close to it...using 12V to drive sensor, and voltage devider to get 5V signal for Arduino)

5 simple switches as endstops






Here are my questions:
1. Can I tell Marlin NOT to use both extruders at the same time to prevent over-current?
Which setting do I have to use for this?
As I only have a 20Amp PSU here, both extruders, and headbed at the same time would draw too much current!

2. How do I detect the type of temp-sensors (Ext0/1&Bed) I have?

3. Shall I use ArduinoIDE ot Plattform IO to compile and upload Marlin?

4. Which version of Marlin should I use for Arduino Mega2560 /w Ramps 1.6 /w TCM2209?

5. I connected all endstops (Gnd + 5V from Servo GPIOs) directly to my Ramps board, without using additional resistors. Should I connect current limiting resistors on endstops?


6. Im too stupid to compile the Marlin firmwaqre using the ArduinoIDE. Looks like I didnt set up the Arduino Mega2560 properly (in fact Im experienced using the Arduino plattform).

7. Once Marlin has been flashed: is there a test-mode so I can adjust the stepper drivers' current before turning off the machine to connect the steppers?






Here are some picturec of my build:
[digitalinventions.de]

On image 52 Ramps 1.4 still is installed.
On image #53 you can see it has been replaces by Ramps 1.6. There'a also an additional PCB for the extruder's fans on the right.
Image #54 shows my extruders (Ext0: wade Ext1: direct drive)

Edited 5 time(s). Last edit at 11/18/2020 12:48PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 18, 2020 08:26PM
1) get a better power supply.
2) you can't. You either know what you got. Or you have to have a controlled environment where you can set the temp and measure the resistance. at a number of points
3) Plattform IO always
4) always latest release [marlinfw.org]
5) IO pins as input does not draw much current. Connecting IO directly to +5 or gnd is fine.
6) seem to be a statement not a question.
7) no test mode. No way for firmware to know details of your stepper motors.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 19, 2020 07:33AM
7) So I better connect my drivers to a breadboard, adjust current and plug them back in?
I thought about any kind of "move x-axis for 500steps" so I could measure the reference voltage.

3)So now I'm going to use Plattform IO for the first time winking smiley

1) I have had a better (30A) power supply. I prepared everything well for the first start...but then the light in my room turned off and there was magical smoke - PSU was set to 110V instead of 230V....so I have to use my 20A PSU until the new one arrives.
So I better setup the machine for 1 extruder first?

//edit: Just ordered a new 30A PSU - should arrive in 5 days winking smiley


Thanks a lot for your input.


//edit2: For the temp-sensors I can say at about 22-23°C the hotend's sensors are ~130k Ohms (seems to be a 100k thermistor? Addad image#58 hotend's sensor, see link above) whilst the bed-sensor is about 1074Ohms (which ought to be a PT1000?).

Edited 5 time(s). Last edit at 11/19/2020 01:33PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 19, 2020 07:30PM
7) is solved. I set all drivers to 1,40V, which is about 1A current and seem to be enough in any case.

1) As far as my new power supply didnt arrive, Im going on to play with the 20A PSU, to start configurating my printer. I disconnected onw of the hotends heaters to avoid over-current.

After I have checkt the TMC2209 drivers now (found my old stepper-tester-Arduino...but had to rewrite the code, since I couldnt find it anymore and I needed an inverted EN pin, but it was connected to the A7 pin, which is an input and no output (I couldn't pull the EN pin down, so I googled it... I finally know, i DO prefer stealthChop2 over spreadCycle in case of noise. Just disconnected all the Ramps MS3 jumpers (TMC2209 datasheet says this pin might keep floating).

Now it's finally time to learn Platform IO winking smiley

Edited 2 time(s). Last edit at 11/19/2020 08:31PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 19, 2020 10:23PM
[reprap.org]

Here I've read about the thermistor of the j-Head hotends. Looks like this could be what I have. I'll set it up and see what values I'll get winking smiley
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 12:19AM
Platform IO looks nice and works fine winking smiley
Compiling works and uploading as well. But I cannot get my LCD work (i2c PCF8574 HD44780 0x27, hello world example runs fine on display), but I'm not sure how to configure it in Marlin.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 01:34AM
try setting display type LCD_SAINSMART_I2C_2004
It uses the PCF8575

but I suspect you going to need to change code for your display...
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 06:42AM
(edited, wrong post)

Edited 1 time(s). Last edit at 11/20/2020 06:47AM by Azubi18.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 06:47AM
Exactly. That didn't work. I tried to rename the pca8575 to pcf8574 but this didn't help either sad smiley
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 09:30AM
marlin knows about (and some very different types_
LCD_I2C_TYPE_PCA8574 (RA_CONTROL_PANEL)
LCD_I2C_TYPE_PCF8575 (LCD_SAINSMART_I2C_2004)

You have a PCF8574, you would be difficult tongue sticking out smiley
But from what I read the F basically means it can do 400 kHz I2c vs the A which can only do 100khz
One would hope the faster one can do the slower speed?? but I don't know.

give RA_CONTROL_PANEL a try

Edited 1 time(s). Last edit at 11/20/2020 09:33AM by Dust.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 03:09PM
RA_CONTROL_PANEL has problems with the LiquidCrystal_iic.lib

Marlin\src\lcd\HD44780\ultralcd_HD44780.cpp:71:55: warning: invalid conversion from 'int' to 't_backlightPol' [-fpermissive]
   LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
                                                       ^
In file included from Marlin\src\lcd\HD44780\ultralcd_HD44780.h:67:0,
                 from Marlin\src\lcd\HD44780\ultralcd_HD44780.cpp:34:
.pio\libdeps\mega2560\LiquidCrystal/LiquidCrystal_I2C.h:65:4: note:   initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlightPol)'
    LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlightPol pol);
    ^
.pio\libdeps\mega2560\LiquidCrystal/LiquidCrystal_I2C.h: In static member function 'static void MarlinUI::init_lcd()':
.pio\libdeps\mega2560\LiquidCrystal/LiquidCrystal_I2C.h:185:9: error: 'int LiquidCrystal_I2C::init()' is private
    int  init();
         ^
Marlin\src\lcd\HD44780\ultralcd_HD44780.cpp:357:14: error: within this context
     lcd.init();
              ^
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-register'
*** [.pio\build\mega2560\src\src\lcd\HD44780\ultralcd_HD44780.cpp.o] Error 1
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 03:28PM
About your question #6, I recommend you check out Chris Riley's videos on youtube. He has excellent ones on Marlin, VS Code and Platform IO. That's how I'm learning.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 03:39PM
Slowly Im getting into it. Most seems self-explaining after 2 days or reading winking smiley
But still my biggest problem at the moment is the display. This could be a solution:
[github.com]
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 05:38PM
Couldn't find a solution...so I replaced the HD44780 over PCF8574 with a small oled SSD1306 screen.
First time I can see Marlin smiling smiley

Now I need to figure out if my buttons work and how to avoid the:
Err: MAXTEMP: Bed
Printer halted
Please Reset
(see image #60, link above)

Edited 1 time(s). Last edit at 11/20/2020 05:39PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 20, 2020 07:14PM
Re RA_CONTROL_PANEL not compiling... I fixed that 28 days ago... see [github.com]

But I see it is in bugfix but not yet in release marlin.

You can add it easy enough if you want. see the patch here [github.com]

Edited 1 time(s). Last edit at 11/20/2020 07:15PM by Dust.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 21, 2020 11:38AM
Hi Dust, thanks a lot. Though I couldn't get it up and running, so Ill stay with the SSD1306 OLed-display at the moment to go on with my printer winking smiley

After I figured out I had to swap heatbed_sensor and extruder1_sensor on the Ramps board, now I get
Extruder0: 18°C
Extruder1: 19°C
Heatbed: 17°C

As the values are very similar, I guess I should add an offset to adjust all of them to the same value.

Next step: Geting the rotary encoder working as input device.


//edit:
Rotary encoder: button D31
rotary-pins: D35 & D37
(simple rotary encoder, see image #55)

Not quite easy to add the rotary encoder standalone... As part of the 2004 interfacepanel it would have been configured quite quickly.
Any ideas on this?

Added image #61 to show where I'm actually am.
So I can see temperatures as well as an radiator-icon. I have no idea if already something should happen when turning the rotary encoder.




Edited 5 time(s). Last edit at 11/21/2020 12:31PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 21, 2020 06:31PM
Still no working HD44780 or input.

Here's what I've done so far:
digitalinventions.de/files/pics/3Dprinter/IronBot_Marlin_2.0.x_20201122_0014h.zip

I adjusted:
-Configuration.h
-Configuration_Adv.h
-pins_RAMPS.h
-Conditionals_LCD.h (for LCD_I2C_TYPE_PCF8574)
-platformIO already: USES_LIQUIDCRYSTAL = marcoschwartz/[email protected]


Might somebody have a look at my files?
There's a textfile attached in the zip that should contain all my printer's data (except the iic-adress of my PCF8574 driven HD44780 2004, which is 0x27).

//edit: I can easily connect the extruder's fans to any other free port (as the mosfets are connected to Ramps using jumper wires). They don't need to be at digital pins 4&5.

Edited 2 time(s). Last edit at 11/21/2020 06:42PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 21, 2020 07:14PM
Quote
cysign


I prepared everything well for the first start...but then the light in my room turned off and there was magical smoke - PSU was set to 110V instead of 230V....

This is crazy, I live in a country where 110V is used and when you buy a power supply you have to switch it from 220 to 110VAC.
What are they purposely setting the voltage to the opposite for the country power supply is sent!!!!

OK!!!

Stress release. Back to your power supply.
In most cases the power supply is ok. Inside the supply there is a fuse in parallel with a thermal fuse this thermal fuse has basically smoked, most likely so has the Fuse.
I replace the fuse and thermal fuse in my supply an it has been working now for three years.



This is just a FYI there are warning labels on the Supply that state only qualified Electronics Technicians should open.


Computer Programmer / Electronics Technician
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 21, 2020 08:10PM
Quote
Roberts_Clif
...only qualified Electronics Technicians should open.
That's what Im going to be, soon (if somebody reads this, and is unexperienced: better never open a PSU!). I already ordered a replacement PSU, as well as swap the broken fuse against a fuse-holder and order spare parts to repair the broken one, later. A powerfull 12V PSU is always good to have in spare winking smiley
Besides the NTC and the fuse there are two resistors that might got damaged (the painting got flaked....but I haven't measured them yet...working on the 3D printer was way more interesting).
added image #62:


Edited 2 time(s). Last edit at 11/21/2020 08:17PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 21, 2020 10:06PM
Good for you electronics gives you a tremendous jump on this innovative field of 3D Printers.
Remember Programming is the backbone of electronics in this modern day.


Computer Programmer / Electronics Technician
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 22, 2020 11:04AM
Exactly. The electronic part I do understand. But I need help for configuring Marlin for my machine winking smiley
Any suggestions what I could have done wrong?

I'd like to either like connect my SSD1309 (small oled-display, actually works!) or better the built-in-my-machine HD44780 2004 Display driven by a PCF8574 on 0x27 (what doesn't work, though using Lyquid lib 1.4.1 on platformio.ini).
There is no compiling error anymore, but the HD44780 i2c display doesn't show anything from Marlin.
Thats okay for now, I can deal with it later (Id like to print anything so, so bad!)

##############

Now I'd like to use my rotary encoder as input device to control my machine. I couldn't see any reaction on rotating or pressing the button.
Either I forgot to enable any menu options as far as I understand or the configuration doesn't accept my pins (button D31, rotary-pins: D35 & D37).

Also I need to know on which pins I should connect my extruder0_fan and extruder1_fan and how to set it up properly.
I started to configure pins_RAMPS.h (all files attached above on the URL), but I still don't get any progress - maybe I'm trying to config it in the wrong way? sad smiley

Edited 3 time(s). Last edit at 11/22/2020 11:10AM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 23, 2020 02:25AM
"HD44780 2004 Display driven by a PCF8574 on 0x27 (what doesn't work, though using Lyquid lib 1.4.1 on platformio.ini)."
If you had applied the patch it would use marcoschwartz/[email protected]

open file buildroot/share/PlatformIO/scripts/common-dependencies.h
find the line
#elif ANY(HAS_MARLINUI_HD44780, LCD_I2C_TYPE_PCF8575, LCD_I2C_TYPE_PCA8574, SR_LCD_2W_NL, LCM1602)
replace with these lines
#elif ENABLED(LCD_I2C_TYPE_PCA8574)
   #define USES_LIQUIDCRYSTAL_I2C
#elif ANY(HAS_MARLINUI_HD44780, LCD_I2C_TYPE_PCF8575, SR_LCD_2W_NL , LCM1602)

Open up platformio.ini
find the line
USES_LIQUIDCRYSTAL      = LiquidCrystal@1.5.0
Add this line after it
USES_LIQUIDCRYSTAL_I2C  = marcoschwartz/[email protected]

And try RA_CONTROL_PANEL again.

If you have defined your 3 encoder pins correctly the encoder should also work.

Edited 2 time(s). Last edit at 11/23/2020 02:27AM by Dust.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 23, 2020 02:34AM
"Also I need to know on which pins I should connect my extruder0_fan and extruder1_fan and how to set it up properly."

It your board, only you know what you connected to were. fans need mosfets.... where are you mosfets?

but this is unclear are you talking part cooling fans or extruder cooling fans?

part cooling fans are FAN_PIN and FAN1_PIN defined in your boards pins.h files
if they are for the extruder cooling fan you want E0_AUTO_FAN_PIN and E1_AUTO_FAN_PIN in Configiration_adv.h
These come on automatically when hotend is warmer than 50c
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 23, 2020 04:57AM
Thanks for your replies.
I have no part-cooling-fans atm. I'll print them later.
I have 2x Buz11 MosFET for driving the fans connected with jumperwires, so I still can connect them easily to any other free pin as neccessary. As soon as they are running, I'll replace the jumper wires winking smiley
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 24, 2020 12:18PM
After another hours of searching and trying I decided to stard from zero.
First I got a little bit frustrated, as the HD44780 still didn't work. Then I renamed the config-files in the Marlin root/config folder to make sure which one Marlin is using (just in case...).
After that I removed the duplicated config-files from the config-folder - and now it works smiling smiley

Now I have to compare my config-files and add my changes to the stock config to go on.

It's time to check out if all axis are moving properly and how to define paddings round my heatbed, as I build my machine for both extruders to be able to print to the borders (if extruder1 is the whole way to the left, extruder0 isn't above the heatbed anymore).

Im so glad display, and rotary encoder are working now smiling smiley
Thank you a lot!


//Btw: New PSU just arrived 2h ago. Now I can replace my spare 20A PSU with the new 30A winking smiley



Edited 3 time(s). Last edit at 11/24/2020 12:36PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 24, 2020 04:40PM
Holy shit, this thing can move!

X-/Y-axis seem to work properly. But on Z-axis it looks like massive losing steps. No movement on the extruder steppers.
Heres my config so far:
digitalinventions.de/files/pics/3Dprinter/IronBot_20201124_2226.zip


//Edit:
Here's the faulty z-axis. First small steps, where it moves properly, then bigger steps, where it gets lost.
I couldnt manage to get slower acceleration values.
[www.youtube.com]

The x-axis looks like working fine:
[www.youtube.com]

//Edit2:

I cross-checked the stepper drivers for the z-axis. Connection z-axis stepper to y-port works properly. So it seems to be a configuration thing.
[youtu.be]
So mechanically and electrically everything seems to be fine, must be a configuration thing which I cannot find.

Edited 3 time(s). Last edit at 11/24/2020 04:55PM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 24, 2020 08:10PM
"#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }"

5 the max feed rate for z is often to high. Lower it to 2, and re test. If that works, try 3.... etc

I see DRIVER_TYPE are undefined, wihch means you have A4988 stepper driver. you will need to adjust the vref on these drivers manually.
If this is to low, the axis wont move, to high the stepper motors and or driver get to hot and stall/stop/die
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 25, 2020 02:30AM
I have tmc2209 v2 installed and current adjusted to 1A (on the cross-switching test you can see it's working connected to the y-stepperdriver).
Hiw do you assume it's A4988? Did I configure something in a wrong way, again?

//edit: something went wrong.... yesterday I do have configured 2209...I'll have a closer look on what happened later.
//edit2: Okay, again I configured something in a wrong file spinning smiley sticking its tongue out
Now as my config got the right file, I need to do some adjustments on the pinout and check again.

Edited 3 time(s). Last edit at 11/25/2020 02:54AM by cysign.
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 25, 2020 03:06AM
In the Config you linked above IronBot_20201124_2226.zip

//#define X_DRIVER_TYPE A4988
//#define Y_DRIVER_TYPE A4988
//#define Z_DRIVER_TYPE A4988
//#define E0_DRIVER_TYPE A4988

The default when not defined is A4988's
Re: Setup Marlin on DIY printer - Mega2560 TCM2209 z-probe
November 25, 2020 03:22AM
Exactly.
Here are the new files (just deleted the old ones): digitalinventions.de/files/pics/3Dprinter/IronBot2_20201125_0918.zip

Did configuration changes in _two_ files....now merged them and z-axis works properly smiling smiley

Plans for today:
-Validate maximum speed on each axis
-use some lubricant for the axis grinning smiley
-activate endstops
-adjust z-probe offset and probing area
-maybe heat up bed/hotends....but not still sure, as I have to replace a 1.5mm² wire against a 4mm² wire (for currents up to 30A)

Edited 1 time(s). Last edit at 11/25/2020 03:26AM by cysign.
Sorry, only registered users may post in this forum.

Click here to login