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] IDEX has incorrect X2 offset #22998

Open
ant0nyk1ng opened this issue Oct 21, 2021 · 19 comments
Open

[BUG] IDEX has incorrect X2 offset #22998

ant0nyk1ng opened this issue Oct 21, 2021 · 19 comments

Comments

@ant0nyk1ng
Copy link

ant0nyk1ng commented Oct 21, 2021

Did you test the latest bugfix-2.0.x code?

Yes, and the problem still exists.

Bug Description

After Homing and then selecting Motion > Move X > Select E2... when moving the nozzle to the Bed corner "X0" the display is showing X +102 instead of X0

Expected behavior

After Homing and then selecting Motion > Move X > Select E2... when moving the nozzle to the Bed corner "X0" the display should show X 0.00

Actual behavior

X2 seems to be offset by the X_Min_Pos

Steps to Reproduce

Tried Version 2.0.9.1 and 2.0.9.2

Version of Marlin Firmware

2.0.9.2

Printer model

IDEX

Electronics

BTT Octopus v1.1

Add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Simplify3D

Host Software

SD Card (headless)

Additional information & file uploads

Configuration.zip

@thinkyhead
Copy link
Member

Thanks for the report. Let's gather some more information and get this one solved….

  • Download Marlin bugfix-2.0.x to test with the latest code.
  • Enable DEBUG_LEVELING_FEATURE and M114_DETAIL and re-flash the firmware.
  • Connect to your printer from host software such as Cura, Printrun or Repetier Host.
  • Send M502 and M500 to ensure your Configurations are applied.
  • Send M111 S247 to enable maximum logging.
  • Send G28 to do the standard homing procedure. Check the output for bad values.
  • Send M114 D to get a detailed report of the current position(s). Does it look okay?
  • Send T0 followed by M114 D to see if there is any difference. How does it change?
  • Send T1 followed by M114 D to see how the position changes. Is it off, and by how much?
  • Do a move of the X axis to some known position like X0, then M114 D to see what it says.
  • Copy any relevant log output from the host and include it in a reply so we can look it over.

From the extra debug messages, plus the output of M114 D, we should hopefully get a better idea of what's going on with your machine and IDEX in-general. Thanks!

@ant0nyk1ng
Copy link
Author

@thinkyhead thanks will do those today and report back.

For your reference this bug doesn't effect my other IDEX with 2.0.7.2 but I can't try the older firmware on the Octopus board.

@ant0nyk1ng
Copy link
Author

ant0nyk1ng commented Oct 23, 2021

Ok here my response. Attached are the actual debug out put from Pronterface plus the Conf files

  • Send G28 to do the standard homing procedure. Check the output for bad values. -- Looks good

  • Send M114 D to get a detailed report of the current position(s). Does it look okay? -- Looks good

  • Send T0 followed by M114 D to see if there is any difference. How does it change? -- Looks good

  • Send T1 followed by M114 D to see how the position changes. Is it off, and by how much?


>>> t1
SENDING:T1
echo:T1
>>> T  X225.00 Y195.00 Z12.25
...(1)
Axis X min:102.00 max:604.60
echo:busy: processing
>>> set_axis_is_at_home(X)
  current_position= X604.60 Y195.00 Z14.25 : sync_plan_position
>>> do_blocking_move_to  X604.60 Y195.00 Z14.25
>  X225.00 Y195.00 Z14.25
echo:busy: processing
echo:busy: processing
<<< do_blocking_move_to  X225.00 Y195.00 Z14.25
>>> do_blocking_move_to  X225.00 Y195.00 Z14.25
>  X225.00 Y195.00 Z12.25
<<< do_blocking_move_to  X225.00 Y195.00 Z12.25
echo:Active Extruder: 1
<<< T  X225.00 Y195.00 Z12.25
>>> m114 d
SENDING:M114 D
echo:M114 D
X:225.00 Y:195.00 Z:12.25 E:0.00 Count X:36000 Y:31200 Z:9800
Logical: X: 225.000 Y: 195.000 Z: 12.250
Raw:     X: 225.000 Y: 195.000 Z: 12.250
Leveled: X: 225.000 Y: 195.000 Z: 12.250
UnLevel: X: 225.000 Y: 195.000 Z: 12.250
Stepper: X:36000 Y:31200 Z:9800 E:0
FromStp: X: 225.000 Y: 195.000 Z: 12.250 E: 0.000
Diff:    X: 0.000 Y: 0.000 Z: 0.000 E: 0.000

NOT Right: T1 says X:225 or middle of the bed but is offset to the left by aprox 102mm look at the the image. The position would be 225mm from the X Min not 225 from the Bed X0

Extruder2_selected

  • Do a move of the X axis to some known position like X0, then M114 D to see what it says.

NOT Right: T1 given G0 X0 doesnt move because it is at the limit set in firmware Config_Adv Line 756 #define X2_MIN_POS 102 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage

Extruder2_at_X102_CMD_X0

>>> g0 x0
SENDING:G0 X0
echo:G0 X0
>>> m114 d
SENDING:M114 D
echo:M114 D
X:102.00 Y:195.00 Z:12.25 E:0.00 Count X:16320 Y:31200 Z:9800
Logical: X: 102.000 Y: 195.000 Z: 12.250
Raw:     X: 102.000 Y: 195.000 Z: 12.250
Leveled: X: 102.000 Y: 195.000 Z: 12.250
UnLevel: X: 102.000 Y: 195.000 Z: 12.250
Stepper: X:16320 Y:31200 Z:9800 E:0
FromStp: X: 102.000 Y: 195.000 Z: 12.250 E: 0.000
Diff:    X: 0.000 Y: 0.000 Z: 0.000 E: 0.000

T1 given G0 X400 the max bed size you can see in the pic below its at aprox 300mm from Bed X0

>>> g0 x400
SENDING:G0 X400
echo:G0 X400
>>> m114 d
SENDING:M114 D
echo:M114 D
X:400.00 Y:195.00 Z:12.25 E:0.00 Count X:64000 Y:31200 Z:9800
Logical: X: 400.000 Y: 195.000 Z: 12.250
Raw:     X: 400.000 Y: 195.000 Z: 12.250
Leveled: X: 400.000 Y: 195.000 Z: 12.250
UnLevel: X: 400.000 Y: 195.000 Z: 12.250
Stepper: X:64000 Y:31200 Z:9800 E:0
FromStp: X: 400.000 Y: 195.000 Z: 12.250 E: 0.000
Diff:    X: 0.000 Y: 0.000 Z: 0.000 E: 0.000

Extruder2_at_X400

Debug_Text.zip
Configuration.zip

@ant0nyk1ng
Copy link
Author

@InsanityAutomation do you still need more Data? If there is anything you want me to check let me know. I did try to port the Octopus board into 2.0.7.2 but I am not talented enough to achieve that... I wish!

I could do a 2.0.9 firmware for my other Idex and run the same tests for you to compare a working firmware against the latest... if that helps?

@InsanityAutomation
Copy link
Contributor

Should have everything I need but time, didn't get to it last weekend as we took the kids to get pumpkins and carve em for Halloween instead! I've got 2 things in front of getting back into the idex issues and regression so hopefully not too long here.

@ant0nyk1ng
Copy link
Author

No problem just checking... thanks for the heads up.

@ant0nyk1ng
Copy link
Author

@InsanityAutomation FYI I did a compile of 2.0.9.3 just to see if there was a Christmas miracle that some of the updates fixed my issue... but no. Have a Happy new Year.

@ant0nyk1ng
Copy link
Author

@InsanityAutomation I spent a few days looking at this and I found a way to make it work. My test yesterday proved it worked but I will do more testing.

I was looking at the line in ConfigAdv

#define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed

I took this as if you run G28X and measure the nozzle centers this number to insert... this what I have done and makes sense to know where the 2 nozzles are so I didn't question it.

Doing this puts my X2 position out, as I have outlined... now my setup I have given myself aprox 100mm clearance either side of the bed so the Extruders can Park giving the active extruder complete access to the full bed.

I was looking at it a couple of days ago and I thought "if X2 needs to travel from Max Endstop to Bed X0... it has to move Bed size plus the extra 100mm from bed to endstop" same as when you move X1 it has the negative offset from the Bed X0.

So if I add Bed Size (400mm) to the Offset (in this case 100mm) I get 500. If I measure my nozzle (or Tool) centers its 600... and so 600 would be what I have used.

But changing the #define X2_MAX_POS to 500 it all works. Now sorry I have rounded the numbers for the example but I have done this on both printers which are different sizes and it works.

I have tested this on both 2.0.7.2 and 2.0.9.3 and got the same results.

If you want more config files or a better explanation of what I am trying to say... just ask.

@ant0nyk1ng
Copy link
Author

ant0nyk1ng commented Jan 11, 2022

@InsanityAutomation I have been testing my setup with the changes as mentioned above.

Auto_Park Mode M605 S1 - Works
Duplication Mode M605 S2 - Works

Mirror Mode M605 S3 - Does Not Work
The X2 Extruder is offset 100mm towards X_Min_Pos
I set the distance M605 S2 X200 R210 then M605 S3

Configuration.zip

@ant0nyk1ng
Copy link
Author

ant0nyk1ng commented Mar 23, 2022

@InsanityAutomation

Installed this bugfix and tested.

The issue now has shifted to the offset in mirror mode but it is still not right.

This IDEX Printer has 300x300 bed and X_Min_Pos -85mm and from Bed Max to X2 Endstop is 87mm

