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

[BUG] Switching nozzle tool change mouvement error #16429

Closed
TouffeTouffe opened this issue Jan 2, 2020 · 25 comments
Closed

[BUG] Switching nozzle tool change mouvement error #16429

TouffeTouffe opened this issue Jan 2, 2020 · 25 comments

Comments

@TouffeTouffe
Copy link

Using a switching nozzle and extruder using the same servo ( https://www.thingiverse.com/thing:673816 ) when executing a tool change, the tool's mouvement are not the ones expected:

Expected moves:
-Raise z by TOOLCHANGE_ZRAISE
-Rotate servo
-Move head to compensate HOTEND_OFFSET_X ,Y and Z
-Lower z by TOOLCHANGE_ZRAISE

Actual moves:
-Rotate servo
-Lower z by a certain distance, which isn't TOOLCHANGE_ZRAISE

I am using the latest bugfix 2.0.x

Configuration.zip
Configuration_adv.zip

@GMagician
Copy link
Contributor

Hi, expected moves should be:
-Raise z by TOOLCHANGE_ZRAISE
-Rotate servo
-Move head to compensate HOTEND_OFFSET_X and Y
-Lower z by TOOLCHANGE_ZRAISE + HOTEND_OFFSET_Z

Some times ago this was working (I had Dondolo) but a lot of changes have been done since then (and I don't use Dondolo anymore).

@TouffeTouffe
Copy link
Author

You're right, I forgot to mention the z offset.
But I had set mine to zero so it hadn't crossed my mind.
The result is that changing multiple times from T0 to T1 and back to T0 causes the z to come crashing down on the bed.

@GMagician
Copy link
Contributor

GMagician commented Jan 3, 2020

@thinkyhead I see you changed some lines in tool_change.cpp (some months ago) line 932 (used with Dondolo) does:
current_position.z += _MAX(-diff.z, 0.0) + toolchange_settings.z_raise;
while just below (line 946):
current_position += diff;
doesn't this lead to real position mismatch?

Edit: That part is ok

@TouffeTouffe
Copy link
Author

TouffeTouffe commented Jan 3, 2020

[edit] More testing showed that this issue only occurs if all axis haven't been homed.
If x y and z have been homed, everything works nominally. Could the behavior I saw when homing hadn't been completed be modified to not make the head smash against the bed?

@GMagician
Copy link
Contributor

@TouffeTouffe just to resume, please check out what condition work

  1. Home done
    a) TOOLCHANGE_ZRAISE <> 0
    I) positive HOTEND_OFFSET_Z
    II) negative HOTEND_OFFSET_Z
    b) TOOLCHANGE_ZRAISE = 0
    I) positive HOTEND_OFFSET_Z
    II) negative HOTEND_OFFSET_Z
  2. Home undone
    a) TOOLCHANGE_ZRAISE <> 0
    I) positive HOTEND_OFFSET_Z
    II) negative HOTEND_OFFSET_Z
    b) TOOLCHANGE_ZRAISE = 0
    I) positive HOTEND_OFFSET_Z
    II) negative HOTEND_OFFSET_Z

@yopla31
Copy link

yopla31 commented Jan 3, 2020

In my case #16419 , even with all axes homed, the issue appears. My TOOLCHANGE_ZRAISE is default value (= 2) and I set the offsets with M218 T1 X10 Y5 Z5 to check all offsets. See my video.

@Vertabreak
Copy link
Contributor

Wonder if the 5 is from z raise of the probe and if it where printing it would go back to 0.

@GMagician
Copy link
Contributor

@yopla31 and @Vertabreak please note that different tools changer execute different code. Dondolo (switching_nozzle & switching_extruder) are a specific path and if only "not homed" is the issue I may have found how to solve it

@GMagician
Copy link
Contributor

@yopla31
Copy link

yopla31 commented Jan 4, 2020

Sorry, not seen the message of the fix
Test without the fix

I use the SWITCHING_NOZZLE :
// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles
#if EXTRUDERS > 1
#define SWITCHING_NOZZLE //JBL-E2
//#endif
//#if ENABLED(SWITCHING_NOZZLE)
#define SWITCHING_NOZZLE_SERVO_NR 1
//#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second
#define SWITCHING_NOZZLE_SERVO_ANGLES { 72, 27 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo)
#endif

and I execute a G28, see at the beginning of my video.

I tried a new test :

  • M218 X5 Y0 Z-5 (X = 5 by security)
  • M500
  • G28 LCD=> X154 Y190 Z10.63 (Probe in X0 Y-49 Z-0.63)
  • G1 X150 Y150 Z0 LCD=> X150 Y150 Z15 (z=15, yes!) and the head raises to 15mm
  • T1 LCD=> X150 Y150 Z15 the move in x is correct and the head raises by TOOLCHANGE_ZRAISE and down to 20 mm, 15 -(offset Z) =>15-(-5)=>15+5
  • T0 LCD=> X150 Y150 Z15 the head raises by TOOLCHANGE_ZRAISE and down to 15

Note :
#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 10 // 5 // Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 10 // 5 // Z Clearance between multiple probes
//#define Z_AFTER_PROBING 5 // Z position after probing is done

8^(

@TouffeTouffe
Copy link
Author

@GMagician I'll try your fix when I get access again at the machine and tell you how it behaves.
Thanks for the support!

@yopla31
Copy link

yopla31 commented Jan 4, 2020

Compilation error. :-(
I compiled without the updates of libraries and platform (stm32 5.7.0)

Marlin\src\feature\pause.cpp: In function 'bool unload_filament(const float&, bool, PauseMode)':
Marlin\src\feature\pause.cpp:355:20: error: 'FILAMENT_UNLOAD_PURGE_FEEDRATE' was not declared in this scope
(FILAMENT_UNLOAD_PURGE_FEEDRATE) * mix_multiplier);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marlin\src\feature\pause.cpp:355:20: note: suggested alternative: 'FILAMENT_UNLOAD_PURGE_RETRACT'
(FILAMENT_UNLOAD_PURGE_FEEDRATE) * mix_multiplier);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FILAMENT_UNLOAD_PURGE_RETRACT
*** [.pio\build\BIGTREE_SKR_PRO\src\src\feature\pause.cpp.o] Error 1
=================== [FAILED] Took 32.62 seconds
Environment Status Duration


megaatmega2560 IGNORED
...
STM32F407VE_black IGNORED
BIGTREE_SKR_PRO FAILED 00:00:32.620
BIGTREE_BTT002 IGNORED
...
=== 1 failed, 0 succeeded in 00:00:32.620

@yopla31
Copy link

yopla31 commented Jan 4, 2020

With updates, same error.
ErrorCompile
Yopla31.zip

@GMagician
Copy link
Contributor

@yopla31 about compilation error: please upgrade your config files FILAMENT_UNLOAD_PURGE_FEEDRATE has been added recently

@GMagician
Copy link
Contributor

@yopla31

I use the SWITCHING_NOZZLE :

Fix works only when both SWITCHING_NOZZLE and SWITCHING_EXTRUDER are both enabled

@yopla31
Copy link

yopla31 commented Jan 4, 2020

I have an extruder and its motor per nozzle, so not a dual extruder that uses a single stepper motor.
//#define SWITCHING_EXTRUDER

20200104_130014_redimensionner

@GMagician
Copy link
Contributor

@yopla31 I correct myself, fix will work when SWITCHING_NOZZLE is enabled and not defined SWITCHING_NOZZLE_E1_SERVO_NR. But it works onlòy when no axis homed, otherwise it is untouched

@GMagician
Copy link
Contributor

GMagician commented Jan 7, 2020

@TouffeTouffe have you tested my fix?

@TouffeTouffe
Copy link
Author

@GMagician Not yet as I only have access to the machine on Wednesdays and Fridays, but I'll be sure to try it out tomorrow evening and tell you how it went

@GMagician
Copy link
Contributor

GMagician commented Jan 7, 2020

Not yet as I only have access to the machine on Wednesdays and Fridays, but I'll be sure to try it out tomorrow evening and tell you how it went

Remember also to answer to:

Home done
a) TOOLCHANGE_ZRAISE <> 0
  I) positive HOTEND_OFFSET_Z
  II) negative HOTEND_OFFSET_Z
b) TOOLCHANGE_ZRAISE = 0
  I) positive HOTEND_OFFSET_Z
  II) negative HOTEND_OFFSET_Z
Home undone
a) TOOLCHANGE_ZRAISE <> 0
  I) positive HOTEND_OFFSET_Z
  II) negative HOTEND_OFFSET_Z
b) TOOLCHANGE_ZRAISE = 0
  I) positive HOTEND_OFFSET_Z
  II) negative HOTEND_OFFSET_Z

@TouffeTouffe
Copy link
Author

With Home done, everything works as it should, in all a and b cases.
With Home not done, the machine just rotates the servo and doesn't move up or down so that's slightly better. I didn't have the time to test the effects of changing the z offset in the "not homed" scenario though.

@boelle
Copy link
Contributor

boelle commented Jan 8, 2020

so we will have to wait a bit more to see if this one is solved?

@GMagician
Copy link
Contributor

With Home not done, the machine just rotates the servo and doesn't move up or down

When home is not done there is a "no_move" flag inside Marlin to prevent axis moving. So this behaviour is almost expected.
I'm expecting that z position is changing by the z_offset. Please confirm that.
I just want to add a "z_max" protection because now movement will be limited but this may lead to a not complete z_offset move and then to a similar bug

@boelle
Copy link
Contributor

boelle commented Jan 14, 2020

since the PR is merged i will close this one, we can reopen if the issue is still there

@boelle boelle closed this as completed Jan 14, 2020
@github-actions
Copy link

github-actions bot commented Jul 3, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants