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

Add optional config for more thread specs, default thread/feed on start #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnsonm
Copy link

@johnsonm johnsonm commented Apr 13, 2023

The original thread tables are small, which makes sense for a UI in which you have to click through them all one by one, but there are other thread specs that a user might be interested in.

I have entered extra thread specs in both inch and metric. I used the threads that my G0709 supports natively as a model. Some of the thread specs could not be represented with the existing macros, so I increased their precision by an order of magnitude, and shifted the display to improve the experience scrolling through thread specs by making the decimal point move as little as possible.

I made the extra threads default to not being compiled in, such that by default the only user-visible change is a cosmetic change of justification for more consistency in decimal point location, and a leading zero for metric threads smaller than 1mm pitch (making it consistent with @kwackers' work, to make it easier to resolve the merge conflict there).

In order both to preserve the default thread pitches regardless of the thread table extension and make the default thread pitches configurable, I promoted the thread and feed default indexes to configuration.

Hopefully this also makes it easier for others to add custom thread pitches to their own custom tables, if they need the extra precision required for a few standard threads.

Fixes #254

@johnsonm johnsonm force-pushed the extended-thread-spec branch 2 times, most recently from 40dc9d9 to 0dda30a Compare April 13, 2023 22:04
@johnsonm
Copy link
Author

Here's some accompanying documentation for https://github.com/clough42/electronic-leadscrew/wiki/Configuration-Settings that you can copy in when merging this PR:

## Defaults
There are four `_INDEX` defines that allow you to choose the inch
and metric threads and feeds that are set by default at initialization.
They default to 24TPI inch threads, 0.5mm pitch metric threads,
5 thou inch feed, and .012mm metric feed. There are four tables in
Tables.cpp, and these select the offset in that table. Note that
the index starts at 0, so to default to 1 thou feed, you would
choose `#define INITIAL_INCH_FEED_INDEX 0`.

If you want additional thread specifications in inch or metric,
you can uncomment one or both of these configurations:

`//#define EXTENDED_INCH_THREADS`
`//#define EXTENDED_METRIC_THREADS`

Note that this will require cycling through more intermediate
thread pitches.

@patl1
Copy link

patl1 commented Jun 11, 2023

Michael, I am interested in have a default feed rate when I start the controller. From reading your comment above, it looks like what you have implemented. How do I go about getting the code or at least some more specifics on how to implement it in the firmware. I have a fairly good understanding of the C++ language, but am struggling a little on the flow of the program and the variables used.

@johnsonm
Copy link
Author

This PR makes it easier to select the default rate, but the end of the commit shows where I change it from literal integer indexes to configuration.

0dda30a#diff-9952d6aafa9122f9852bae52a4ccd97a495f3bb3dbde28fdb21c2078cc5fdc01L244

@patl1
Copy link

patl1 commented Jun 12, 2023

Thank you, now I understand what you did. It wasn't clear to me where the able index #s

@johnsonm
Copy link
Author

johnsonm commented Jul 28, 2023

Not having a blank between the RPM and the feed rate makes it hard to distinguish the two numbers in practice, especially when a whole number is displayed.

  • Can leave a BLANK or POINT at the start of the rate display instead of ZERO | POINT
  • Can shift the decimal around only for inch threads, only where necessary
  • Can leave off the final FIVE and say that it's implied by .x2 or .x7

I prefer metric, at least, with leading zero, but I think I'm going to drop all those leading ZERO for the metric displays in order to create visual separation between the numbers.

@johnsonm
Copy link
Author

After redesigning my hardware, I have been able to test this. I have not cut the full gamut of pitches, but the approach works, and using the position mode in @kwackers branch I have validated this more precisely than a thread gauge allows using a dial indicator to measure travel.

@clough42 I would suggest that this is ready to merge.

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.

Thread table calculation limitations
2 participants