Electronic Lead Screw Mod

lesrhorer

Registered
Registered
Joined
Jul 6, 2021
Messages
358
Many of you may be familiar with James Clough's Electronic Lead Screw project. For any of you who are not, and do not own a CNC lathe, I strongly encourage you to take a look at this project on YouTube. It is quite straightforward, and a fairly inexpensive upgrade to any manual lathe, especially if, like mine, your lathe uses change gears rather than a lever shift transmission, or even worse, again like mine, does not have a reverse threading capability.

One thing currently missing from James' ELS is the ability to turn or thread to a shoulder. Adding this feature would really make this system a truly spectacular machine, giving my lowly Chinese import lathe much of the functionality of lathes costing tens of thousands of dollars. (Not the rigidity, power, accuracy, etc. of those machines, of course, but then what can one expect for around $1500?)

The entire project is open source, so there is no issue whatsoever in making modifications. The only issue for me is I know virtually nothing about C++, and almost the entire software suite is written in C++. I looked at the code, and it is very well written with reasonable amounts of comments in the code. I think anyone more familiar with C++ than I would no doubt be able to easily modify the code to allow turning and threading to a shoulder. James is evidently extremely busy, so I don't want to burden him with my shortcomings, but he has expressed an interest in having such a feature added to the code.

Id there anyone here who is fairly experience in coding in C++ and would be willing to collaborate with me on this project. I already have what I think are good ideas on work flow implementation. I just need someone who can translate that into code.
 
The catch with this is going to be removing the tool from the cut. The code/sensor isn't that bad, but the ELS has no provision for tool control. And it would need to be fast. Or is your goal just to stop the carriage like disengaging the half nuts would? If that is the case, why not just thread away from the shoulder like the Joe Pie method?
 
I have the Clough42 ELS in my lathe. I added a microswitch to my stop for a sensor but subsequently removed it. Threading to a shoulder will be problematic. If the stepper motor is disengaged, you lose synchronization much like disengaging the gear train. The only viable way would be for that.is to stop the lathe spindle which means having control of the motor drive. It can be used for turning to a shoulder as sync isn't required.

I tried disabling the stepper drive but the problem is that my stepper requires that the step direction and pulses be set prior to re-enabling so some weird actions occurred.. Going through some more sophisticated control via software could fix that though. My current solution to dealing with threading to a shoulder was to convert the a PWM dc motor drive which allows me to slow down to zero spindle rpm as I approach a shoulder.

I had previously designed a system for disengaging the half nuts which will permit an automatic stop and should allow for precise stops to within a few thou. It uses an optical sensor in my carriage stop which triggers a solenoid which disengages the half nuts.

Other ELS systems have the capability for auto disengagement, Rocketronics and I believe @greenail 's ELS are two. @WobblyHand 's ELS is another possibility.
 
I have the Clough42 ELS in my lathe. I added a microswitch to my stop for a sensor but subsequently removed it. Threading to a shoulder will be problematic. If the stepper motor is disengaged, you lose synchronization much like disengaging the gear train. The only viable way would be for that.is to stop the lathe spindle which means having control of the motor drive. It can be used for turning to a shoulder as sync isn't required.

I tried disabling the stepper drive but the problem is that my stepper requires that the step direction and pulses be set prior to re-enabling so some weird actions occurred.. Going through some more sophisticated control via software could fix that though. My current solution to dealing with threading to a shoulder was to convert the a PWM dc motor drive which allows me to slow down to zero spindle rpm as I approach a shoulder.

I had previously designed a system for disengaging the half nuts which will permit an automatic stop and should allow for precise stops to within a few thou. It uses an optical sensor in my carriage stop which triggers a solenoid which disengages the half nuts.

Other ELS systems have the capability for auto disengagement, Rocketronics and I believe @greenail 's ELS are two. @WobblyHand 's ELS is another possibility.
My ELS will have that ability, once I figure things out. Just got both my DRO's running in my ELS board! Considering that I have never connected to them before, besides using the Grizzly display head, I am pretty excited about that.

I have access to the spindle counter, and the stepper count and the DRO axes on my board. One thing that would make things easier is having access to the spindle index pulse. I have such a signal on my rotary encoder, but currently I am not using it in the SW. The library I am using is not exposing the index in the way I would like. With the index pulse we know the exact angle at disengagement. Of course, we sort of know it anyways, since we can always use the modulo function on the count. Count modulo counts/rev will get us back to our relative stopping point. I'm sure it isn't easy as that, but this is an area that I am exploring.
 
The catch with this is going to be removing the tool from the cut. The code/sensor isn't that bad, but the ELS has no provision for tool control. And it would need to be fast. Or is your goal just to stop the carriage like disengaging the half nuts would? If that is the case, why not just thread away from the shoulder like the Joe Pie method?
I don't know what the Joe Pie method is, but I am guessing it involves flipping the tool upside down and reversing the lathe spindle. This can work, but it introduces a number of issues, especially backlash and repeatability issues. These can be mitigated, but maintaining the lead screw position and providing a single direction feed under a fairly steady tool pressure almost entirely eliminates such issues.

