Sensorless homing что это
Перейти к содержимому

Sensorless homing что это

Sensorless Homing на tmc2209. Как настроить.

В общем пришла плата BTT GTR. Не получается заставить работать Sensorless Homing. Уже 3 дня потратил на эксперименты, поднадоело, решил спросить у тех кто сталкивался. Тем более что в компиляторе она компилируется как SKR PRO? так что думаю там такие же заморочки есть.

Подключал и по UART и SPI. Драйвера работают. Концевики, если их подключать, тоже отрабатывают(с отключенным пином DIAG). Пробовал и с отключенными перемычками DIAG и с ними, все равно не отрабатывает Sensorless. Если кто в курсе в каком направлении покопаться, просьба подказать. Что в марлине у меня связанное с этим всем:

#define USE_XMIN_PLUG#define USE_YMIN_PLUG

#define X_DRIVER_TYPE TMC2209#define Y_DRIVER_TYPE TMC2209

#define X_HOME_DIR -1#define Y_HOME_DIR -1

#define X_HOME_BUMP_MM 0#define Y_HOME_BUMP_MM 0

#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing #define X_MICROSTEPS 64 // 0..256 #define X_RSENSE 0.11 #define X_CHAIN_POS -1 //

#if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_CURRENT_HOME Y_CURRENT #define Y_MICROSTEPS 64 #define Y_RSENSE 0.11 #define Y_CHAIN_POS -1 #endif

#define CHOPPER_TIMING CHOPPER_DEFAULT_24V

#define SENSORLESS_HOMING // StallGuard capable drivers only #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0. 255. TMC2130: -64. 63 #define X_STALL_SENSITIVITY 240 //#define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 240 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only //#define IMPROVE_HOMING_RELIABILITY #endif

Sensorless Homing and Stall Detection

Sensorless homing and stall detection is functional for the TMC2209’s and TMC2226’s. This is supported on the following boards.

  • Fly-CDY
  • Fly-CDYv2
  • Fly-E3
  • Fly-E3-Pro
  • Fly-E3-Pro-v3
  • Fly-Gemini-v1
  • Fly-Gemini-v1.1
  • Fly-Gemini-v2
  • Fly-Super8
  • Fysetc Spider 407 version
  • MKS SGen L v1
  • MKS SGen L v2
  • Octopus (F429)
  • Octopus Pro
  • SKR 1.3
  • SKR 1.4
  • SKR 2.0
  • SKR3
  • SKR3 EZ
  • SKR E3 Turbo
  • SKR GTR
  • SKR Pro
  • SKR RRF E3

Getting stall detection working can be tricky and sensorless homing will almost certainly require some tuning.

As always the Duet help pages provide a lot of information that may also be of help.

board.txt Changes

To use the new TMC2209 and TMC2226 features, an addition to the board.txt file is required (to specify the pins used for the DIAG signals from the drivers) and obviously requires that the DIAG pins are routed to those pins (either directly by the board or via jumper wires).

stepper.TmcDiagPins = where “pin 0” is the DIAG pin for drive 0. By default no pins are defined and if you do not want to use stall detection for a drive set the pin to NoPin.

The correct pins in the correct order have been included in the board.txt section on each of the supported boards wiki pages for both WiFi and SBC configurations.

Config.g Changes

The only modification required in config.g is to add the following to each M569 command where sensorless homing is to be used. D3 V40 D3 sets the driver into stealthchop mode. V40 sets the speed at which the driver switches over to spreadcycle.

Homing file changes

This is where the main setup of sensorless homing takes place.

Before using the examples below to config the sensorless homing, it is suggested to test each axis with the following homing code. Ensure that you comment out your current homing code using ;
The code would go in the homex.g or homey.g (adjusting any X moves to Y)

Once you have confirmed that your motors are stalling, adapt the example cartesian homing files below. Copies are also included at the below google drive links. Examples of corexy sensorless homing files can also be found below.

The S, H and R values will probably need tweaking for your system.
H is typically 200 for 1.8 degree motors and 400 for 0.9 degree motors. S is the stall detection threshold which should be between -127 and +127.

R is the action to take on detecting a stall. 0 = no action (default), 1 = just report it, 2 = pause print, 3 = pause print, execute /sys/rehome/.g, and resume print

Sensorless Homing

While sensorless homing reduces the need for wired endstops, it needs tuning. Follow along with this guide on configuring sensorless homing on your 3D printer.

What is sensorless homing, and how does it work?

At a basic level, sensorless homing can negate the need for endstop switches. It does this with StallGuard on specific TMC stepper drivers to tell when the stepper motor is about to stall.

But why is it going to stall? In the case of sensorless homing, the stepper motor begins to stall because it has homed and can not travel any further. But instead of a loud bang or crash. The sensitivity of the StallGuard can be configured and tweaked to give a much softer bump when homed.

But sensorless homing is not for everyone. For instance, the repeatability and accuracy when using sensorless homing can be less than that of wired switches. Furthermore, the reliability of sensorless homing also depends on the 3D printer, specifically the stepper motors, stepper drivers and the mainboards ability to respond quickly to the StallGuard signal. Finally, it also comes down to firmware efficiency in coding to deal with the StallGuard functionality when homing.

So when would you NOT use sensorless homing?

Firstly using sensorless homing for the Z-Axis is not accurate enough, especially when it comes to repeatability. For example, half a millimetre on the X/Y-Axis may not cause issues. Yet on the Z-Axis, that could mean two and a half layers difference. That’s not to say the sensorless homing is that inaccurate as every setup will be different, but it serves as a good example.

It is also for the above reason why delta style 3D printers tend not to respond well to sensorless homing.

In simple terms, if you need a higher level of accuracy, then use wired endstops.

Marlin Firmware

With just a few lines of code to alter in Marlin firmware, it’s reasonably quick to begin running the sensorless homing feature on your 3D printer. So without further ado, let’s get to it.

Configuration.h

screenshot of the stepper drivers section in Marlin firmware showcasing TMC2209s that will be used for sensorless homing

Although there are no specific sensorless homing options within Marlin’s Configuration.h file. It is worth mentioning that the stepper drivers used for sensorless homing need defining in the Driver Type option. For example, #define X_DRIVER_TYPE TMC2209 will set the driver type to TMC2209 UART ready.

Sensorless homing compatible stepper drivers are as follows, TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160.

Configuration_adv.h

Within Marlin’s Configuration_adv, there are a few options to change before the sensorless homing feature can function correctly.

HOMING_BUMP_MM

screenshot of Marlins homing bump option altered for use with sensorless homing

Because the homing bump feature backs away after reaching the home position, you could believe the axis didn’t home correctly. Thus the homing bump needs changing to zero for the applicable axis. Furthermore, the HOMING_BUMP_MM option collates to the X, Y and Z-Axis (< X, Y, Z >), regardless of the number of drivers used for that axis.

In the example below, only the X and Y-Axis HOMING_BUMP_MM is zero.

SENSORLESS_HOMING

screenshot of the sensorless homing feature within Marlin firmware

A quick and simple option to enable is the SENSORLESS_HOMING setting. Just remove the forward slashes at the front of SENSORLESS_HOMING to enable the sensorless homing feature.

STALL_SENSITIVITY

While simple to initially enable, the stall sensitivity requires tweaking by repeatedly homing the X or Y-Axis. However, the starting value will differ for TMC2209 stepper drivers.

TMC2209

screenshot of the x and y stall sensitivity for sensorless homing with a starting value of 5 for TMC2209 stepper drivers

For those using TMC2209 stepper drivers for sensorless homing, begin with a value of 5 and work up.

Non-TMC2209

screenshot of the x and y stall sensitivity for sensorless homing with a starting value of 60 for Non-TMC2209 stepper drivers

For TMC2130, TMC2160, TMC2660, TMC5130, and TMC5160 stepper drivers. Start with a value of 60 and work down.

TMC2130 / TMC5160 specific setting

screenshot of Marlin sensorless homing feature with the SPI Endstop option enabled to be used only with TMC2130 and TMC5160 stepper drivers

The SPI_ENDSTOPS option is only applicable for those using TMC2130 and TMC5160 stepper drivers.

IMPROVE_HOMING_RELIABILITY

screenshot of the improve homing reliability option for sensorless homing within Marlin firmware.

The IMPROVE_HOMING_RELIABILITY option is as it sounds. Moreover, it adjusts the movement settings such as jerk and acceleration to give a better and more reliable homing sequence.

Finish

Finish off the remainder of your firmware settings and compile it for the 3D printer’s firmware. However, if you need a guide to aid you in compiling Marlin firmware, then check out our Marlin firmware from computer to printer guide.

Tweaking the stall sensitivity

screenshot of a terminal program used to send the G91 relative positioning

Via a terminal program such as pronterface set the printer to relative positioning via the G91 command.

Next, for simplicity, begin with homing the X-Axis.

No doubt the noise made you jump, but don’t worry, increase the stall sensitivity for the X-Axis driver by sending the M914 command. The value below is only an example, you can change the value in bigger jumps, but you might miss the sweet spot.

TMC2209
Non-TMC2209

Compared to TMC2209 stepper drivers, the stall sensitivity value works backwards. So if you started with a value of 60, then change the value to 50 to make the sensorless homing more sensitive.

Move the axis away

Before you home the X-Axis and try again, move the X-Axis away from the home position.

Then home the X-Axis again.

At this point, it might not sound any different. But keep upping the sensitivity via the M914 command and remember to move the axis away with G1 X100. Although it is a repetitive process, it doesn’t take that long to get to a good point with sensorless homing.

Once you have found the sweet spot for the X-Axis stall sensitivity, store the value to the EEPROM by using the M500 command.

Repeat for the Y-Axis

With the stall sensitivity complete for the X-Axis, use the same approach for the Y-Axis. The only difference is instead of using X in the command, use Y instead.

Remember the settings

screenshot of M914 command showing the stall sensitivity for the X and Y-Axis

Once you are happy with the X and Y-Axis stall sensitivity calibration, type M914 into the terminal.

Using the M914 command on its own will output the values stored within the EEPROM.

after calibrating the StallGuard sensitivity the final values are stored in the Marlin firmware and recompiled

It is critical to update the X_STALL_SENSITIVITY and Y_STALL_SENSITIVITY options within the Marlin firmware’s Configuration_adv file. Ensure to change these to match your new values.

Now recompile and upload the firmware, so if you later reset to defaults on the printer, the sensorless homing values will stay.

Again, if this is your first time compiling Marlin firmware or you need a refresher, then take a look at our Marlin firmware from computer to printer guide.

Support Make N Print with Patreon

If you find our articles helpful and would like to help support the Make ‘N’ Print website, please visit the support us page for more information.

Alternatively, please have a look at our affiliate links in the 3D Printing Deals and Coupons section.

Setting Up and Calibrating Sensorless XY Homing

When using the TMC2130 / TMC2209 / TMC2660 / TMC5160 drivers, the StallGuard feature makes it possible to set up sensorless homing on the X and Y axes for CoreXY machines. The Klipper project has a page with documentation and recommendations on getting it working.

Following are some more detailed instructions and suggestions to supplement the Klipper documentation specifically for Vorons.

Hardware Setup

You need to configure your hardware properly to enable sensorless homing. This involves two main steps:

  1. If you currently have Hall Effect or microswitch XY endstops connected to your microcontroller (SKR, Spider, Octopus, E3 mini, SKR Pico, etc), then you must physically pull them out of the microcontroller. If you leave the physical endstops connected, sensorless homing will not work.
  2. Install jumpers on the relevant DIAG pins to enable sensorless homing on the X and Y stepper drivers.

Software Setup

Klipper

You’ll need to modify the endstop_pin values for [stepper_x] and [stepper_y] , by adding a pullup ^ , moving the current value into the relevant TMC blocks, and updating the endstop_pin s to use the virtual_endstop as described in the following sections.

Also, as the Klipper docs instruct, set the homing_retract_dist to 0 , and make sure your X and Y homing_speed values are set to half of your rotation_distance ( homing_speed should be 20 for Vorons with 20T pulleys on the A/B motors).

For TMC2209

The following pin examples are from a BTT E3 mini V2; make sure to adjust based on your own configuration.

For TMC5160

The following pin examples are from a BTT Octopus Pro; make sure to adjust based on your own configuration.

Finding the right StallGuard threshold

The calibration process is:

  • For TMC2209, start with SET_TMC_FIELD FIELD=SGTHRS STEPPER=stepper_x VALUE=255 in the console. For TMC2130/TMC2660/TMC5160, use SET_TMC_FIELD FIELD=SGT STEPPER=stepper_x VALUE=-64 instead. Start with the most sensitive value for the StallGuard threshold based on which kind of TMC driver you’re using ( 255 for TMC2209, or -64 for TMC2130/TMC2660/TMC5160).
  • Try running G28 X0 to see if the toolhead moves along the X axis.
  • If your toolhead moves all the way to the end of the rail, IMMEDIATELY HIT THE EMERGENCY STOP BUTTON. Go back and double-check that you have configured your hardware and the Klipper sections above correctly. Ask on Discord if you need help.
  • The Klipper documentation is good here, with one exception. This information is not correct:

Then issue a G28 X0 command and verify the axis does not move at all.

When running the G28 X0 or G28 Y0 command, the toolhead WILL move a millimeter or so before it triggers the virtual endstop. This is normal.

to back the toolhead off after hitting the end of the rail (assuming you’re homing to the maximum X value) or else homing the other axis will not work properly.

Do not forget, you need to repeat this same process for the Y axis.

Homing macros

The Klipper docs recommend setting up dedicated SENSORLESS_HOME_X / SENSORLESS_HOME_Y macros. We’re renaming them to _HOME_X and _HOME_Y here (the leading underscores will hide them in Mainsail/Fluidd, and those specific names are special for Klicky). This setup that has been working well for several Voron owners; you will probably want to tweak the HOME_CURRENT values for your own setup. I suggest creating a new file called sensorless.cfg and adding it with [include sensorless.cfg] in your main printer.cfg

Final setup

If you have a [safe_z_home] section, you need to comment out the entire block (not just the [safe_z_home] line!). Or you could just delete the entire block, but if sensorless homing doesn’t work reliably for you for some reason and you decide you want to go back to a physical endstop setup, you’ll be glad you didn’t delete it.

The last piece to bring everything together is [homing_override] . If you use the Klicky probe, then you already have a [homing_override] section. Make sure you have the latest klicky-macros.cfg, and then you can skip the rest of this guide; you’re done here!

If you already have a [homing_override] and you’re not using Klicky, replace G28 X with _HOME_X and replace G28 Y with _HOME_Y .

For anybody who needs a [homing_override] , the following example has proven extremely reliably on a V0.1.

Restart Klipper, and now the “Home X”/”Home Y”/”Home Z” buttons in Mainsail and Fluidd will work properly (and so will commands like “G28 X”), using your new sensorless homing setup.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *