knutwurst / Marlin-2-0-x-Anycubic-i3-MEGA-S

Marlin 2.0.x Version for Anycubic i3 MEGA M/S/P/X/CHIRON and 4MAX with Anycubic TFT or the "new" DGUS Clone TFT - Now also with BLTouch!
GNU General Public License v3.0
787 stars 187 forks source link

[DOC] BLTouch wiring for Mega S/P #210

Closed stklcode closed 3 years ago

stklcode commented 3 years ago

I recently added a BLTouch sensor so my Mega P. The Mega P and - according to the PCB print - also the Mega S share a different hotend PCB which makes it even more elegant to add the sensor. There is an additional pinheader labelled "SWITCH" which is used for the piezo leveling helper. This is not suitable.

But the PCB features an "X-STOP" labelled slot for another pinheader. It's 2mm spacing, but with little bending a 2.54mm pinheader fits perfectly, if you want to change the original BLTouch cable.

This header is connected to A5 and A6/B6. The Pin we need is B5.

B5 is not connected on this PCB, so it's safe to swap A5 and B5 in the green connector. Doing so you can use the Knutwurst as is. Otherwise you would have to change the pin in the firmware configuration.

bltouch_wiring_sp

Works perfectly without any change to this FW.

poulsp commented 3 years ago

Hi Stefan,

Good catch and info. Can you tell me where and which pin two change in the firmware configuration? I'm a fumble finger when it comes to changing the pins in the green connector. :)

regards Poul

stklcode commented 3 years ago

You have to redefine the Z_MIN_PROBE_PIN pin. This has been modified in the _pinsRAMPS.h in this project (don't know why, I'd have redefined it in the configuration, but any way works fine): https://github.com/knutwurst/Marlin-2-0-x-Anycubic-i3-MEGA-S/blob/d84516016372b094183a3796ac8fb76fb182a18b/Marlin/src/pins/ramps/pins_RAMPS.h#L116

The current value is 2.

The one to swap with should be the X_STOP_PIN (3).

Don’t know why, but I initially had "FAN 1" Pin (7) in mind…

I did not verify this! Apparently I didn't write it down anywhere, as I swapped the hardware pins before I ever had a look into the code. Feed free to try on own risk. I probably won't have an open printer to check it myself before the weekend

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.

knutwurst commented 3 years ago

Somehow I missed this ticket. Sorry. The question is whether the PCB always looks like this on the Mega Pro, or whether Mega S PCBs are also installed. If it always looks like yours, I would add the pin change for the Mega Pro into the source code and adapt the documentation.

May I use your picture for this? :)

stklcode commented 3 years ago

I received two feedbacks of people with Mega P and the very same Hotend PCB.

Feel free to use the pictures.

A second change: The Trigorilla clone seems to be different, too. My printer got "v0.0.2" which has servo-ports "S1" - "S4" exposed (pinheader only at S1 which must be used) instead of S0-S3 in the wiki. Other users report "v0.0.3" where the servo ports are different again. There's a 3x3 pinheader array soldered at the top center, where "5V GND S1" are the correct pins.

Both boards work well with the _MEGA_P_BLT10 target.

v003_BLTouch_Servo

knutwurst commented 3 years ago

The documentation is updated and I put your name in it if this is ok? Thank you very much!

Both other Trigorilla-Boards are already covered in the Beginner's Guide or Einsteiger Leitfaden.

Maybe I should reference the one guide in the other ;)

stklcode commented 3 years ago

The documentation is updated and I put your name in it if this is ok?

My name's already here, so again, feel free to use it.

other Trigorilla-Boards are already covered in the Beginner's Guide or Einsteiger Leitfaden.

Second link in the README and I obviously missed that one, nevermind :see_no_evil: Difference was probably too obvious.

Kasu81 commented 2 years ago

Dear Knutwurst,

I own a I3 Mega Pro. With Board v.0.0.2.

am I right, if I will use H1 and H2 —> I have to change the wires from A5 to B5 and B5 to A5?

(zwei Lösungen dokumentiert um den BL Touch Sensor elegant am MEGA Pro anzuschließen. Hierbei kann der freie "X-Stop" Anschluss verwendet werden, wenn man entweder im oberen grünen Stecker die zwei Leitungen A5 und B5 wechselt)

weihan-ott commented 2 years ago

You have to redefine the Z_MIN_PROBE_PIN pin. This has been modified in the _pinsRAMPS.h in this project (don't know why, I'd have redefined it in the configuration, but any way works fine):

https://github.com/knutwurst/Marlin-2-0-x-Anycubic-i3-MEGA-S/blob/d84516016372b094183a3796ac8fb76fb182a18b/Marlin/src/pins/ramps/pins_RAMPS.h#L116

The current value is 2.

The one to swap with should be the X_STOP_PIN (3).

Don’t know why, but I initially had "FAN 1" Pin (7) in mind…

I did not verify this! Apparently I didn't write it down anywhere, as I swapped the hardware pins before I ever had a look into the code. Feed free to try on own risk. I probably won't have an open printer to check it myself before the weekend

I comfirm this change is wrong.MEGA PRO must swap A5 and B5

mnggh commented 2 years ago

Hi @stklcode, Thanks for your contribution as I’m about to install a BLTouch on my Mega Pro.

You state in your first post:

There is an additional pinheader labelled "SWITCH" which is used for the piezo leveling helper. This is not suitable.

Can you please provide an explanation to this, why it’s not suitable? I was wondering if you could also swap some cables or change the pin in the firmware config using the SWITCH pins. Thanks.

stklcode commented 2 years ago

See the pinout picture above. The “switch“ port uses shared pins with The T0 header. It simply provides power for the piezo buzzer that is shipped with the Mega P, so no usable signal is actually routed to the printer that can be switch via firmware.

Of course it is theoretically possible to use the pins. One might cut the lanes to A/B7 on the PCB and solder a wire to B5. Piezo leveling is obviously lost then.

I would rather cut both lanes and rewire it to the hortend pins to connect the laser module.

mnggh commented 2 years ago

Ah, I see. Appreciate your explanation.

Your original solution is much easier and less harmful to the PCB. :)

Thanks!

mnggh commented 2 years ago

Hi, me again.

I know what to do to make it work now. So far, so good.

But I’m lacking some comprehension. I understood, we need B5. And according this thread and RAMPS.h, B5 maps to pin 2 apparently. Is there some kind of mapping table available or how do we know B5 maps to pin 2?

Sorry, if this is getting to off-topic, but I’m eager to also understand the backgrounds. :)

stklcode commented 2 years ago

You can follow the wire and see/measure where it ends. For the 0.0.2 board (Trigorilla 1.4 clone) this is the “X+“ header of the endstops block in the southeast corner. There are a few pinout diagrams around the web where you will see it is pin D2. Otherwise you might look further and follow the connection from the pinheaded to the AtMega.

The i3 Mega has only one X endstop that is positioned on the frame, so the second pin is unused.

A5 and B5 are intended for alternative X limit switches on the hotend assembly. There are several hotend PCBs around, ours has connections on A5. This one is either not connected on the other end or shared with the actual limit switch, so it cannot trivially be swapped in the firmware.

mnggh commented 2 years ago

Thanks! Really interesting. Wow, I can imagine, following and / or measuring can be fuzzy. So I was thinking of some kind of official datasheet or something. :)

Yeah, I found a few pinout diagrams, but was confused with different boards and thus different layouts. In addition, I wasn’t sure if „D2“ equals pin 2. Thanks for confirmation!

So B5 is actually an extension of D2 to the hotend PCB? If so, I could also use D2 on the board directly and would not need to swap A5 / B5? Nor would I need to change anything in the firmware?

If yes to all, we could easily use one of these https://www.3djake.de/antclabs/bltouch-verlaengerungskabel-sm-du, swap only red and brown for the servo and that’s it. No soldering, no swapping cables on the PCB connector, no changing the firmware. Right? :)

stklcode commented 2 years ago

That’s correct. You can directly connect 5 long wires (2x GND, +5V, Servo 1, D2) on the Trigorilla board. E.g. rd/ye/bn to the 3pin servo header (as usual) and bk/wh to the endstops block.

on the 0.0.2 the wiring would be: X+ X-
D2 (wh) D3
GND (bk) GND
+5V +5V
mnggh commented 2 years ago

I agree to the wiring. Thanks!

After opening my Pro, I found that the endstop pins are already occupied by the SD-TFT-Hub-Switch PCB. I think, I understand the complexity behind this now. :)

Appreciate all your help and explanations!

Kilandor commented 2 years ago

Appreciate this as well.

I have the Mega Pro. I was able to get this setup and working. Sadly yes you can't wire the BL touch onto the board as just like mnggh said, the PCB for it has a daughter board that covers and uses all the pins.

However simply taking the wires for A5 / B5 I used a little needle to release the wires from the harness and swapped them. Then soldered a pin connector onto x-stop on the extruder end and was able to get it all working flawlessly. I did swap the brown/red cables for the BL touch as well.

Just a note, if you plan to run the wire for the servo through the wire bundle, the 1m extension cable is not long enough. Thankfully my buddy had a 1m extra he didn't need on hand, so I just took it and modified it to be an extender with the wire connectors that came with it extra.

mnggh commented 2 years ago

Hi Kilandor, thanks for your hint, using extra long wires is indeed useful. Following Knutwurst's guide (German and English), he explains to use two extensions (1x 100 cm, 1x 50cm) which sum to 150 cm in total. As an alternative, the "native" BLtouch extension posted above does the same trick.

For connecting the BLtouch to the mainboard, there seems to be way. I was inspired by this video, in which the creator uses pin 21 on the board. Afterwards he reconfigured and compiled the firmware using the new pin 21 for Z_MIN_PROBE_PIN. I did the same and it seems to work.

HTH.

whopperg commented 2 years ago

Hey Everyone! Could someone take some pictures from the bltouch autoleveling menu form the mega Pro? I cannot find this entry. The only thing i found was the special menu which only shows "auto leveling". if i try to run this, it crashes into the print bed after the bltouch selftest.

I did run the probe configration as recommended in (https://github.com/knutwurst/Marlin-2-0-x-Anycubic-i3-MEGA-S/wiki/BLTouch-Installation-(deutsch)) and could also see that the probe is triggered (M114 in Pronterface)

Firmware: MEGA_S_DGUS_TMC_BLT_10_v1.4.1 Printer: Mega Pro Trigorilla Board: 0.0.2 HotendPCB: Mega S extruder_V0.0.3

M280 P0 S10 ; pushes the pin down
M119 ; Report Status of endstops

Reporting endstop status
x_min: open
y_min: open
z_min: open
z2_min: open
z_probe: open

(manually trigger probe with a piece of paper f.e.)

M119 ; Report Status of endstops

Reporting endstop status
x_min: open
y_min: open
z_min: open
z2_min: open
z_probe: TRIGGERED

M280 P0 S160 ; Release alarm

so - as i assume - the wireing and firmware is correct. What am i doing wrong? Any help would be appreciated :-)

whopperg commented 2 years ago

Nevermind - i just rerun the autolevel special menu thingy and it works now... Awesome Firmware Mod btw!!! Good job!!!

sKuhLight commented 2 years ago

Sorry for asking here, because I'm trying to do this with Klipper but this is one of the only Informations I could find for the Mega Pro.

I got my 3D Touch wired and the Servo Pins are working. The real struggle for me is on the Hot-End Board. I soldered 2 Pins like advised for the X-STOP without swapping the the Pins in the Green connector.

According to Information provided it should now point to D3 (Port E5), thats already used for the X-Endstop in Klipper so it wont work.

I then swapped the Pins on the Green connector, where I'm not sure if i swapped the right ones at all. I just counted 5 from left to right and swapped them. (If you look at it sitting in front of your printer while plugged in) But nope its not working. My probe is always triggered.

I'm probably just using the wrong Port for my config. I refered to this Pinlayout https://cdn.thingiverse.com/assets/b5/c5/55/77/ba/TriGoRiLLa_PINs.pdf

If someone could help me, I would really appreciate that.

Thanks! Edit: Green Connector is right to left when plugged in, so swapped the right ones and yeah its working in klipper with "sensor_pin: ^PE4" Probably way to late for my brain to think.

derN3rd commented 2 years ago

I'm currently having issues with installing a BLTouch (Clone from Geeetech) into my printer with Klipper (I know this is not the Klipper repo, but maybe someone has an idea)

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.