My Stoopid Stuff
  • Home
  • Projects
  • Blog
  • Lec'tronics
  • Links
  • CNC
  • Quick Recipes
  • 3D Printer Tips

Considerations for adding a 3D touch probe to a Re-ARM

5/25/2019

16 Comments

 
UPDATE 6/19/2019 - Not digging the auto leveling on a Delta (works great on a Cartesian though).  The trade offs with an offset probe on a circular bed seems to cause some problems for my setup.  Right now I just want to get it working so am gonna revert to a removable zero offset probe.  Will leave this stuff here though since it can apply to a Cartesian printer or folks that want to try it on a delta.

This post is updated on 9/25/2020.

I want to add a 3D Touch probe to my Re-ARM board.  The Re-ARM is a 32 bit RAMPS compatible board which was designed to be a (nearly) drop in replacement for an Arduino 2560, however it is not really that simple in practice.  There are two things that I think need to be done differently than a regular RAMPS setup with a BL-Touch when using the Re-ARM.  The first is that the the normal pin that would be used for the probe is Servo 0 (D11) does not have a 5v level shifted output on the Re-ARM (at least as far as I could find).  Fortunately the digital pins (for the white wire on the probe) are all 5v tolerant on the Re-ARM for the input (it is just the analog pins which are not all level shifted).

Back to figuring out the 5V servo pin out; Servo 3 (Pin D4) does have a 5V level shifted output according to the docs.  The probe may work with 3.3V out, I'm not sure (would say no as the 3D touch is 5v only), but I would rather just use a servo pin that can send 5V to reliably trigger the BL Touch. 

The second problem is that the 3D touch was not reliable when I tested it with the onboard 5V from the Re-ARM as shown below.  It seemed that the coil would energize and hold the magnet on the probe, but then it would drop it, and I noticed that the display LDC backlight would dim when the probe was operating.
Picture
I've read that adding a 5V linear regulator like an LM7805 has helped with this problem on RAMPS 1.4 boards, and there was a simple mod for that.  However on the RAMPS 1.6 board I am using, there is no jumper for the Servo 5V power rail (it appears to be just connected to the onboard 5V regulator).  I plan to add an external 5V regulator which will run off the same 12V supply as the rest of the printer, and supply the 3D Touch probe, but waiting on parts for that.  (UPDATE the 5v external regulator works fine).  My WT-LC case has a place for mounting something like this behind the board, so I made a small mount for it which will put the regulator between the fan and Re-ARM + RAMPS (you can find it at thingiverse).
Picture
Picture
Picture
Picture
Something else that I added, and is not shown in the pic above, is a 10KOhm resistor across the black and white wires (which go to the Z-min endstop on the RAMPS).  They provided the 10KOhm resistor with my 3D Touch probe, but there were no instructions that I could find to describe what it was for.  I found a discussion about it which inferred it would be used the same way as the resistor on the BLTouch which has a 640ohm resistor for this purpose.  Adding the resistor seemed to help a bit with the stability of the connection, just wish it was better documented.

The last thing which has been a problem for me, is understanding the way the servos are numbered in Marlin.  They start at zero and go to three:
Picture

I needed to add the following to get Marlin to compile (this config works OK with my setup - which is a modified Anycubic Kossel Linear Plus) - NOTE I AM USING SERVO 3 FOR THE PROBE (D4 on the Re-ARM).

#define BLTOUCH
#if ENABLED(BLTOUCH)
#define BLTOUCH_DELAY 750 // Minimum Command delay (ms). Enable and increase if needed
#define Z_PROBE_SERVO_NR 3 // Defaults to SERVO 0 connector.
#define Z_SERVO_ANGLES {10,90} // Servo Deploy and Stow angles
/**
* BLTouch V3.0 and newer smart series
* For genuine BLTouch 3.0 sensors. Clones may be confused by 3.0 command angles. YMMV.
* If the pin trigger is not detected, first try swapping the black and white wires then toggle this.
*/
//#define BLTOUCH_FORCE_5V_MODE
//#define SERVO0_PIN P1_18
#endif

 #define SERVO_DELAY {300,300,300,750} // This is needed to get BLTouch working on Servo pin 3 (4th servo)
 
#define USE_ZMIN_PLUG  // I am connecting the probe to the z-min endstop

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe.

#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN


Note that SERVO_DELAY had to be added, and also had to be an "array" with the same number of elements as the number of servos.  The way I read it is like this:

#define SERVO_DELAY { SERVO_0_DELAY, SERVO_1_DELAY, SERVO_2_DELAY, SERVO_3_DELAY }

There was no "NUM_SERVOS" defined in my config, I guess that it figures that out on it's own based on the "PROBE_SERVO_NR 3".  There seems to be several entries that have been depreciated or changes since I last set up Marlin using Atom.

The "BLTOUCH_DELAY 750" was changed due to a suggestion I found in the marlin forums.  I also set the value of 750 in the "SERVO_DELAY" to keep it consistent (hopefully).

Once I get this all tested I will update this post with what was done, and some pics of the setup. UPDATE - this is tested and the probe works, the problem I now have is with the probe hitting the bed clamps since it is an offset probe on a delta printer.
9-26/2020 Below is a pic of a spare RAMPS 1.6 board showing the servo pins (for Venu in the comments below)
Picture
16 Comments
Venu
9/25/2020 05:55:09 am

Hi, I am trying to connect RAMPS 1.6 on Arduino 2560 board and BL touch without success. All i see is Blue dim light on the BLTOUCH when switched on. Can you help me out to overcome this.

Reply
Mike link
9/25/2020 06:29:32 pm

Hi, it has been a while since I messed with the touch sensors, but here are a few things I can think of off the top of my head:

1. Verify the wiring and that the black and white wires are not swapped.

2. Check that you have 5v on the power wire to the probe (that it is not a lower voltage).

3. Also note that in this example, which was using a RE-ARM and not a Arduino as the base board, the servo pin I had to use was the last servo pin (think that is Servo 3 since counting from zero) but in any case I used the set on the right which is highlighted in blue in the pic. Normally, I would use servo0 which is the far left side set of pins, but due to the Re-Arm configuration I used Servo3 (which is why I had to set Z_PROBE_SERVO_NR 3 in my example).

Point is, you may want to verify that the probe is connected to Servo0 on the ramps, and that your Marlin config is set up that way. I believe that by default it uses Servo0 so you don't normally need to set anything for servo pins when setting up a BL-Touch on Servo0.

4. Verify you used the correct Board name in configuration.h.
I believe that the board for the RAMPS 1.6 is simply "BOARD_RAMPS_14_XXX" where XXX is dependent on your setup - see https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/core/boards.h

The board will be mapped to a pins.h file which will then define what pin on the Arduino the physical servo pin will map to. Again if using Servo0 then you should not need to mess with this.

If you are interested in seeing how the boards gets mapped to the pins file, see the following:

A. Boards:
https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/core/boards.h
B. Pins:
https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/pins/pins.h
C. and then from there you can locate the actual pins file for the board (for example the ramps pins file is linked below):

https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/pins/ramps/pins_RAMPS.h

Lastly which seems unlikely but possible is that your 5v regulator is not sufficient for the BL-touch. I used another 5V regulator on mine, but also suspect you may be able to test it by dimming the screen on the printer way down to reduce its current demand and then see if the probe will work.

Reply
Venu
9/25/2020 08:39:49 pm

Thanks Mike for the reply, i have already all the possible options that you have mentioned, however no luck. see the link as they show it has to be connected to D11 pin on RAMPS 1.6 board. I even tried connected to D4 pin changing in the marlin configuration. All i see is Blue dim light on the BLTOUCH when switched on, even Z_Min does not work, I even replaced with another BLTOUCH hoping the earlier one is damaged but no luck. It's been 3 days i am behind this and unfortunately nothing works. I have seen many videos when switched on BLTOUCH turns into bright orange light, i am waiting to see that :).

https://www.reprap.me/3d-touch-auto-bed-leveling-sensor-upgrade-ramps-1-5-base-on-ramps-1-4-expansion-board.html

Mike link
9/25/2020 11:25:45 pm

Hi Venu, that sucks, these printers can be a real headache but getting a touch probe working may be worth it.

I checked the link and it looks like they have the servo connector in the right place for servo0 but I think they have it turned around - but check your board. From the pic above in the post, it shows the servo pins from top to bottom would be -, + , signal. Your board should be marked or you can confirm the pins using a voltmeter.

If it is not the connector, I can think of a couple more things to try. If you can access the terminal on the printer using Pronterface or an Octopi, you can send it "M119" to see if any endstop (or the BL-Touch) is triggered (https://marlinfw.org/docs/gcode/M119.html). If it is then that could be a clue to what is going on.

You can also try to verify that the z-min (or whichever endstop you are using) still works. You could revert the firmware back to stock and just connect the original endstop back up and see if it still works (can also use M119 to check all the endstops one at a time by holding them triggered while running the command).

IIRC, sometimes an external resistor is needed to pull up the signal on the z-min as well - but check the docs for the probe, or contact Antclabs who can assist if that is needed (I don't recall the value of the resistor they supplied).

Reply
Mike link
9/25/2020 11:32:56 pm

I think I botched that up regarding the RAMPS 1.6 servo pinout (I still believe it is flipped in the pics on the reprap.me site). According to the pic of the RAMPS 1.6 board shown above in this post, the servos (from top to bottom) would be Signal, +, ground (but again check the printing on your board to verify). Sorry for the confusion.

Reply
Mke
9/25/2020 11:39:54 pm

I just pulled out a spare RAMPS 1.6 board and confirmed that the negative (ground) pin is closest the edge on the bottom:

===============Top of board


servo signal
+
-
============edge of board

Venu
9/25/2020 11:49:09 pm

Thanks Mike, the first thing i did was to mail Anctlabs but did not get response from them. I posted the query in their facebook and Twitter account no response.

Can you share the snap of RAMPS 1.6 that you mentioned on servo signals. Someone suggested to insert jumper to 5v and vcc which are next to E0 motors, doing that made my board sleep did not turn on.

Can you check with your RAMPS 1.6 to connect BLTouch if you have time.

Reply
Mike link
9/26/2020 01:07:21 am

Hi, I added a pic to this post above showing the RAMPS 1.6 pinout from my spare board. For the servo, normally the black wire will go to ground (-) and red to positive and then the other color in the connector with 3 wires will go to signal, I think it is yellow or blue.

I did not use the vcc to 5V jumper on mine because of the Re-ARM which runs at 3.3V but did have a 5v regulator IIRC. I found a post which explains it and seems to be required to get 5v on the servo pins when running with an arduino (you can check if the servo pins you are using have 5v if you have a volt meter):
https://reprap.org/forum/read.php?219,460175

I also found a post which was unresolved but somebody had a similar issue when jumpering the vcc and 5v pins, the suggestions were to check for shorts (if you don't have a volt meter you can carefully check the RAMPS board for poor soldering which may have bridged some pins). They also suggested to verify that the correct pins are jumpered since they are not well labeled.
https://github.com/RickMcConney/PenPlotter/issues/17

I will be offline for the rest of the day but will check back tomorrow, best of luck, I hope you get it solved and it's not some issue with the boards. You may also want to drop a post on thingiverse, I'd try the reprap group since there are alot of members there:
https://www.thingiverse.com/groups/reprap

Reply
Venu
9/26/2020 04:50:40 am

Hi,
Finally i was able to power up as the 5v pins of servo does not have the power on RAMPS 1.6 which is very strange.
I had to connect 5v and G to AUX 1 5v and G.
I cannot add image here. Thanks for you help.

MIke link
9/26/2020 02:30:19 pm

Thats good news! As long as you can get the power from somewhere for the BL-Touch I'd call that good. Good luck and happy printing!

Venu
9/28/2020 03:26:54 am

Now Z-Homing issue, Z homing does not happen although BLTOUCH shows as red light but Z motor does not stop. BLTOUCH self test happens and M280 commands works too. I rechecked my code, wiring and everything seems to be fine and also tested the probe by activating it and touching it with my hand, it still reacts, but Z motor does not stop.

Reply
Mike
9/30/2020 04:02:13 am

Hi, I would check the output of "M119" with the probe triggered and not triggered to see if the z-min is seeing the change when it should be triggered. It is also a common problem to have the black and white wires flipped since unlike a normal switch the z-min pin positions matter with the bl-touch. If it is not wiring, I'd also suggest going through the manual section for the marlin config and double check your board is correctly set in the configuration.h, and things like the endstop pullups are set correctly in there also.

Honestly the main reason I do not like the BL-Touch is that for all it's popularity the docs can be a bit confusing. There is one thing which is a bit unclear on the smart BLTouch and that is the 5v or 3.3V operation. IIRC 3.3V is the default. If you have a 5V board there is a firmware switch (in marlin configuration.h) to force it to 5v operation which may be needed (it could be that it is sending 3.3v which is too low or unreliable to trigger the z-min endstop). The Antclab docs will have that info as I recall.

I stick with the 3D touch which is a 3V only probe so am not too familiar with the setup but I have done a couple. The last one I did was on a I3 Mega and it made me question my sanity due to similar weirdness to what you are seeing - but it did work in the end (tried so many things I dont recall the exact fix). Maybe some ideas here: http://www.mystoopidstuff.com/anycubic-i3-tmc2208-and-bltouch-v31-upgrades.html

Reply
Mike
9/30/2020 04:04:05 am

Oops, typo'ed that - the 3D touch is a 5v only probe.

Extraball
2/12/2021 03:44:30 pm

Can you show us a picture of this 10Kohm thing? I don't get it to work with re-arm + ramps 1.6 and a step down Modul for the 3Dtouch (set to 5,1V). The test commands are working but if I'm homing, I always get a M999 failure. I wasted so unbelievable much time in debugging this shit. I replaced most of the parts already just to get clear that I don't have broken hardware... :/. A hint would be very nice.

Reply
Mike link
2/12/2021 08:22:22 pm

Hi, yeah getting a touch probe to work can be very frustrating. It has however been a long time (3 years now) and I don't use the delta printer anymore, and gave up on using the 3D Touch with it since the probed area was so small and it really needed a zero offset probe like it shipped with anyway. I have since removed the resistor from the REARM some time ago (since I started using a zero offset switch that doesn't require it), but I recall that the 10KOhm resistor was just jumpered between 2 sides of the 2-pin Dupont connector which was used on Z-min (so it would have been acting as R2 in a voltage divider https://ohmslawcalculator.com/voltage-divider-calculator). I believe the resistor was in the pics, just covered in black shrinkwrap on the purple and blue wires that go to z-min, I checked my old photos and did not find any showing it without the wrap though.

Like I said though, it has been a long time and going only on recollection, so I did some digging and I think that the links below were what I was referring to when I wrote the post (wrt the resistor). The link is for a Duet3d board, but it is also a 3.3v logic board and the same idea. They show the jumper between ground and z-probe in, whcih is how I recall connecting it between ground and z-min on the REARM also:

https://forum.duet3d.com/topic/9691/before-i-blow-my-board-3d-touch-help/19
https://forum.duet3d.com/assets/uploads/files/1591638624332-12v_duet2wifi_v1_04.png

Reply
Mike link
2/24/2021 11:35:26 pm

Damn, re-read my post above, I meant to say Resistor not jumper in that last part. It was a resistor between the ground and z-probe in (again not a jumper). Must have been late when I wrote that.




Leave a Reply.

    Picture

    Stoopid Me

    Welcome to my Stoopid corner of teh Internet.  It's mostly gonna be 3D printing stuff, but I also post some recipes, projects, and the occasional rant here as well.  More Stoopid stuff is updated regularly.

    I recently joined the Amazon Associate program, so some of the links on this site are Amazon affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.  This will help to support this site, and pay for more Stoopid Stuff.

    Archives

    March 2023
    February 2023
    January 2023
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    April 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    November 2017
    September 2017
    August 2017
    June 2017
    December 2016
    October 2016
    September 2016
    July 2016
    March 2016
    February 2016
    September 2015
    August 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    November 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    January 2013
    December 2012
    November 2012
    October 2012
    September 2012
    August 2012

    Categories

    All

    RSS Feed

      Contact Form (Name is optional)

    Submit
Powered by Create your own unique website with customizable templates.