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

Thread to shoulder, custom thread, multi-start threads (and menu to use). #232

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

kwackers
Copy link

I've added a menu system selected by the 'Set' button, when activated you can step through the current (three) options using the '+' & '-' keys. A further press of 'Set' selects that menu item. If no button is pressed the menu will time out after a few seconds.

Whilst I've broadly followed the coding style it's probably drifted in a few places and may not exactly follow the intended design exactly. It would be fairly easy for me to make any required changes if so desired.

A quick synopsis of the functionality.

The three options are "Custom Thread", "Thread to Shoulder" & "Position".

Position is a simple utility that swaps RPM for angular position of the spindle.

Custom Thread, shows a metric thread with the first digit flashing. You can change this using the '+' & '-' buttons and press 'Set' to move on to the next digit. When all digits have been entered the entered pitch will be the current one.
At any point during this process pressing 'Pwr' once will exit (but the displayed value will be used as the current pitch).

Shoulder allows threading to a shoulder (and multi-start threads).
It first queries for the number of starts (1-9) the default value of 1 is a standard single start thread.
Next it queries for the shoulder position, move the carriage to the final position for the shoulder and engage the half nuts if not already engaged (these must remain engaged for the duration of the thread).
Press 'Set' to set the shoulder position.

Next it queries for the start position, move the carriage to the start by rotating the spindle.
Once at the start press 'Set' to set the start.

It now enters the threading loop showing 'Begin n.x' where 'n' is the start and x is the number of starts on the thread (these will index each time through the loop). For a standard single start thread this will simply remain at 1.1.

Cut the thread as normal and the carriage will automatically stop at the shoulder.
It will now display "Stop" and wait for the spindle to be stopped.
Next it display "Retract" - retract the tool from the work and press either '+' or 'Set', this will cause the carriage to move back to the start (actually slightly past in order to sync the spindle and carriage).

At this point the display will show "Begin n.x" and we can repeat the process to cut the next pass / start.

Press 'Pwr' once to exit the mode at any point.

One further change allows the brightness of the display to be set when in power off state using the '+' & '-' buttons.
I did consider adding a menu item for this but it seems like unnecessary clutter and mine always starts in this state anyway.

…read mode. + key can be used to move to start of thread.
@kwackers
Copy link
Author

kwackers commented Nov 8, 2022

If I was to use the “thread to shoulder” , how should I proceed? I’m using a nema34 stepper, Thanks

You need to download the code from my (kwackers) fork, build and flash your ELS with it.
(And make any modifications to the settings you already had for your leadscrew pitch, motor etc).

Once you've done that then the 'Set' button should call up a menu, first option is 'Custom Thread', press '+' to move on to the next option 'Shoulder'.

You'll then be asked for the number of starts, just press 'Set' to accept the default (1).
It'll then ask for the shoulder position, move the tool to where the shoulder is, engage the half nuts and press 'Set'.
Next it'll ask you for the position of the start, at this point simply reverse the lathe to wind the tool back to the start and press 'Set'.

We're now in the 'threading loop' which we'll repeat until we're done.
The display will show "Begin", set the depth of cut and start the lathe.
When the tool reaches the shoulder it will automatically stop and the display will show 'Stop'.
Stop the spindle, display now shows 'Retract', retract the tool from the work.
Now press '+' and the carriage will automatically move back to the start and you can repeat this section with progressively deeper cuts until your done.

It sounds more complex than it is but basically you set the positions of the shoulder and start.
Then you cut a thread as normal until it stops and then press '+' to go back to the start, rinse and repeat.

@OG1-SS
Copy link

OG1-SS commented Nov 8, 2022

kwackers Thank you for this. I am very excited to try it. I stopped using this interface and went with an import setup just to get this feature so thanks a ton! Pardon my ignorance in understanding. Will math be required to thread imperial or will it have the option to choose imperial or metric?

@kwackers
Copy link
Author

kwackers commented Nov 8, 2022

