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

Belay sensor never triggers on printer restart and first print #275

Open
igiannakas opened this issue Apr 19, 2024 · 9 comments
Open

Belay sensor never triggers on printer restart and first print #275

igiannakas opened this issue Apr 19, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@igiannakas
Copy link

igiannakas commented Apr 19, 2024

There is a pretty common case where the Annex tension belay sensor never triggers when the printer is restarted until the sensor is triggered manually (or through luck) for the first time.

This is especially problematic with the Annex belay as its a tension feedback mechanism. When the filament is loaded for the first time it usually results in a compression state, resulting in the switch never triggering during the print.

This happens because after a reboot the filament is expanded (sensor not triggered) so it initialises it as neutral as the pin has never triggered for it to update its state. Therefore it uses multiplier 1.

This will result in the filament possibly always expanding if your extruder is ever so slightly under extruding compared to the ercf.

Just woken up to an overnight print with the belay fully expanded with plenty of tension in the filament. Checking the logs it appears that the sensor never triggered. It started working when I pushed the lever manually.

Log file:
mmu_2.log

I believe this is caused due to the way the sensor is initialised.

Looking at the below it is set initially to neutral:
image

Then it is initialised as neutral:
image

However when the filament is loaded into the extruder, the sensor will expand as the filament is pushed on the extruder gears creating some tension in the filament path. If your extruder is not over extruding compared to the ERCF motor then it will never trigger the tension sensor. Worse, if it is slightly under extruding it will keep raising compression in the filament.

If you have a dual sensor this situation can never occur. Also if you have a compression sensor, it is far less likely to happen as the filament will most likely result in filament compression on initial tool load triggering the sensor.

Ideally, to correct this and make it more reliable, the initialisation routine above needs to check what type of sensor is fitted. If:

  1. Tension sensor: Set the sync_feedback_last_state to 1, triggering the sensor to start contracting the filament until the switch is hit.
  2. Compression sensor: Set the sync_feedback_last_state to -1, triggering the sensor to start expanding the filament until the switch is triggered
  3. Dual sensor or proportional sensor: Leave it to 0 and let the sensors do their thing on first update.

Unfortunately my knowledge of the code is limited to be able to raise a PR but I'd appreciate your thoughts on this and possibly a fix? I've manually set it to 1 for the annex belay till a patch is out :)

@moggieuk
Copy link
Owner

moggieuk commented Apr 22, 2024

Thanks for the detailed explanation. I'll take a look at this because it would be a corner case. My test machine has both tension and compression sensors so maybe I missed this case....

Anyway, I'll address in a day or two and push patch..

@moggieuk moggieuk added the bug Something isn't working label Apr 22, 2024
@igiannakas
Copy link
Author

Thanks for the detailed explanation. I'll take a look at this because it would be a corner case. My test machine has both tension and compression sensors so maybe I missed this case....

Anyway, I'll address in a day or two and push patch..

No worries! Which sensor are you using btw?

@moggieuk
Copy link
Owner

moggieuk commented Apr 25, 2024

Sorry for delay -- life keeps getting in the way! I have a customized sensor of my own. I also have an experimental proportional feedback device. My setup varies all the time as I develop and test Happy Hare. Anyway, I think the fix to this is quite simple and I'm going to fix today. Expect update tomorrow...

@moggieuk
Copy link
Owner

Ok. I pushed a fix for this. When a print starts the sync feedback is correctly set based on available sensors. I'm confident this will work but perhaps you can validate before I close out this Issue. Just need to force an update and restart of klipper.

@moggieuk moggieuk added the believe fixed The bug is believed fixed in latest release label Apr 25, 2024
@igiannakas
Copy link
Author

Of course thank you! I’ll grab the latest version when the current print is done and let you know

@igiannakas
Copy link
Author

OK I've installed the latest version, force updated etc. Will be running a longish print later today and will report back.

@moggieuk
Copy link
Owner

Great. I've been thinking about my fix and it isn't perfect. I might work for you but I need to engineer a more correct fix. What I have done still has corner cases. So I'm taking off the "fixed" label on this issue until I can revist.

@moggieuk moggieuk removed the believe fixed The bug is believed fixed in latest release label Apr 26, 2024
@igiannakas
Copy link
Author

Great. I've been thinking about my fix and it isn't perfect. I might work for you but I need to engineer a more correct fix. What I have done still has corner cases. So I'm taking off the "fixed" label on this issue until I can revist.

What are you thinking as the edge cases? So I know what to look out for or what to test/work around?

@igiannakas
Copy link
Author

FYI - test went ok, sensor worked correctly with the patch. Would be good to get a bit more detail on the edge cases you’re thinking to see whether I can help test them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants