prusa3d / MM-control-01

MMU 3-axis stepper control
GNU General Public License v3.0
92 stars 104 forks source link

Fix homing without hardware modification #150

Open chriswal opened 5 years ago

chriswal commented 5 years ago

fix filament unload eeprom handling:

On setup idler is moved to eeprom stored loaded filament (so homing is done for idler) but is never removed on unload. as only 0 to 4 is used 5 removes the filament on unload. On setup if filament loaded is indicated active extruder is also set to loaded filament number.

fix motor humming and led flickering in idle mode:

leds not updated in idle mode led set in setup

fix homing without hardware mod:

hc595 needs buffer capacitor. this is a workaround. no led updates on moving motor. so in the homing phase i had to change from green blinking leds to red steady (as done when moving selector). added a move_with_stallguard sub to change led update behavior.

SNDR0 commented 5 years ago

why pulley homing?

chriswal commented 5 years ago

when filament is unloaded no idler homing for error handling on startup anymore. i added stallguard to the idler.

SNDR0 commented 5 years ago

Ok but during homing the pulling don't move at all..

Il lun 10 giu 2019, 13:57 chriswal notifications@github.com ha scritto:

when filament is removed no pulley homing for error handling on startup anymore. i added stallguard to the pulley.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prusa3d/MM-control-01/pull/150?email_source=notifications&email_token=AL6BFE4CHAUWORQFM62JRQDPZY6RBA5CNFSM4HWPUI2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXJVVWA#issuecomment-500390616, or mute the thread https://github.com/notifications/unsubscribe-auth/AL6BFEZKWITIIANSTHXJSFLPZY6RBANCNFSM4HWPUI2A .

chriswal commented 5 years ago

sorry didnt read ...where do i home pulley? ...pulley is the filament moving part ..that has no home position

chriswal commented 5 years ago

@SNDR0 you meant the pulley or the idler (the idler is the one with the ball-bearings) ?

SNDR0 commented 5 years ago

Obviously the pulley. Your fix is similar to mine but more in detail. Pulley in homing is not necessary, so a lot of program is erasable... Similar to move_proportional... And the more tries for homing with this last modify is not necessary. Once that zero position is find you can switch to normal move and then move to home position

Il lun 10 giu 2019, 14:28 chriswal notifications@github.com ha scritto:

@SNDR0 https://github.com/SNDR0 you meant the pulley or the idler (the idler is the one with the ball-bearings) ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/prusa3d/MM-control-01/pull/150?email_source=notifications&email_token=AL6BFE4HANRRZ2XJAZMLXSTPZZCGDA5CNFSM4HWPUI2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXJXUWA#issuecomment-500398680, or mute the thread https://github.com/notifications/unsubscribe-auth/AL6BFE25TI4IS7Z5NFEYCY3PZZCGDANCNFSM4HWPUI2A .

chriswal commented 5 years ago

multiple tries with different moves backwards on the selector can help if there is problem with stuck filament parts. thats why i left it. the move or move_with_stallguard for each axis is not the homing part ... this is only a move routine and you should be able to move the pulley also. the important part is not to update leds while moving. did you try my change? does it work on your mmu2?

SNDR0 commented 5 years ago

I'm at work and to program is not my job. This night I try your change and I will say if it works fine. Bye

Il lun 10 giu 2019, 14:49 chriswal notifications@github.com ha scritto:

multiple tries with different moves backwards on the selector can help if there is problem with stuck filament parts. thats why i left it. the move or move_with_stallguard for each axis is not the homing part ... this is only a move routine and you should be able to move the pulley also. the important part is not to update leds while moving. did you try my change? does it work on your mmu2?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/prusa3d/MM-control-01/pull/150?email_source=notifications&email_token=AL6BFE7SMQD2BF3LRCMIPGTPZZEXHA5CNFSM4HWPUI2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXJZBJQ#issuecomment-500404390, or mute the thread https://github.com/notifications/unsubscribe-auth/AL6BFEY42ZDCPVRIIELOBJLPZZEXHANCNFSM4HWPUI2A .