kwackers Thank you for this. I am very excited to try it. I stopped using this interface and went with an import setup just to get this feature so thanks a ton! Pardon my ignorance in understanding. Will math be required to thread imperial or will it have the option to choose imperial or metric?

The imperial/metric works exactly as before so just select your thread pitch before you start 'thread to shoulder'.

If however you use the 'custom thread' mode I also added then that only allows you to enter metric values in which case if you needed a custom imperial thread then you'd have to calculate the metric equivalent.
(I use the custom thread for the occasional BA thread I use).

@johnsonm
Copy link

johnsonm commented Apr 2, 2023

This PR and its associated repository are why I finally ordered all the parts for the ELS. ❤️

@digiexchris
Copy link

Yeah I hope this seriously gets considered for merge. This missing feature is why I went with a nanoels h2 instead. Quick question, why is stopping the spindle before retracting a requirement?

@kwackers
Copy link
Author

Yeah I hope this seriously gets considered for merge. This missing feature is why I went with a nanoels h2 instead. Quick question, why is stopping the spindle before retracting a requirement?

Main reason is laziness.
I've considered changing it so it doesn't have to but I'd need to accelerate the carriage whilst simultaneously trying to get into sync.
In fact if you manually turn the spindle whilst it's retracting then it essentially has to do this anyway.
The difference is that manually you'll be rotating fairly slowly so there's no abrupt change in speed required.

So it can be done but I stopped at the point it was functional. Perhaps I'll take a look if I get some spare time.

@digiexchris
Copy link

digiexchris commented Apr 10, 2023 via email

@kwackers
Copy link
Author

Honestly I have it a try on nanoels, and just leave it up to the closed loop stepper. The driver takes care of overspending and getting back into the right position, and I just need to leave enough lead-in before the thread.

You can try it easily enough with a closed loop stepper - there's just a state machine in Userinterface.cpp that sits and waits for the spindle to stop before progressing - if you didn't do that...
I haven't tried it myself since I don't have a closed loop stepper but I'd be interested in knowing what happens.
(Could be made a #define in the configuration.h file)

@johnsonm
Copy link

I have a servo and I'm happy to experiment with this in a few weeks, after I finish building and installing the hardware.

Additionally, @clough42 if you don't want to merge this PR as it stands because it changes the base config, I'd be happy to help by making a rebased version that separates out the features from config changes.

I have an imperial lead screw and I cut mostly metric threads, so I have to keep the half nut engaged from the moment I start cutting threads to the time I'm done, including moving the carriage away from the part if I need to do a test fit. So I'm motivated to help out here. ☺

@kwackers
Copy link
Author

One thing that did occur to me is if you don't stop the spindle then it'll move back to the start position and immediately start cutting the next pass of the thread.
Except of course that the cutter will still be retracted so it won't...

So you probably need it to wait at the start position and get it to ask you to engage the cutter.

@johnsonm
Copy link

It needs to wait for something

Easiest thing is to just have it wait for + again.

@johnsonm
Copy link

@kwackers do you mind if I do a rebase of your work on top of @clough42 's default configuration in order to make it easier both for James to merge it and (until such time as he does merge it) to make it easier for other users to merge into their repositories on top of their own configuration?

@OG1-SS
Copy link

OG1-SS commented Apr 13, 2023

I would love that if so.

@kwackers
Copy link
Author

@kwackers do you mind if I do a rebase of your work on top of @clough42 's default configuration in order to make it easier both for James to merge it and (until such time as he does merge it) to make it easier for other users to merge into their repositories on top of their own configuration?

Nope, absolutely do whatever you think necessary.

Just remember the old "programmers rule".
'He(she) who touches it last owns it'

@johnsonm
Copy link

OK, @clough42 if it will help you merge this work I'm happy to contribute this way since @kwackers is OK with it. I estimate a few hours of work to rebase it into a set of commits that would be easier to review. I just don't want to throw that time away if you aren't interested.

@blackfister blackfister mentioned this pull request Apr 25, 2023
@blackfister
Copy link

Finally got it working!
custom threads, angle position
However when I use shoulder, as it retracts, I loose sinc with the thread. Shoulder set, start set. Nut engaged.
anyone with this issue? I run a nema 42 stepper, a 1:1 spindle encoder/ stepper, and an 8tpi leadcrew

@kwackers
Copy link
Author

Finally got it working! custom threads, angle position However when I use shoulder, as it retracts, I loose sinc with the thread. Shoulder set, start set. Nut engaged. anyone with this issue? I run a nema 42 stepper, a 1:1 spindle encoder/ stepper, and an 8tpi leadcrew

Not sure why it would lose sync assuming it's working correctly for normal threading use.
Have you got the latest build from my branch?
Any chance it's losing steps when retracting?
You do stop the spindle motor first before pressing retract?
You don't disengage the leadscrew at any point during the process?

It would be a bit weird for it only to happen to you.
What are the settings you're using? i.e thread pitch your using, and the various config settings.

@blackfister
Copy link

Hi Kwakers, thank you for answering, could it be that it’s loosing steps as retracting? I’m testing at low speed, 42rpm.
everything being used as it should. Shoulder set, nut engagement, start setting. Wait to see “stop display “, set, goes back. Stops. Begin.
Will try to post a video tomorrow.
Tried 1,5mm 2mm and 8mm. All with shortage.
Setting them both in cloughs and in your custom thread.
If I do custom thread works great. Position works great.

@javaduke
Copy link

javaduke commented Jun 6, 2023

Folks, pardon my annoyance, what's the latest status on this? I would love to have this functionality, but I don't want to lose all the fixes and updates in the James' latest official firmware. Would it be possible to rebase it onto the head?

@kwackers
Copy link
Author

kwackers commented Jun 6, 2023

Folks, pardon my annoyance, what's the latest status on this? I would love to have this functionality, but I don't want to lose all the fixes and updates in the James' latest official firmware. Would it be possible to rebase it onto the head?

At the moment the fork at https://github.com/kwackers/electronic-leadscrew is ahead of James's version which means it includes all the fixes and updates in his.

Whether it'll ever be rebased into the head who knows. Worse case he updates the current version with new stuff in which case you can always re-flash the firmware to his version.

@javaduke
Copy link

javaduke commented Jun 6, 2023

Ah, that's right, sorry, I didn't notice that :) ok then, off we go, thank you!

@blackfister
Copy link

blackfister commented Jun 21, 2023

Hi Kwakers, as for the shortage sinc I did mention before, while retracting on shoulder mode, when lo load is applied, the carriage retracts perfectly. I attach vidrio with micrometer.
as I cut a thread, I loose approximately 2/10 mm, on each pass, measured with micrometer. Didn’t try to compensate with charriot adjustment.
I guess I might have some play in between the spindle and back gears.
Ps, how do I exit positioning? Just turn on/of?

@kwackers
Copy link
Author

Hi blackfister, not sure why you would lose positing when you cut a thread - if you don't actually make the cut do you still lose position?
Bear in mind that when retracting it won't always retract to exactly the same place each time - it allows up to 1 thread depth since it needs to allow for the current angular position of the head.
What's important isn't that it retracts to exactly the same place but that it's position along the thread is maintained (you'd also expect the shoulder to be in the same place each time).

To exit just press power once (in any of the modes I've added pressing power once behaves like a cancel button, press it again to power off).

@blackfister
Copy link

Everything is working excellent!
For threads above 9,99, can a table be created? Should I change spindle/ encoder ratio?
Thank you

@johnsonm
Copy link

@kwackers Your branch is why I chose this ELS; thread to shoulder was the straw that broke the camel's back and got me to make this change.

My implementation (#270) is now working, and thread to shoulder is amazing! Thank you so much for your work here.

I just wanted to say thank you.

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

6 participants