Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kippler support #1

Open
hackebike opened this issue Oct 6, 2022 · 43 comments
Open

Kippler support #1

hackebike opened this issue Oct 6, 2022 · 43 comments

Comments

@hackebike
Copy link

Any chance you add Kippler support?

@markniu
Copy link
Owner

markniu commented Oct 7, 2022

Seems will wait for more time, Since I am not familiar with klipper and python, also try to looking someone help to supporting.

@HelgeKeck
Copy link

HelgeKeck commented Nov 2, 2022

hi there,

working on klipper support for the sensor but cant even connect the probe for any reason. Its connected to the raspebrry PI`s I2C connector but i2cdetect cant find the device.

PI SDA -> Sensor SDA
PI SCL -> Sensor SCL
PI GND -> Sensor GND
PI 5V -> Sensor 5V

I2C is working
image

device seems to work, i can see the LED when putting some metall piece to the sensor

any idea?

@HelgeKeck
Copy link

The device has a 5V VIN, but does the device uses a 3.3V or a 5V I2C connection. Cant find any information on it

@HelgeKeck
Copy link

I tried it with an Arduino I2C scanner nd found this

if the device is connected to the arduino it returns an derror for these addresses

Unknown error at address 0x51
Unknown error at address 0x54
Unknown error at address 0x57
Unknown error at address 0x5A
Unknown error at address 0x5D

@markniu
Copy link
Owner

markniu commented Nov 2, 2022

there is a different from the standard I2C. See this timing diagram of this sensor https://github.com/markniu/Bed_Distance_sensor/blob/main/doc/images/0220517153950.png , for increasing the speed, there is no I2C address transfer in the timing diagram that's the difference from the standard I2C.
There is a library for the arduino: markyue/Panda_SoftMasterI2C
for example add

lib_deps          = 
  markyue/Panda_SoftMasterI2C

in the platformio.ini

@HelgeKeck
Copy link

ok, thank you

@markniu
Copy link
Owner

markniu commented Nov 2, 2022

The device has a 5V VIN, but does the device uses a 3.3V or a 5V I2C connection. Cant find any information on it

this device is 5v I2C connection,but can work with normal 3.3v MCU like stm32 which most gpios are 5V tolerate

@HelgeKeck
Copy link

HelgeKeck commented Nov 2, 2022

nice it works, getting the first readings. will play a bit with it and let you know when i need more infos

@markniu
Copy link
Owner

markniu commented Nov 2, 2022

nice it works, getting the first readings. will play a bit with it and let you know when i need more infos

look forward to

@HelgeKeck
Copy link

HelgeKeck commented Nov 2, 2022

Python module finished :-)

https://www.youtube.com/watch?v=nbHTrJHoE-k

@markniu
Copy link
Owner

markniu commented Nov 2, 2022

wow, nice work!

@HelgeKeck
Copy link

HelgeKeck commented Nov 3, 2022

Thats not good. I just realized that this sensor will most likely not be supported by klipper naytime soon. Problem is the unusual I2C communication the sensor uses. We cant use the inbuilt I2C micricontroller code from klipper to connect to the device, a microcontroller implementation just for this sensor seems unlikely to be approved by the klipper mantainers. So a real implementation is not likely.

@HelgeKeck
Copy link

is it possible to change the firmware of the sensor to use standarized I2C communication?

@markniu
Copy link
Owner

markniu commented Nov 4, 2022

it can not be flashed firmware from the i2c port.
and the reason for not use standard I2C is that we need quik response of the sensor when homing z axis.
maybe we can add the softI2C code of this sensor to the klipper.

@HelgeKeck
Copy link

i am trying to implement it atm

@HelgeKeck
Copy link

image

@markniu
Copy link
Owner

markniu commented Nov 5, 2022

image

Can BD sensor data be read with klipper now?

@HelgeKeck
Copy link

yes, on a microcontroller level

@markniu
Copy link
Owner

markniu commented Nov 5, 2022

good job ! I am editing the wiki document about the calibration that maybe you needed

@HelgeKeck
Copy link

yes, working on the calibration, having also some questions. will ping oyu in the nbext days

@markniu
Copy link
Owner

markniu commented Nov 5, 2022

Have updated the document which contains the calibration process.
https://github.com/markniu/Bed_Distance_sensor/wiki/Data-Protocol

@ashbuilds
Copy link

Hi @HelgeKeck @markniu, may I know what are the configs for Klipper implementation?

@JayBee-git
Copy link

JayBee-git commented Dec 5, 2022

I was wondering, could we simply use a MCU to connect the sensor to klipper, like we can do with the ADXL345 sensor (for resonance compensation)? Would it solve the issue with the unusual I2C protocol, or would it be too slow to react?

@ashbuilds
Copy link

@JayBee-git I was also thinking the same but not sure how Klipper will read the data from sensor. I'm also looking into it.

@JayBee-git
Copy link

@ashbuilds true, I know serial can be used in klipper but that would probably require to change some code. BLtouch is going through the printer motherboard which is a MCU as well, so I bet there is something that can be done here. Maybe even connecting the BDTouch to the motherboard could work?

@bombela
Copy link

bombela commented Dec 12, 2022

The output of the TCA 305 sensor chip is a simple open drain already. What is the point of using a custom protocol with a micro controller here instead of simply exposing the output of the sensor directly? I am sure you have good reasons @markniu but it would be nice if you could explain them.

@markniu
Copy link
Owner

markniu commented Dec 27, 2022

There is a progress for Bed Distance sensor working with klipper:
can display the distance value on screen, homing, and still need some work for the probe, calibration ...
image

the BDsensor is connected to mainboard not RaspberryPi, It's not recommend to connect to RaspberryPi for there maybe a sync problem while homing.

@Townie-au
Copy link

Awesome!
Really very interested in this.
Does it work with a pei bed surface being magnetic?
I have glass ATM. But thinking about getting pei.

@markniu
Copy link
Owner

markniu commented Dec 27, 2022

Awesome! Really very interested in this. Does it work with a pei bed surface being magnetic? I have glass ATM. But thinking about getting pei.

yes, I also test with the pei + steel + magnet on the bed

@neshami
Copy link

neshami commented Jan 9, 2023

There is a progress for Bed Distance sensor working with klipper:
can display the distance value on screen, homing, and still need some work for the probe, calibration ...
image

the BDsensor is connected to mainboard not RaspberryPi, It's not recommend to connect to RaspberryPi for there maybe a sync problem while homing.

Have you any news about bd sensor on klipper?

@markniu
Copy link
Owner

markniu commented Jan 9, 2023

sorry for that delay maybe still need about 2 weeks for the support klipper software, since most of my family got the covid19 last 2 weeks and all recovery fine now. I will have more free time this month from now on.

@markniu
Copy link
Owner

markniu commented Jan 23, 2023

Here is the beta version of Klipper that support Bed Distance Sensor
https://github.com/markniu/Bed_Distance_sensor/wiki/Installing-for-Klipper

@JayBee-git
Copy link

That's really cool, thanks a ton for your work!
I'll install that on another SD card and report back.

@Townie-au
Copy link

Here is the beta version of Klipper that support Bed Distance Sensor https://github.com/markniu/Bed_Distance_sensor/wiki/Installing-for-Klipper

Is it possible to use with Mainsail?

@cubiq
Copy link

cubiq commented Jan 30, 2023

is there any chance for this to be included/accepted into the official klipper repo?

@markniu
Copy link
Owner

markniu commented Jan 31, 2023

Mainsail

I am not use the Mainsail before, but I think it's no problem to work with mainsail for that all the changed source code for BDsensor are in klipper side.

@markniu
Copy link
Owner

markniu commented Jan 31, 2023

is there any chance for this to be included/accepted into the official klipper repo?

I will commit the changed source code into official klipper github after doing more test

@markniu
Copy link
Owner

markniu commented Feb 8, 2023

The code has been pulled to klipper github: Klipper3d/klipper#6031

@cubiq
Copy link

cubiq commented Feb 8, 2023

waiting for it to be approved to buy a few sensors.

PS: I believe you need to sign-off with your full real name (no alias)

@ashbuilds
Copy link

That's awesome! I will try it out asap, thanks!

@henryrgithub
Copy link

@markniu I'm interested in this sensor as I find my current solution inadequate, but am not really interested in keeping a non-mainline firmware installed on my printer long-term. Do you still plan to try and submit a PR to Klipper master at some point? I don't see any commits to your klipper fork since 5/15. I am familiar with Python and C, so if there's anything specific that needs refinement on the fork, if you create issues for it I can take a look.

@benbender
Copy link

@markniu @henryrgithub There is a new PR at Klipper3d/klipper#6490 (comment) that needs to incorporate some requested changes. From my feeling, if those are done, the chances would be good to get it finally into mainline!

@henryrgithub
Copy link

The main thing I see glancing over it is the effort to use a non-sensor-specific probe functions, or at least just have the functions shared with other current eddy sensors. Seems like a reasonable lift, I'll take a look at it this coming week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests