Skip to content

Resonance Test : for Fixed Time motion system and/or standard motion system#28282

Open
narno2202 wants to merge 72 commits into
MarlinFirmware:bugfix-2.1.xfrom
narno2202:FTM_Reso_refact
Open

Resonance Test : for Fixed Time motion system and/or standard motion system#28282
narno2202 wants to merge 72 commits into
MarlinFirmware:bugfix-2.1.xfrom
narno2202:FTM_Reso_refact

Conversation

@narno2202
Copy link
Copy Markdown
Contributor

@narno2202 narno2202 commented Jan 15, 2026

Description

After refactoring ResonanceGenerator class and files location, I add the resonance test to standard motion. The resonance test could run either in FT_MOTION or in standard motion system. ResoanceGenerator has been improved to deal with MCU without FPU.

  1. FTM_RESONANCE_TEST is renamed RESONANCE_TEST which is defined in Configuration_adv.h.
  2. resonance_generator.h and .cpp are moved to the src/feature/resonance/ folder, and M495_M496.cpp to the gcode/feature/resonance folder. M495 and M496 are no more linked only to FT_MOTION.
  3. features.ini is modified accordingly and #include directives have been updated.
  4. rtg is defined as extern ResonanceGenerator rtg in resonance_generator.h .
  5. 2 new functions are created in stepper.cpp and stepper.h, resonance_pulse_phase_isr() and resonance_block_phase_isr(). This avoids multiple preprocessor directives (code is more readable).
  6. The menu is kept in the motion menu but outside FT_MOTION menu.
  7. Last improvement : fixed point arithmetic in resonance.cpp and resonance.h

The speed is constant for standard motion and is 100mm/s (8000 steps/s with "standard" 80 steps/mm) for X and Y axis and 2000 steps/s for Z axis. The time constant is 0.001s (same value as in basic FT_MOTIONconfiguration). Please test and report.

Requirements

RESONANCE_TEST enabled

Benefits

Improve ResonanceGenerator class, resonance test available for FT_MOTION and standard motion system

Configurations

Related Issues

None

@narno2202 narno2202 changed the title FTM : refactor ResonanceGenerator Class and files Resonance Test : for Fixed Time motion system and/or standard motion system Jan 24, 2026
@narno2202
Copy link
Copy Markdown
Contributor Author

@dbuezas, I have a fixed point arithmetic version (my first experience with it). I struggled with motion drift both with FT_MOTION and the standard motion system (cumulative errors), but now it seems ok. Could you have a look please. Just replace the 2 files in the feature/resonance folder with these in the zip file.
resonance_generator.zip

@dbuezas
Copy link
Copy Markdown
Contributor

dbuezas commented Feb 1, 2026

sure, can you send me a link to a commit with those changes so i can see on my phone and comment?

@narno2202
Copy link
Copy Markdown
Contributor Author

For now, I just have a local development environment. All is based upon this PR; only resonance_generator.cPp and .h are different the files in the zip).

@dbuezas
Copy link
Copy Markdown
Contributor

dbuezas commented Feb 1, 2026

Please make a branch, commit those changes and send me a link to it

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 3 times, most recently from 1bc0732 to 72c7874 Compare March 27, 2026 20:33
@thinkyhead
Copy link
Copy Markdown
Member

Getting this merged and then will merge into yesterday's PR for 2208….

@thinkyhead thinkyhead force-pushed the FTM_Reso_refact branch 5 times, most recently from 3ae3ee7 to 9137691 Compare April 11, 2026 22:01
thinkyhead added a commit to MarlinFirmware/Configurations that referenced this pull request Apr 11, 2026
@Nuck-TH
Copy link
Copy Markdown

Nuck-TH commented May 6, 2026

Is this ready for merge?

Current exiter code is broken as noted in #28383

@narno2202
Copy link
Copy Markdown
Contributor Author

It's fixed point arithmetic for standard motion and FT_MOTION. There is no longer a relationship to FTM_TS in FT_MOTION. Testing and feedback are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants