BLTouch Support

Hi Guys I am trying to get a BLtouch to work with Smoothieware. I read on the BLtouch google page that it was implemented into an April edge build.
I have the latest edge build and can not get it to work.
Disclaimer I am using an MKS Sbase. I do own a Genuine Smoothieboard as well. But I fried it is in the process of getting repaired hopefully. So in the mean time I am trying an MKS.
Anyway I have followed all the steps that the BLtouch guys have on there pages and no go. So I was wondering if it is a firmware issue. I wish I had my smoothieboard to test it…

Thanks Matt

Imported from wikidot

Hey.

A bltouch is designed to be indistinguishable from a servo motor and a switch. We’ve supported it since as long as we supported servos ( which is a very long time ).
What happened in April I believe is bltouch figured out that we use 0-100 instead of 0-255 for the pwm value, and published specific documentation.
Can you tell us how you wired things up ?

Cheers.

Haha Thanks Arthur. That is good and bad. I am now wondering even more why I can’t get it to work.
I have wired it the same as their diagram he is a and I am using the max endstops for my Delta.
This is my config most settings are default, as I am only just setting up a new machine.
Any help would be very much appreciated. I am setting up a new delta and if I can’t get this to work I will design it around a servo instead.

flickr:28234526962

I cant work out how to paste my config as I am not allowed to add a link.

please substitute @ with / and @@ with //
http:@@pastebin.com@raw@nmi9HKzY

OK worked it out I found P1.23 on the MKS and now looks like it works.

I haven’t checked if it works for bed level yet, My printer isn’t finished yet.

flickr:27724689403

Hello Matt.
You say in your posts below that your not using resistors, the diagram show 2 being used, are they or have you removed them, and I take it the orange line with the xxx’s denotes its not being used ?

Thanks

I just got my BLTouch finally working.

I was at wits end trying to get it to run and i think i know where i was going wrong.

As i have read looking for info on getting this going there is reference to G31 to do the probe on the bed.

This you will find does not work or fails with a error message.

At some time looks like this function became G32.

Some older smoothie firmware used G31
All the newer edge firmware from i think Jan/feb 2017 you have to use G32.

When i replaced my gcode from G31 to G32 it started working.

I read somewhere Arthur stated you G31 it used to be G32. this i found not the case but the reverse seemed to be the case.

I hope this helps some people out.

You will notice in below posts people say to use G31, this may have been the case on older firmware but i know on latest Edge its G32 that works, not G31.

Glad mine works now!

I ran across Bltouch the other day and it looks pretty awesome. One thing I’m not sure about is if it possible to use it as the primary endstop. Currently I have a inductive sensor for endstop and servo mounted switch for z probe. I would love to simplify my setup but I haven’t seen anything on how to setup a servo endstop. I have a genuine smoothieboard board.

I see no reason at all why you shouldn’t be able to. I use one on my Prusa i3 as a z endstop. Unfortunatly on a Ramps Board.

From my understanding it’s a firmware issue. Marlin has something for a servo endstop so it knows to activate the servo whenever you’re u home z. I haven’t seen anything like that in smoothieware.

This is from Malin config and I can clearly see how it’s set up. I don’t see anything in smoothie config that looks like I can tie a servo to an endstop.

#define NUM_SERVOS 1
#define Z_ENDSTOP_SERVO_NR 0
#define SERVO_ENDSTOP_ANGLES 0,0}, {0,0}, {10,90 // X,Y,Z Axis Extend and Retract angles

That’s probably because nobody who has touched those areas has no need for that particular convenience function (and thus, doesn’t have the hardware to develop for it). You’re probably stuck either writing it yourself or bribing someone else to do it for you.

It might get accepted as a pull request, if it was done cleanly enough.

I know my general use case with probes and Smoothieware is to replace the hotend, do my probing, save the results, and then put the hotend back. With a delta, I now *know* that the offset in X/Y is 0 (because I made the probe holder to ensure that).

I’m installing a BLTouch at the moment, i’m also new to Smoothie and might have overlooked something, but it appears that i’ll need somewhere to setup the servo before and after each probe (clear alarm, move test pin, set test mode).

Adding [zprobe.pre/post_command] to the config looks like it would work, and should offer a tidy way of supporting any servo driven z endstops / probes.

Might need to move the zprobe into [on_main_loop], otherwise i’ll be issuing gcode from within [on_gcode_received]. No idea if this is a bad thing or not (first test doing this crashed), haven’t spent long with the code so if anyone wants to suggest a better way to wire this in i’d be glad of the advice :slight_smile:

I also am having issues setting up my bltouch and can see what you are saying. Have you tried to mess with the code at all anymore?

Yes, with mixed results.
Deferring the probe until on_main worked pretty well for G30, but quickly caused problems for the leveling strategy.

Instead i added a servo pin and pre/post commands to the ZProbe config. It’s less flexible, but a neater solution. Works a treat for G30 etc, but for some reason the firmware crashes during G32 (after performing homeXY, but before we return from the kernel call_event(“G28 X0 Y0”) ). I suspect a stack space issue or something, i’m not setup to debug via Uart, so the test iteration is pretty slow going…

Has anyone gotten this to work yet? I have mine installed on the smootieboard and it does the self test when it is booted up but will not lower the arm when the Gcode calls for the zprobe. I have added the #Switch module for servo control section to my config and have zprobe enabled.

I have the probe working perfectly without a Z Endstop on my Cartesian Printer using Delta Grid Auto Levelling.

I have Wiring Configured similar to the most recent diagram from BLTouch but i DO NOT have a resistor wired in and it works perfectly. Mine is wired as:

Probe Z Min Signal & Ground - Z Min Endstop Signal & Ground on the board.
Probe 5 Volt Supply - Z Min Endstop 5 Volt Supply on the board.
Probe Servo Signal - Any PWM Capable Pin - Needs to be defined in the config file, (In my case P1.23 (MKS SBase)).
Probe Ground - Grnd Next to P1.23 (Any Grnd).

The Servo Settings in the config file are as follows:

##BLTouch Servo Settings
switch.servo.enable true
switch.servo.input_on_command M280 S3.0 # M280 S7.5 Would be midway
switch.servo.input_off_command M280 S7.0 # Same as M280 S0 0% duty cycle, effectivley off
switch.servo.output_pin 1.23 # Must be a PWM capable pin
switch.servo.output_type hwpwm # H/W PWM output settable
switch.servo.pwm_period_ms 20 # Set Period to 20ms (50Hz) - Default is 50Hz

Gamma Min endstop is defined as nc.

The rest of the setup is done in the Pre-Print GCode, in Pseudo terms the process is:

  • Raise Z 10mm
  • Home X & Y
  • Move Toolhead to the bed centre
  • Deploy Probe Pin
  • G31 to probe the bed and turn on compensation
  • Return to the centre of the bed
  • G30 Znn - Here is where the Z Probe offset is defined.
  • Retract Probe.

In GCode it looks like this:

G1 Z10
G28 X Y
G1 X0 Y0
M280 S3.0
G31
G1 X0 Y0
G30 Z2.2 (My Z Probe Offset is 2.2mm)
M280 S7.0

If i have missed some details you need just ask, but this is working very well for me.

Thanks

Alex

I just cannot get the pin to move down. I run G32 in the start of my print but it does not drop the pin and the z axis just keeps going down and I have to shut off the machine.

I have my Z-min set up on the Z-max pin (1.29) and the Z-probe on the Z-min pin (1.28). Home works fine but once it tries to probe that is where it is not working. When I turn on the machine the BLtouch does the self test where the pin moves up and down and ends with the red light solid.
Here is what I have in my config for endstops and Z-probe. Anyone spot anything that is off?

## Endstops
endstops_enable true # the endstop module is enabled by default and can be disabled here
#corexy_homing false # set to true if homing on a hbot or corexy
alpha_min_endstop 1.24^ # add a ! to invert if endstop is NO connected to ground
#alpha_max_endstop 1.25^ # NOTE set to nc if this is not installed
alpha_homing_direction home_to_min # or set to home_to_max and set alpha_max
alpha_min 0 # this gets loaded after homing when home_to_min is set
alpha_max 210 # this gets loaded after homing when home_to_max is set
beta_min_endstop 1.26^ #
#beta_max_endstop 1.27^ #
beta_homing_direction home_to_min #
beta_min 0 #
beta_max 210 #
gamma_min_endstop 1.29^ #
#gamma_max_endstop 1.29^ #
gamma_homing_direction home_to_min #
gamma_min 0 #
gamma_max 170 #

alpha_max_travel 220 # max travel in mm for alpha/X axis when homing
beta_max_travel 220 # max travel in mm for beta/Y axis when homing
gamma_max_travel 170 # max travel in mm for gamma/Z axis when homing

  1. optional order in which axis will home, default is they all home at the same time,
  2. if this is set it will force each axis to home one at a time in the specified order

#homing_order XYZ # x axis followed by y then z last
#move_to_origin_after_home false # move XY to 0,0 after homing

  1. optional enable limit switches, actions will stop if any enabled limit switch is triggered

#alpha_limit_enable false # set to true to enable X min and max limit switches
#beta_limit_enable false # set to true to enable Y min and max limit switches
#gamma_limit_enable false # set to true to enable Z min and max limit switches

alpha_fast_homing_rate_mm_s 50 # feedrates in mm/second
beta_fast_homing_rate_mm_s 50 # "
gamma_fast_homing_rate_mm_s 4 # "
alpha_slow_homing_rate_mm_s 25 # "
beta_slow_homing_rate_mm_s 25 # "
gamma_slow_homing_rate_mm_s 2 # "

alpha_homing_retract_mm 3 # distance in mm
beta_homing_retract_mm 3 # "
gamma_homing_retract_mm 1 # "

#endstop_debounce_count 100 # uncomment if you get noise on your endstops, default is 100

###########

  1. Z-PROBE #

###########

zprobe.enable true # Set to true to enable the Z-probe module. This is used to scan surfaces, and to calibrate parameters and

compensate for non-planar surfaces.
zprobe.probe_pin 1.28 # Pin the probe is connected to.
zprobe.slow_feedrate 5 # Speed in millimetres/second at which the probe seeks a surface.
zprobe.fast_feedrate 100 # Speed in millimetres/second at which the probe does fast moves.
zprobe.return_feedrate 50 # Speed in millimetres/second at which the probe does the return after a probe.
#zprobe.debounce_count 100 # Debounce the probe pin over this number of values. Set to 100 if your probe is too noisy and give false readings.
zprobe.probe_height 5 # Distance above the bed at which the probing is started, once the bed’s height is known.

  1. Leveling strategy

leveling-strategy.three-point-leveling.enable true #
leveling-strategy.three-point-leveling.point1 100.0,0.0 # The first probe point (X, Y)
leveling-strategy.three-point-leveling.point2 200.0,200.0 # The second probe point (X, Y)
leveling-strategy.three-point-leveling.point3 0.0,200.0 # The third probe point (X, Y)
leveling-strategy.three-point-leveling.home_first true # Home the X and Y axes before probing
leveling-strategy.three-point-leveling.tolerance 0.03 # The probe tolerance in millimetres, anything less that this will be ignored, default is 0.03mm
leveling-strategy.three-point-leveling.probe_offsets 0,0,0 #
leveling-strategy.three-point-leveling.save_plane false # Set to true to allow the bed plane to be saved with M500, default is false

switch.servo.enable true
switch.servo.input_on_command M280 S3.0 #M280 S7.5 WOULD BE MIDWAY, PS3.0 push down, PS7.0 push up, PS8.4 self test
switch.servo.input_off_command M281 S7.0 #Same as M280 S0% duty cycle, effectively off
switch.servo.output_pin 1.23 #must be pwm capable pin
switch.servo.output_type hwpwm #H/W pwm output settable
switch.servo.pwm_period_ms 20 #set period to 20 ms
#switch.servo.is_servo true

What is your Pre-Print Scripts looking like? Did you try my working solution?

Thanks

Alex