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

3.5 hangprinter: Allow custom and prism-like setups #603

Open
wants to merge 4 commits into
base: 3.5-dev
Choose a base branch
from

Conversation

jtimon
Copy link
Contributor

@jtimon jtimon commented Mar 5, 2023

In addition to allow any pseudo-pyramid as in #598 which this PR depends on, this allows to setup hangprinters without a middle anchor.

This doesn't require any extra anchors. One could, for example, set each of the 4 anchors in one top corner of a room, resulting in a quadrangular prism printing volume. Or it could be used to move cameras in stadiums and whatnot.

For that we just set all the anchors on top.
It also allows a "None" anchor mode which always IsReacheable always returns true, which is interesting for people experimenting with potential future modes not contemplated yet, like halfTop-halfDown setups.

Dependencies:

Outdated
~~
Two options come to mind:

A) Allow users to manually select it by adding some parameter in M669. If we chose this option, any suggestion?
B) Calculate whether the last anchor is "in the middle" or not. Probably I should explain with code what I mean by "in the middle" rather than trying it in english to avoid misunderstandings.
~~

@jtimon jtimon force-pushed the 3.5-hangprinter-allow-prism branch 2 times, most recently from 582347e to 7101a2c Compare March 14, 2023 00:02
@jtimon
Copy link
Contributor Author

jtimon commented Mar 14, 2023

Now it depends on #597 too, not just #598 as before.
The configuration for the new option is still not properly tested or documented.
But we're getting closer.

@jtimon jtimon force-pushed the 3.5-hangprinter-allow-prism branch 2 times, most recently from 1bd250d to 7f30701 Compare March 18, 2023 00:54
@jtimon jtimon changed the title 3.5 WIP: hangprinter: Allow prism-like setups 3.5 hangprinter: Allow prism-like setups Mar 18, 2023
@jtimon jtimon changed the title 3.5 hangprinter: Allow prism-like setups 3.5 hangprinter: Allow custom and prism-like setups Mar 18, 2023
// 0=None, 1=last-top, 2=all-top, 3-half-top, etc
uint32_t unsignedAnchorMode = (uint32_t)anchorMode;
gb.TryGetUIValue('T', unsignedAnchorMode, seen);
if (unsignedAnchorMode <= (uint32_t)HangprinterAnchorMode::AllOnTop) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could add an else part here to return an error if somebody tries to chose an option that's not supported, no?
I mean, right now it goes to the default which is the regular hangprinter, I think that's good enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this?
reprap.GetPlatform().Message(ErrorMessage, "M666 A?: Invalid anchor mode\n");
Nice to have, especially for ourselves during the time we will be testing different binaries and might forget which one is on the machine ;-)

@jtimon
Copy link
Contributor Author

jtimon commented Mar 18, 2023

Updated code, description and title. In my eyes it is ready (and the two PRs it depends too). I'm probably still missing some things or doing something wrong. Eager to fix whatever is left.

Otherwise it gets too deep.
I think there's an option in eclipse to forbid this by project in
format, one can config depness iirc.
@jtimon jtimon force-pushed the 3.5-hangprinter-allow-prism branch from 7f30701 to d51a945 Compare March 20, 2023 22:39
This is a clean generalization from 4 to N.
Pseudo-pyramid because the vertices in the base of the pseudo-pyramid
don't need to be on the same plane. There's no base of the pyramid as such.

Better documented and cleaner thanks to @tobbelobb on github.
…etups

- Change from bool to class and introduce None mode for
custom (experimental) setups (all allowed)

- refactor out IsInsidePyramidSides

- refactor out IsInsidePrismSides

- introduce HangprinterAnchorMode::LastOnTop for prism-like setups
  with all anchors on top

- introduce a T parameter in M666 to configure the anchor mode
}

bool HangprinterKinematics::IsInsidePrismSides(float const coords[3], unsigned const discount_last) const noexcept
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these function names

ok = f->Write(scratchString.c_str());
if (!ok) return false;

scratchString.printf(" U%.3f", (double)mechanicalAdvantage[0]);
Copy link
Contributor

@tobbelobb tobbelobb Mar 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print integers after U.
" U%d", (int)mechanicalAdvantage[0] or " U%u", (unsigned)mechanicalAdvantage[0]
It's block-and-tally style gearing ratio, so can only be 1, 2, 3, 4, ...

ok = f->Write(scratchString.c_str());
if (!ok) return false;

scratchString.printf(" O%.3f", (double)linesPerSpool[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print integers after O. Lines per spool can also only be natural numbers 1, 2, 3, 4, ....

ok = f->Write(scratchString.c_str());
if (!ok) return false;

scratchString.printf(" L%.3f", (double)motorGearTeeth[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motor gear teeth is also a natural number

ok = f->Write(scratchString.c_str());
if (!ok) return false;

scratchString.printf(" H%.3f", (double)spoolGearTeeth[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integer

ok = f->Write(scratchString.c_str());
if (!ok) return false;

scratchString.printf(" J%.3f", (double)fullStepsPerMotorRev[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integer

@tobbelobb
Copy link
Contributor

Oh, I commented in the wrong PR again. Seems like the scratchString double prints who shuold have been int prints first appeared in #601

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants