-
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
FTMotion: Fix TMC2208 timing bug (attempt) #28257
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
base: bugfix-2.1.x
Are you sure you want to change the base?
FTMotion: Fix TMC2208 timing bug (attempt) #28257
Conversation
|
The situation with TMC2225 (TMC2208) has been corrected. My settings for FTM, Creality 4.2.7 board: #define X_DRIVER_TYPE TMC2208_STANDALONE
#define Y_DRIVER_TYPE TMC2208_STANDALONE
#define Z_DRIVER_TYPE TMC2208_STANDALONE
#define E0_DRIVER_TYPE TMC2208_STANDALONE
#define FTM_IS_DEFAULT_MOTION
#define NO_STANDARD_MOTION
#define FTM_DEFAULT_SHAPER_X ftMotionShaper_ZVD
#define FTM_SHAPING_DEFAULT_FREQ_X 40.0f
#define FTM_DEFAULT_SHAPER_Y ftMotionShaper_ZVD
#define FTM_SHAPING_DEFAULT_FREQ_Y 40.0f
#define FTM_DEFAULT_SHAPER_Z ftMotionShaper_NONE
#define FTM_SHAPING_DEFAULT_FREQ_Z 21.0f
#define FTM_SHAPER_E
#define FTM_DEFAULT_SHAPER_E ftMotionShaper_NONE
#define FTM_SHAPING_DEFAULT_FREQ_E 21.0f
#define FTM_SMOOTHING
#define FTM_SMOOTHING_TIME_E 0.06f
#define FTM_POLYS
#define FTM_TRAJECTORY_TYPE POLY5
#define FTM_BUFFER_SIZE 2048
#define FTM_FS Before the fixes related to TMC2225 (TMC2208), the extruder would stop: n-1.mp4After corrections in this PR, stoppages due to TMC2225 (TMC2208) are no longer observed. |
|
@dbuezas , I missed @yrabbit success. In my mind this should be mandatory if a faulty driver is present: TMC2208 or TMC5160. You could remove the related code in #define _OR_ADTX(N,T) || AXIS_DRIVER_TYPE_X##N(T)
#define HAS_X_DRIVER(T) (0 RREPEAT2(NUM_X_STEPPERS, _OR_ADTX, T))
#define _OR_ADTY(N,T) || AXIS_DRIVER_TYPE_Y##N(T)
#define HAS_Y_DRIVER(T) (0 RREPEAT2(NUM_Y_STEPPERS, _OR_ADTY, T))
#define _OR_ADTZ(N,T) || AXIS_DRIVER_TYPE_Z##N(T)
#define HAS_Z_DRIVER(T) (0 RREPEAT2(NUM_Z_STEPPERS, _OR_ADTZ, T))then at the end of this file #if ENABLED(FT_MOTION)
#if HAS_X_DRIVER(TMC2208) || HAS_X_DRIVER(TMC2208_STANDALONE) || HAS_X_DRIVER(TMC5160) || HAS_X_DRIVER(TMC5160_STANDALONE)
#define APPLY_TIMING_HACK_ON_X
#endif
#if HAS_Y_DRIVER(TMC2208) || HAS_Y_DRIVER(TMC2208_STANDALONE) || HAS_Y_DRIVER(TMC5160) || HAS_Y_DRIVER(TMC5160_STANDALONE)
#define APPLY_TIMING_HACK_ON_Y
#endif
#if HAS_Z_DRIVER(TMC2208) || HAS_Z_DRIVER(TMC2208_STANDALONE) || HAS_Z_DRIVER(TMC5160) || HAS_Z_DRIVER(TMC5160_STANDALONE)
#define APPLY_TIMING_HACK_ON_Z
#endif
#if HAS_E_DRIVER(TMC2208) || HAS_E_DRIVER(TMC2208_STANDALONE) || HAS_E_DRIVER(TMC5160) || HAS_E_DRIVER(TMC5160_STANDALONE)
#define APPLY_TIMING_HACK_ON_E
#endif
#endif // FT_MOTION |
|
The issue only appears on stealthchop only, so better be configurable to avoid it applying on machines set to spreadcycle |
|
At least for standalone drivers (stealthchop by default and not modifiable). |
|
Well, for non standalone too if the user set them as stealthchop, and I don't think the 5160s are affected. |
Most standalone drivers are set to stealthchop, you usually need to solder a pair of pads to enable spreadcycle if stepsticks. With onboard drivers, all bets are off. |
| * Other axes keep moving normally, and the wait is cancelled if the axis flips again. | ||
| * | ||
| */ | ||
| #if AXIS_DRIVER_TYPE_X(TMC2208) || AXIS_DRIVER_TYPE_X(TMC2208_STANDALONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does TMC2209 / TMC2225 differ so that it doesn't stall?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to ask tmc. It's a known bug of the 2208
b0f6e09 to
e4aba1b
Compare
Description
TMC2208 Direction-Flip Delay
Some TMC2208 / TMC2208_STANDALONE setups may require a short delay after a DIR change
to avoid timing-sensitive glitches, especially when using stealthChop.
When enabled for an axis, FT Motion will "pause" that axis for > 750µs after a detected
direction flip by holding its trajectory coordinate constant for a multiple of FTM_TS
frames. For the default FTM_FS = 1000, it is a single 1ms frame.
Other axes keep moving normally, and the wait is cancelled if the axis flips again.
NOTE: Typically only needed if you actually use stealthChop on that axis.
Requirements
Benefits
Configurations
FTM + 2208 drivers in stealthchop
Related Issues
Hopefully fixes #28248