You are correct for a complete thread to a shoulder, the tool must be withdrawn instantly, but for almost all purposes, being within 1/2 thread width of the shoulder is more than good enough. No, this is not at all like disengaging the half nut. It is stopping the led screw with the half nut still engaged, which is completely different. While the half nut is engaged, the incremental position of the carriage can be directly inferred from the rotational position of the lead screw. Once the lead screw is disengaged, no position of the carriage can be inferred, at all by the ELS.
 
I have access to the spindle counter, and the stepper count and the DRO axes on my board. One thing that would make things easier is having access to the spindle index pulse. I have such a signal on my rotary encoder, but currently I am not using it in the SW. The library I am using is not exposing the index in the way I would like. With the index pulse we know the exact angle at disengagement. Of course, we sort of know it anyways, since we can always use the modulo function on the count. Count modulo counts/rev will get us back to our relative stopping point. I'm sure it isn't easy as that, but this is an area that I am exploring.
The relative position of the spindle is all that is required, provided the half nut remains engaged. The absolute position of neither axis is required, since the relationship between the small (<360 degrees) spindle angle and the large (>360 degrees) lead screw angle can always be inferred. Given a single known coordinate in both axes, a given incremental spindle rotation will produce a set of matching incremental lead screw angles. For example, suppose the ratio of rotational speeds for the spindle to the lead screw is 10:1, and the spindle has moved some integer factor of 1/2 rotation since the lead screw stopped. For the tool to be in the correct location, the lead screw can be at any of -0.05 rotations from its stop point, 0.05 rotations, 0.15 rotations, 0.25 rotations, etc.
 
I have the Clough42 ELS in my lathe. I added a microswitch to my stop for a sensor but subsequently removed it. Threading to a shoulder will be problematic. If the stepper motor is disengaged, you lose synchronization much like disengaging the gear train.
That is correct. The stepper / servo motor must never be disengaged, nor can the half-nut. The ELS must keep track of the relative position of both axes.
The only viable way would be for that.is to stop the lathe spindle which means having control of the motor drive. It can be used for turning to a shoulder as sync isn't required.
No, that is not correct. As long as the ELS knows the relative position of the spindle and the lead screw when the lead screw is stopped, the relative desired velocity of the two (i.e. the thread pitch), and the current incremental angle of the spindle relative to its position when the lead screw was stopped, the ELS can calculate the correct current position of the lead screw. Actually, in practice, one would take the current position of the lead screw and wait for the spindle to reach the correct angle to match that position and then start the lead screw again, but the point is the ELS knows where the spindle and the lead screw were and can figure out where they need to be to resume the operation.

Yes, of course, turning to a shoulder is trivial.

I tried disabling the stepper drive but the problem is that my stepper requires that the step direction and pulses be set prior to re-enabling so some weird actions occurred..
Yeah, don't do that. Just stop outputting pulses. (The current software must be modified, of course.)

Going through some more sophisticated control via software could fix that though. My current solution to dealing with threading to a shoulder was to convert the a PWM dc motor drive which allows me to slow down to zero spindle rpm as I approach a shoulder.
That is not necessary. The ELS does not care how fast the spindle is turning or what is driving it.

1. With the tool retracted from the part, but the ELS system engaged, just stop the spindle motor a few hundred thousandths from the set point and move the rest of the way to the stop point turning the spindle by hand. Be sure to only move the spindle so that the carriage is moving toward the shoulder from the direction it will be moving when actually cutting the part, or you will have serious backlash issues.

2. Once the carriage is at the correct point, set the stop position by enabling Shoulder Stop mode. I propose this should be done by hitting the <Set> key three times in quick succession.

3. Start the spindle and allow the ELS to back the carriage away from the part. I propose at this point, hitting the <Set> key should start the lead screw again in the opposite direction to which it was moving when it was stopped.

4. Stop the lead screw. I propose hitting the <Set> key should do this.

5. Move the tool into position using the cross slide and compound, and start the lead screw. This would be done by pressing <Set> again.

6. Wait for the ELS to stop the lead screw automatically and then retract the tool using the cross slide.

7. Hit <Set> again to move the carriage off the part.

9. Repeat steps 4 - 7 until the part is the correct size, stopping the spindle from time to time to take measurements.

10. Press <Set> three times to exit Shoulder Stop mode.

I had previously designed a system for disengaging the half nuts which will permit an automatic stop and should allow for precise stops to within a few thou.
That is nowhere nearly good enough. The ELS should be able to stop the carriage within the distance limited by the stepper / servo resolution.

It uses an optical sensor in my carriage stop which triggers a solenoid which disengages the half nuts.