SNDR0 commented 5 years ago

ok i tried your version: this is the video https://photos.app.goo.gl/ACRHHLtMw1cEbMv98

this is my homing version: https://photos.app.goo.gl/jmi8YH8ULKjGrP376

chriswal commented 5 years ago

Thanks for testing. I turned off stallguard for the idler and the tries to one, as you can see it doesnt work on all machines ..it worked on mine. i try to only fix the homing problem (hc525) first ....then its possible to improve the homing to silent. perhaps an idea is to change the homing only in stealth mode. so if someone has troubles he can switch back.

SNDR0 commented 5 years ago

ak47 still shooting (shorter..).. in my version after 2 days on stallguard without good solutions, i decided to compare stallguard value of every single step. so when it rises over a certain value compared with the value of previous step a break occur. and the friction of filaments or springs not affect the crash at the end

chriswal commented 5 years ago

yes but i should be like the version before the fix. (version 1.5) i also check after every step... but the stallguard on the idler is a little bit tricky ... in my tests i have to jumpstart the idler ...move without stallguard 100 steps in the same direction then change to stallguard.. if i dont do this it sometimes doesnt move at all (because stallguard says 0 ) and it doesnt matter what sensitivity is set. stallguard needs a minimum movement speed to work.

chriswal commented 5 years ago

https://photos.app.goo.gl/cpa8VevUhHafuW8n7 this is the version with turned off stallguard and only one try on the idler...as you already tested. here you can see my special finda probe ;-)

chriswal commented 5 years ago

https://photos.app.goo.gl/QAgBxt8kMu2awZyp7 that is a test version. i move also in the opposite direction untill stall so i can count the steps from one side to the other and i know if the homing is ok.

SNDR0 commented 5 years ago

wow, it work fine. in my project studying the datasheet of tmc2130 i see that when the motor is spinning too low the value of sg is not stable. with low steps/s, tmc2130_read_sg is proportional to current (more friction = more sg), so with my formula for every step (if (new_sg >(old_sg +x)) break) i check the deceleration (indirectly, checking the friction). changing x i can change the sensibility of crash.

it's like acceleration (m/s^2) and velocity (m/s).

chriswal commented 5 years ago

in the datasheet is more friction lower value ...0 is stall "A higher value means lower mechanical load. A value of 0 signals highest load" thats from the datasheet

SNDR0 commented 5 years ago

Immagine

at near to zero spin motor i use this part of datasheet

chriswal commented 5 years ago

perhaps we can somehow auto calibrate it. so that in works on different machines

SNDR0 commented 5 years ago

my mmu2 is assembled with hyper mega shitty cinese motors, board and cables. so if your it's original we have the best and the last for testing. between there is all the others. try my version and say me if my raw routines works with your mmu2.

chriswal commented 5 years ago

i have also only the chinese version ...but i think prusa too ;-) i will test it

chriswal commented 5 years ago

i have no capacitors on my hc595 .. thats the test of your firmware https://photos.app.goo.gl/xf8fS8nXkkcnTcMc7

i made a branch with stallguard enabled on my repository perhaps you can test it ..and if stallguard dont work on the idler please try different sg threshold settings in the config.h for the idler

SNDR0 commented 5 years ago

Try my revised version if it works. Thanks

BastR commented 4 years ago

On my MMU2 (Chinese clone too), the idler makes a lot of noise when booting the MMU2, I guess it makes the home but it repeats the movement almost 10 times. Then my printer connects to Octoprint and it repeats the noisy homing....

If I understand correctly, this PR correct this problem of noisy homing?

chriswal commented 4 years ago

Sorry for the late reply. No This fixes the issues that are written in the first post. the noisy homing is the idler, as the idler turns too slow stallguard is not working. so i gave up this way. i made a version with a pinda endstop on the idler https://www.thingiverse.com/thing:3783694 https://github.com/chriswal/MM-control-01/tree/Pinda_Endswitch where all this fixes and the endstop is included--this source should unchanged also work without endswitch but then it is loud again