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

Make X axis optional (WIP) #25418

Merged
merged 37 commits into from
May 9, 2023

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Feb 23, 2023

Description

Add support for making X optional also (so having only an Extruder is a possibility.)

Benefits

More modularity, smaller code for extruder-only projects.

@ellensp
Copy link
Contributor Author

ellensp commented Feb 23, 2023

I've done all the obvious code, now i'm stuck in "macro hell"

Can anyone lend a brain to assist?

alextrical and others added 3 commits February 23, 2023 11:31
Set conditional check from Y to X
Changed pattern of axis definition to match existing nested pattern
@thinkyhead
Copy link
Member

thinkyhead commented Feb 23, 2023

I believe this is essentially impossible given the current Marlin architecture. As a basic point, the type XYZval and all the types that derive from it become empty. An empty type that occupies no memory can't be allocated or referenced, so all kinds of core Marlin code becomes broken. There is a fundamental assumption that there will be at least one linear axis, and the number of conditional changes throughout the code to drop that assumption is simply overwhelming.

@thinkyhead thinkyhead force-pushed the mkae-X-optional branch 2 times, most recently from a5c4c64 to 4418caa Compare February 23, 2023 21:45
@thinkyhead thinkyhead force-pushed the mkae-X-optional branch 10 times, most recently from 529e751 to b2da2e2 Compare February 23, 2023 23:13
@thinkyhead
Copy link
Member

…or maybe…. Apparently a zero-length array is possible, and maybe empty structs. At any rate, it's now compiling, so that's a pleasant surprise.

@ellensp
Copy link
Contributor Author

ellensp commented Feb 24, 2023

just talking a look at it now, complies, uploads, responds to gcode ... I need to find an extruder I can play with...

@thisiskeithb
Copy link
Member

Some hacky stuff was done to the BTT EBB42 pins in #24964 to make Marlin compile without an x/y/z axis, so that should probably get cleaned up here as well:

//
// Steppers
//
#define X_ENABLE_PIN -1
#define X_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
#define X_DIR_PIN -1
#define Y_ENABLE_PIN -1
#define Y_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
#define Y_DIR_PIN -1
#define Z_ENABLE_PIN -1
#define Z_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
#define Z_DIR_PIN -1

@ellensp
Copy link
Contributor Author

ellensp commented Feb 24, 2023

@thisiskeithb that is part of the plan, but a sperate pr

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 3 times, most recently from 27df113 to 8d31429 Compare March 25, 2023 04:25
@alextrical
Copy link
Contributor

Fix for 0 kinematics (Flash?) EEPROM has been submitted

@alextrical — Where exactly was it submitted? image

@thinkyhead Sorry I found that there was an issue and tried to roll back the PR, it caused an issue that prevented the board from running code when Virtual EEPROM was enabled, presumably caused by memory locations.
Most likely it was this branch https://github.com/alextrical/Marlin/tree/Make-x-optional-eeprom-fix

@thinkyhead
Copy link
Member

what else needs done here?

As PRs go this one is a biggie! I was holding it until after 2.1.3, which was anticipated to happen a lot sooner. I've merged to bring it up to date, so now it should be tested again to make sure all the basic functions work when there's only an extruder and nothing else. That includes the EEPROM, to see whether the comment above still applies.

I don't anticipate any major troubles with this PR generally, but it does continue to lean into the old ways. Once this next release is out the door (and patched up in a followup minor release), we should look at refactoring more in the direction of templates, compiler dead-code stripping, and so on. It would be neat to get more formal object classes like Motor and Fan and so on to better encapsulate common components. Working on Fixed-Time Motion got me looking at the motion code more closely, and I believe we can make it a lot more concise, but it might be a little daunting at first.

I do want to get 2.1.3 released soon. I just have to re-test the probing and G34 behavior, fix up Fixed-Time Motion as much as possible, and then do a couple of test prints to make sure there are no unexpected instabilities. At the very least, I want 2.1.3 to be an improvement over 2.1.2, effectively addressing all reported issues, and at the moment I'm cautiously optimistic.

@thinkyhead thinkyhead merged commit 1f9bfc5 into MarlinFirmware:bugfix-2.1.x May 9, 2023
ncksnydr added a commit to ncksnydr/Narungol-Marlin-Firmware that referenced this pull request May 9, 2023
… into feature/bugfix-2.1.x

* 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin: (302 commits)
  🚸 Optional X-Axis (MarlinFirmware#25418)
  [cron] Bump distribution date (2023-05-09)
  🧑‍💻 PI => M_PI
  🧑‍💻 Extend AxisBits
  🐛 Fix babystep corrupting DIR
  🔨 MKS Robin2 PIO Env (MarlinFirmware#25792)
  [cron] Bump distribution date (2023-05-08)
  🩹 Creality F401 Followup
  🐛 Fix Babystepping for CoreXZ
  🩹 Use AxisBits methods
  [cron] Bump distribution date (2023-05-07)
  🩹 Endstops prelim. followup
  🚸 Faster default Marlin feedrate
  🐛 Apply direction bits at startup
  🔧 Apply bootscreen settings to ProUI
  🩹 FT Motion prelim followup
  🧑‍💻 Endstops preliminary followup
  🐛 Minor Fixed-Time Motion patches
  🔧 Allow TMC_BAUD_RATE override
  🧑‍💻 Endstops preliminary work (MarlinFirmware#25780)
  ...

Signed-off-by: Nick Snyder <[email protected]>

# Conflicts:
#	config/ncksnydr/narungol/2.1/Configuration.h
#	config/ncksnydr/narungol/2.1/Configuration_adv.h
@rondlh rondlh mentioned this pull request May 10, 2023
1 task
@ellensp ellensp mentioned this pull request May 10, 2023
@ellensp ellensp deleted the mkae-X-optional branch May 10, 2023 10:40
oponyx pushed a commit to oponyx/Marlin that referenced this pull request May 12, 2023
Co-authored-by: alextrical <[email protected]>
Co-authored-by: Scott Lahteine <[email protected]>
@vosk
Copy link

vosk commented May 14, 2023

Hello all, I believe this or the previous PR in the series broke the backlash menu for XYZE printers, HAS_A_AXIS is now undefined in _CAN_CALI(A) used in menu_backlash.cpp. Since this is WIP apparently, feel free to ignore. Otherwise adding another 3 clauses for X Y Z ( A B ...) looks an obvious quickfix.
EDIT: This may be the actual cause:
4233e48#diff-d815bc244111b340f481976e8586e14084caeb10c74192a35a5bba39c0b7d0a1

@xxxajk
Copy link
Contributor

xxxajk commented May 16, 2023

For laser, Z is optional (which my table is manual Z adjustment).
You might be able to find some clues as to what I did to fix things to get them right in my own branch, but I need to update it in sync with the current branch...

EvilGremlin pushed a commit to EvilGremlin/Marlin that referenced this pull request May 17, 2023
Co-authored-by: alextrical <[email protected]>
Co-authored-by: Scott Lahteine <[email protected]>
tspiva pushed a commit to tspiva/Marlin that referenced this pull request May 25, 2023
Co-authored-by: alextrical <[email protected]>
Co-authored-by: Scott Lahteine <[email protected]>
Andy-Big pushed a commit to Andy-Big/Marlin_FB_Reborn that referenced this pull request Jul 15, 2023
Co-authored-by: alextrical <[email protected]>
Co-authored-by: Scott Lahteine <[email protected]>
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.

7 participants