[testing needed] SmartEffector support in Klipper

Hi,

I’ve created a module to support SmartEffector in Klipper (PR 4688). It adds a few things:

  • SmartEffector sensitivity can be programmed in its EEPROM via e.g. SET_SMART_EFFECTOR SENSITIVITY=20
  • Probing acceleration as well as delay between horizontal move and probing can be configured to prevent spurious triggering of the SmartEffector piezo probe (in configuration and at runtime for tuning).

The latter, admittedly, could be configured via standard [probe] custom GCode feature, but it is just more nice to configure it as

[smart_effector]
pin: PD3
z_offset: -0.1
control_pin: PD2
probe_accel: 500
recovery_time: 0.5

The code works well for me. But I would like to see more testing of it prior to merging. If you are interested in SmartEffector support in Klipper, please give that PR a try.

2 Likes

I don’t use the smart effector, but I see similarities with the piezo probe that I use Orion from precision piezo.
the one I got have a analogue output as well as the digital where you have to fiddle with a trimpot …

As I understand the [smart_effector] do not need the smart effector to use the settings

pin: PD3
z_offset: -0.1
control_pin: PD2
probe_accel: 500
recovery_time: 0.5

in that case I can test it except the “set_…sensitiveitu=x”

Yes, and you can and should omit control_pin option.

Do you still need testers? I’m currently converting my modified predator (Duet Wifi + Smart Effector) to Klipper and absolutely would love this feature.

Yes, it would be awesome if you could give it a try.

@dmbutyugin could you please help me figuring out what my control pin would be on a Duet Wifi? I’m a bit lost on the pin mapping in Klipper tbf…

@bberger Unfortunately, I do not own a Duet board. You could check the smart effector doc page. It suggests to connect Control input to
Duet 2: Z-probe connector MOD pin
Duet 3: IOx connector OUT pin

You can then find the pins in their firmware, e.g.
Duet 2: RepRapFirmware/Pins_DuetNG.h at master · Duet3D/RepRapFirmware · GitHub (so it seems MOD pin is PC2)
Duet 3: RepRapFirmware/Pins_Duet3_V06.h at master · Duet3D/RepRapFirmware · GitHub (search for IO0_OUT … IO7_OUT, depending on which IOx port your smart effector is connected to).

1 Like

I use Smart Effector right now and I have just been searching for a way to change it’s sensitivity.

I am going to try it later today. Fingers crossed

1 Like

Alright, so I tested it, SET_SMART_EFFECTOR SENSITIVITY=n works as expected.

There is one minor problem however, when I issue SET_SMART_EFFECTOR SENSITIVITY=25 command this is the feedback:

SmartEffector:
sensitivity: 25
probing acceleration control disabled
probe recovery time: 0.400

After that, by issuing SET_SMART_EFFECTOR RECOVERY_TIME=0.800 I get:

SmartEffector:
probing acceleration control disabled
probe recovery time: 0.800

But, after issuing SET_SMART_EFFECTOR SENSITIVITY=40 command again but with different value, feedback message is as follows:

SmartEffector:
sensitivity: 40
probing acceleration control disabled
probe recovery time: 0.400

I do not now if it changes recovery_time every time sensitivity command is issued or if it just returns default, non updated value.

That’s all, everything else is OK.

Thanks for testing it! Are you sure you didn’t restart Klipper between SET_SMART_EFFECTOR RECOVERY_TIME=0.800 and SET_SMART_EFFECTOR SENSITIVITY=40 commands? Note that the sensitivity setting is set in Smart Effector EEPROM, and therefore persisted between any printer restarts or powerdowns (this is also why it cannot be configured in printer.cfg). However, recovery_time and acceleration are not persisted between the restarts. They are configurable via that command for the ease of tuning smart effector probing parameters, but ultimately must be stored in printer.cfg by the user. I’m not sure if the documentation is clear enough about that.

Note that in my case, this sequence of commands

SET_SMART_EFFECTOR SENSITIVITY=25 
SET_SMART_EFFECTOR RECOVERY_TIME=0.800
SET_SMART_EFFECTOR SENSITIVITY=40

gives the following output

sensitivity: 25
probing acceleration control disabled
probe recovery time: 0.400

probing acceleration control disabled
probe recovery time: 0.800

sensitivity: 40
probing acceleration control disabled
probe recovery time: 0.800

If you really get the different output within the same run, can you please try again (with the latest commit 0f85c45438cb3bd5632d5da9e87d81a2cea4c7ad) and post the klippy.log from that attempt?

2 Likes

You are absolutely right. I checked it again and it’s alright, I probably restarted fw by mistake, thank you.

It would be awesome if it could be saved with save_config command tho.

OK, it’s great that it’s actually working!

Unfortunately, no other command does that. E.g. you can change PA parameters with SET_PRESSURE_ADVANCE or velocity/acceleration limits with SET_VELOCITY_LIMIT, but you cannot save the changes to printer.cfg. Only the calibration tools like PID tune, bed mesh, etc. offer that possibility. I don’t think we should change it for just one command. But fortunately, one could execute SET_SMART_EFFECTOR without any parameters to dump the currently active settings, and transfer them to the config manually. And it is usually a one-time job.

1 Like

Understandable, in that case everything works as it should.

Good code, I like it, thank you

I finally got around to testing it - works flawlessly.

Setting the sensitivity down to 15 halfed my standard deviation.

Resetting also works flawlessly.

+1 from me.

Hi All,

when I add in [smart_effector] and try to start with that config I just get an error that it’s not an option?

What am I doing wrong here?

You need to update to the most current Klipper version from GitHub. See Frequently Asked Questions - Klipper documentation

Yup, I realized I needed to pull the update about an hour after I posted. I would have deleted my post but it was in limbo for antispam.

Thanks for responding though! It works pretty great, now just on my end to get things squared up.

OK, so the testing showed that the [smart_effector] code works well, and now it is integrated into the Klipper mainline. So, thanks everyone for testing it!

2 Likes