Bed_Distance_sensor icon indicating copy to clipboard operation
Bed_Distance_sensor copied to clipboard

Always get a 0.0 mm after M102 S-2 pandapi3d v1.2

Open f1cs2000 opened this issue 1 year ago • 15 comments

I just install a new BDsensor to try . After M102 S-1 I get V1.2 pandapi3d. M119 working ok open and trigged . When I try to M102 S-2 it always reply 0.0mm. I tried to moved the sensor nearer and further of the bed and it always give me 0.0mm. I tried the M102 S-6 and I get this : Calibrating, don't power off the printer Please Wait... Unknown command:"SET_KINEMATIC_POSITION" Must home axis first: 0.000 0.000 0.100 [0.000] Must home axis first: 0.000 0.000 0.100 [0.000]

After I tried to home with a G28 and it look homing normally but it disable all stepper after homing and give me this message: Endstop z still triggered after retract warning:triggered at 0mm, Please slow down the homing z speed and the position_endstop in BDsensor >=0.5 Z axis triggered at 0.000 mm

Here is my config:

[safe_z_home] home_xy_position: 150,150

[bed_mesh] speed: 100 horizontal_move_z: 5 mesh_min: 15, 0 mesh_max: 273, 264 # 268, 259 probe_count: 6,6 horizontal_move_z: 1 algorithm: bicubic

[BDsensor] sda_pin: PA15 scl_pin: PB9 delay: 20 z_offset: 0 z_adjust: 0.0 x_offset: -40.5 y_offset: 0.0 #no_stop_probe: position_endstop: 0.8 speed: 0.8

[stepper_z] step_pin: PB0 dir_pin: PC5 enable_pin: !PB1 microsteps: 16 rotation_distance: 8 endstop_pin: probe:z_virtual_endstop position_max: 350

Do you think the sensor is not good because it gave always 0.0mm ? Any idea ? Thanks Martin

f1cs2000 avatar Jan 16 '24 14:01 f1cs2000

here is the reason from the message Unknown command:"SET_KINEMATIC_POSITION" while calibrating.

and just add this into your printer.cfg , calibrate again.

[force_move] 
enable_force_move: true   # required by the command SET_KINEMATIC_POSITION in the calibration step below.

markniu avatar Jan 16 '24 14:01 markniu

Yes working !!! thank you for your fast reply. First print all around the bed of my Cr10 smart with Sprite extruder and BTT Mini E3 V3 perfect !!! The only thing I am a bit afraid, is the sensor have to be around .6mm to get good sample value just under 400 for the first. Is this normal ? I will probably test your new code for the real time adjust, can you tell what append if during the print the sensor go outside of the bed because of the sensor x offset ?

f1cs2000 avatar Jan 16 '24 15:01 f1cs2000

Maybe you can decrease the mounted z distance between the bdsensor and the nozzle.

The only thing I am a bit afraid, is the sensor have to be around .6mm to get good sample value just under 400

markniu avatar Jan 17 '24 03:01 markniu

that real time adjust is very depends on the mount XY offset, if the sensor detects the bed is out of range, it will stop the real time adjust.

I will probably test your new code for the real time adjust, can you tell what append if during the print the sensor go outside of the bed because of the sensor x offset ?

markniu avatar Jan 17 '24 03:01 markniu

After a couple of test it's the best result, with effort less, I never had with my Cr10 smart ( with his bent bed .430 variation). I still have over compensating in some area, only in lower bed area, since I installed the sensor with y=0 offset. But I know that's a Klipper problem when heavy bent bed. That's why I will try the real time adjust.

The only issue I had in my test is I get a randomly this error ( Move out of range) when I try to apply z_adjust: -0.04) I haven't try other value and I can live without applying this value. Just for let you know.

Thanks for your work, I think it's the future of the bed leveling.

Update: Live adjust not working for me. Z not moving during the print. I have made a new klipper install with the klipper_beta and reflash. Add the line BDSENSOR_SET REAL_TIME_HEIGHT=0.3 in Mainsail [gcode_macro START_PRINT] instead of BED_MESH_CALIBRATE.

Any idea ? Thanks Martin

f1cs2000 avatar Jan 17 '24 10:01 f1cs2000

No more working Internal error on command:"G28" if I disconnect the sensor it goes a bit further in the homing and it come back with a distance error. I try to flash back to the klipper without beta / same error . I try other control pin on the board for the sensor and same error. I can Home X and Y but not Z. M102-S6, S5 and S2 working. Now I'm stuck

f1cs2000 avatar Jan 18 '24 11:01 f1cs2000

you can see the details of the error in the klippy.log file or attach the klippy.log file here

markniu avatar Jan 18 '24 13:01 markniu

klippy(6).log

f1cs2000 avatar Jan 18 '24 13:01 f1cs2000

just find this error TypeError: MCU_trsync.start() missing 1 required positional argument: 'expire_timeout' , that needs to update your klipper.

markniu avatar Jan 18 '24 13:01 markniu

I am UP-TO-DATE in Update Manager.

f1cs2000 avatar Jan 18 '24 13:01 f1cs2000

also need to update the file BDsensor.py in the /home/pi/Bed_Distance_sensor/klipper/

markniu avatar Jan 18 '24 13:01 markniu

Excuse my limited knowledge, can you tell me how I do that ?

f1cs2000 avatar Jan 18 '24 13:01 f1cs2000

BDsensor.txt

f1cs2000 avatar Jan 18 '24 13:01 f1cs2000

you can just

rm Bed_Distance_sensor -rf

and gitclone again

git clone https://github.com/markniu/Bed_Distance_sensor.git

markniu avatar Jan 18 '24 14:01 markniu

After a couple days of testing. BDsensor work fine in normal mode but not working in Live mode. I have the confirmation in the terminal console everything look to be configured ok 2:50 a.m. Real time leveling height:0.300000 2:50 a.m. Z axis triggered at 0.700 mm 2:50 a.m. File selected

But during the print Z not move, stay at .200

f1cs2000 avatar Jan 24 '24 08:01 f1cs2000