Other ELS systems have the capability for auto disengagement, Rocketronics and I believe @greenail 's ELS are two. @WobblyHand 's ELS is another possibility.
This is only possible if the system has integrated DRO scales, and even then it is a very bad idea unless the scales support absolute measurement. Such scales are hideously expensive. No, disengaging the half-nut opens a huge can of worms, for no good reason at all. With the ELS driving the lead screw, it is somewhat easier not to do it in the first place.
 
Last edited:
That is correct. The stepper / servo motor must never be disengaged, nor can the half-nut. The ELS must keep track of the relative position of both axes.

No, that is not correct. As long as the ELS knows the relative position of the spindle and the lead screw when the lead screw is stopped, the relative desired velocity of the two (i.e. the thread pitch), and the current incremental angle of the spindle relative to its position when the lead screw was stopped, the ELS can calculate the correct current position of the lead screw. Actually, in practice, one would take the current position of the lead screw and wait for the spindle to reach the correct angle to match that position and then start the lead screw again, but the point is the ELS knows where the spindle and the lead screw were and can figure out where they need to be to resume the operation.

Yes, of course, turning to a shoulder is trivial.


Yeah, don't do that. Just stop outputting pulses. (The current software must be modified, of course.)


That is not necessary. The ELS does not care how fast the spindle is turning or what is driving it.

1. With the tool retracted from the part, but the ELS system engaged, just stop the spindle motor a few hundred thousandths from the set point and move the rest of the way to the stop point turning the spindle by hand. Be sure to only move the spindle so that the carriage is moving toward the shoulder from the direction it will be moving when actually cutting the part, or you will have serious backlash issues.

2. Once the carriage is at the correct point, set the stop position by enabling Shoulder Stop mode. I propose this should be done by hitting the <Set> key three times in quick succession.

3. Start the spindle and allow the ELS to back the carriage away from the part. I propose at this point, hitting the <Set> key should start the lead screw again in the opposite direction to which it was moving when it was stopped.

4. Stop the lead screw. I propose hitting the <Set> key should do this.

5. Move the tool into position using the cross slide and compound, and start the lead screw. This would be done by pressing <Set> again.

6. Wait for the ELS to stop the lead screw automatically and then retract the tool using the cross slide.

7. Hit <Set> again to move the carriage off the part.

9. Repeat steps 4 - 7 until the part is the correct size, stopping the spindle from time to time to take measurements.

10. Press <Set> three times to exit Shoulder Stop mode.


That is nowhere nearly good enough. The ELS should be able to stop the carriage within the distance limited by the stepper / servo resolution.


This is only possible if the system has integrated DRO scales, and even then it is a very bad idea unless the scales support absolute measurement. Such scales are hideously expensive. No, disengaging the half-nut opens a huge can of worms, for no good reason at all. With the ELS driving the lead screw, it is somewhat easier not to do it in the first place.
My concern with having an ELS auto stop is that the half nuts cannot be disengaged or sync is lost. A problem similar to metric threading with an inch lead screw. I would suppose that the half nuts could remain engaged and the ELS could slow and stop the spindle to allow the tool to be backed out. Then the spindle would be reversed to a starting point for another pass. The issue is that the carriage has to be driven back via the lead screw. This isn't a deal breaker but can be somewhat annoying for long threads.

Another approach would be to have the z position dictate the spindle angle. Successful threading requires only that the spindle be at the correct angle for each and every z axis position. However the spindle is the driver so it becomes cumbersome. A strategy would be to to move to a position to the right of the start point and then engage the half nuts. As the carriage starts to move the ELS would read the spindle angle and the z axis position and adjust the pulses sent to the lead screw drive to properly sync with the spindle angle.

This isn't possible with the Clough42 ELS as no information for spindle angle is read and it would require information as to the z axis position. However, the E6B2 encoder used has the capability to output a Z phase to establish a reference angle. This could be used to reset the encoder counter so the number of pulses read is a direct proportion to the spindle angle. This can then be compared to the z axis position and the stepper drive pulse train adjusted to match the two. There will be multiple z axis positions for which any given spindle angle will be a match, one for each thread. The ELS would simply lock onto the first one it encounters. This is essentially what we do manually when we use the thread dial.

I have the Touch DRO and Clough 42 ELS installed on my lathe. I also have a spindle drive which allows me to go from 500 to 0 rpm with the flick of my wrist so threading to a shoulder is not an issue for me, at least not enough to do a complete refit. For the same reasons, I haven't pursued my mechanical auto stop design.
 
I agree that knowing the Z helps tremendously. The current Clough42 ELS has no provision for that. It probably wouldn't be too difficult to add, assuming you already have a compatible DRO scale installed.
 
In my ELS I have both Z and X. So it would be possible to thread to a gutter and stop. We do know our initial conditions, when we started threading, so it would be possible to reverse the spindle and retract to the initial starting point (assuming the tool is retracted, which could be inferred from reading the X DRO). This would be kind of slow, for fine threads, but I think it is doable.
 
Back
Top