When I set the printer offset to give me the correct alignment of X2 which is basically Bed Size (300mm) + offset of 87mm from X_Max endstop to the Bed (X300). This works as expected... so in Pronterface if I change to X2 and do G0 X0 it moved to the proper Bed X0.

If I run a Print in Mirror Mode it is still doing something odd with X2.

If I setup a print in S3D this is what I get:

My S3D Start Script:

G34 ;Home Auto Z Align
G29 ;bed level

M605 S2 X150 R0 ; R = temperature difference X = offset distance
G28X
M605 S3
G28X

G92 E0 ; Reset extruder
G1 E20 F100 ; Prime extruder 10mm
G92 E0 ; Reset extruder

M117 Printing...

test_1

I get this Print... the print is mirrored... but I did expect the right print to be equal distance from the right side as the left is from the left side?

IMG_20220323_162043

Now moving onto a new print... If I move the print to the center of left hand side of the bed, I would expect the print to be at least the center of the right half of the bed but it clashes and looks like it is printing in the same position as the previous print??

test.mp4

In the video, first you can see the print purges and the left print head is at Home but the right head has moved to the edge of the Bed Max position? Then moves to print the part but I assume X2 is traveling the "extra" 87mm from X_Max Endstop to the Bed_Max position? or something?

Here is the Config files and the print gcode

Configuration.zip

mirror_test.zip

@InsanityAutomation
Copy link
Contributor

Id agree with the initial assessment in mirror mode the offset is getting applied somehow there. Ive got a bit much on my plate atm but ill make my way towards this one to figure out why soon.

@ant0nyk1ng
Copy link
Author

@InsanityAutomation

thanks, I'll do some more prints over the next few days and make sure the other modes work 100%.

There has been some other odd issues like after G29 probing the X1 head decides to go right and crash into X2 which is beyond X1 Bed soft limit. It only happens sometimes and very random, with a reset and it's fine on the restart... hasn't with the few prints with this bug version. So I'll try to capture it happening.

Another is if you run M503 from pronterface it shows the PID's for T0 and T1 the same value and ignoring the 2 individual PID values set in ConfigH... I'll do a bug report on this as well.

@klack
Copy link
Contributor

klack commented Apr 18, 2022

Mirror mode appears to be fixed by changing:

new_pos.x = _MIN(X_BED_SIZE - x0_pos, X_MAX_POS);
to
new_pos.x = X_BED_SIZE - x0_pos;

in Marlin/src/module/motion.cpp

I'm not sure what the original intent of the line was.

@ant0nyk1ng
Copy link
Author

@klack @InsanityAutomation

Richard, I just changed the motion.cpp as you suggested and ran the test... can confirm it does work on my printer as well.

thanks Antony

@klack
Copy link
Contributor

klack commented Apr 18, 2022

@ant0nyk1ng Thanks for your hard work and documentation that led me here!

@ant0nyk1ng
Copy link
Author

@klack yeah thanks... when it comes to code I feel like I am in the dark smashing the keyboard with 2 fingers...

If you have time for small chat, I'd like to chat about IDEX printings but I guess this is not the place... do you have a forum of other IDEXers you converse with?

@InsanityAutomation
Copy link
Contributor

Original intent is to prevent the axis position from being set beyond the theoretical max position. It basically means go to the max if the current position is beyond it and points to a configuration conflict most likely.

@klack
Copy link
Contributor

klack commented Apr 18, 2022

@InsanityAutomation I have the suspicion that in this context X_BED_SIZE is somehow only reporting half of it's size. I'm going to do some debugging to confirm.

I want to create a fix that will handle the original intent. Is this a scenario that can occur in mirror mode? If the newly requested X2 position is in X1's region, then the model is improperly sliced past the mirror border. I can't see a way how the newly requested X2 position could be past MAX_X2.

@ant0nyk1ng I run the Luxuri firmware fork for a popular Idex machine (unaffiliated). Join us here: https://discord.gg/fB6y4juM

@thinkyhead thinkyhead changed the title [BUG] IDEX X2 Xaxis offset not correct [BUG] IDEX has incorrect X2 offset Apr 21, 2022
@johncarlson21
Copy link

I was having this problem when I tried to move my code from 2.0.9.x -> 2.1.x
The fix for me was in the motion.cpp file

new_pos.x = _MIN(X_BED_SIZE - x0_pos, X2_MAX_POS);

I have an X2_MAX_POS which was a bit different than the X_MAX_POS
X_MAX_POS = bed size x
X2_MAX_POS = bed size + offset

for instance my bed size is 302 ( X_MAX_POS ), but my homed position for T0 is 362 ( X2_MAX_POS )

@thisiskeithb thisiskeithb removed the Needs: More Data We need more data in order to proceed label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants