Electronic Lead Screw Mod

I'm working on this threading sync problem on my own, fairly modified, Clough42 ELS. I'm solving it in a pretty simple way: my ELS already allows feeding into a previously-set stop. I set a stop at the right hand side of the work, and at the shoulder I'm feeding in to. Now I can just press my "Feed Left" button, and it will feed up to the shoulder. Retract, press Feed Right, and it feeds back, repeat.
A Start and Stop position are not absolutely essential, but they are very nice if one wishes to produce a captive thread. Captive threads are pretty unusual except when creating a worm gear. Even then, many designs employ a shaft whose diameter is smaller than the minimum diameter of the worm. If you already have this implemented, I would be happy to use it.

Because this system knows the starting position (the right stop), my modification for threading is just going to be to wait for the correct spindle position before beginning the feed. As long as you use the same spindle position every time, from the same starting point, it should work perfectly.
Exactly. It is not necessary to calculate or keep track of the total number of rotations derived from the encoder output. As long as the half nut is locked, there will always be a 1:1 correlation between the feed screw position determined by the controller's output to the motor and the position of the spindle. Since the spindle does not move in the Z direction (or one had better hope not!!!), only the simple polar coordinate providedc by the encoder is needed.

Unfortunately I've been set back a bit by somehow losing quite a bit of my previous code, so I'm rebuilding it now.
Ouch! Let me know if I can help in any way. Certainly I would like to be a tester once the code is ready for testing.

The changes to do all of this aren't trivial - I'm not a master coder, but nevertheless it has taken me quite a few hours to get to this point. James' extremely good ELS was only designed to be a simple replacement for change gears, so you need to make a lot of changes to keep track of things.
No, but they are not too terribly involved, either. If I knew any C++ at all, I am pretty confident I could already be a fair way along. At the very least, I would be done with the code which starts and stops the servo.

Let me ask you this: "How do you enter and exit the shoulder stop mode?" I would definitely like to be able to stop the lead screw even though I am not threading or turning to a shoulder. As I mentioned, I envision using the <Set> button to enter and exit the mode. I had envisioned using the <Set> button for reversing the lead screw, but I could certainly work with using the left and right arrow buttons. It would make my idea of flashing the <Fwd> and <Rev> LEDs unnecessary (which is OK), but I still think it a good idea to flash a notification every few seconds when the lead screw is stopped.
 
I think you are underestimating the effort involved here and I don't think anyone is going to try to write this for you the way you want. Not sure what else to say but good luck.
No, I have written far, far more sophisticated code than this. It's really not that complex. In fact, it is only around 2100 lines of code, and it's not really doing anything very complicated. The math is all 10th grade stuff; not even any trigonometry and certainly not a Fourier series or a Bessel function anywhere in sight. If I knew anything at all about C++, I am fairly confident I could manage by myself. My Thermostat project (Which you can see here) has more code and rather more intricate code, and it isn't even 10% done. I am not trying to puff myself up nor to in any way disparage James' work, but honestly, this is not rocket science.
 
also, this is all about errors. You can't do this with no errors except for a few combinations of leadscrew pitch, encoder resolution, and thread pitch.
It's not possible to drill a hole or face off a small piece of brass without errors, and any time one engages in D/A or A/D conversion there are always going to be conversion errors, digital rounding, and aliasing. Those are vastly smaller than the errors in casting the gears on this Chinese import lathe. The only call here is to be able to thread or turn to a shoulder with an error of 0.0005" or so. That is not a particularly stringent requirement for an encoder whose error is +/- 2.6 minutes of arc and a servo whose positional error is on the order of +/- .000005" of carriage movement.

If you decide to try to write this into Clought42's code you should familiarize yourself with this: https://en.wikipedia.org/wiki/Bresenham's_line_algorithm
Yeah. I am aware, thanks. As I have said, I am not a professional programmer, nor am I a professional machinist, but I was a Physicist and then an Engineer for 37 years. I am fairly familiar with this stuff.
 
I wouldn't expect James to implement any of these kinds of features. He has been very clear since the inception of the project that the ELS is designed to do one thing: replace the gearbox with a stepper driver. He specifically avoided any additional bloat/features like feeding to a stop etc, and he has been clear that he has no intention of adding any "CNC-lite" functions like this. And to that end I think he's right - the ELS does one thing and does it extremely well.
Yes, but he himself lists programmable stops as a likely / useful feature on his github:

1668129117521.png
I have also spoken with him directly, and he is encouraging, although definite in saying he does not have time at the moment.

- again, an amateur, and the code is just not well set up for this kind of expansion. I'd love to help with what you want, but honestly it's not realistically possible with the existing display in my view.
I could not disagree more. There is an unused button. That is all that is required. One button can easily enter and exit the stop mode, and when in stop mode, it can easily set the stop point(s). Nothing else is required for input, and the existing 8 characters are enough for status indication.
Plus I simply have no time whatsoever. But I really encourage you to dig into the code - c++ is very learnable.
The basic coding is easy enough, but the arcane rules are less than helpful, and James' implementation leads me in circles.
 
It is true that the start angle is arbitrary as long sync isn't lost. Stopping the pulse train to the stepper, either by means of the controller , or the driver enable breaks sync.
No, it doesn't. 'Not as long as the encoder pulses continue to be correctly counted. If we know the nunber of encoder pulses and the number of stepper pulses, sync is calculable - easily so.
It is theoretically possible to regain that sync by knowing how many pulses were generated by the encoder and doing some sort of makeup for the driver when it is again enabled but it seems like this is a lot of work.
Not at all. When the servo is actively stopped, we know its position. As long as we know the position of the encoder when the last step pulse went out and the number of encoder pulses in advance of or behind that position, we can easily know how many more encoder pulses need to go by before sending out another stepper pulse.

Suppose, for example, the encoder produces 1024 pulses per revolution. After the carriage is stopped, the encoder sends out 11027 net pulses in the same direction. After every 1024 additional pulses, we can reset the encoder register. Although 10 full revolutions have gone by, we can discard those 10240 pulses in 10 increments. That means 787 pulses have gone by since the spindle was at the same angle where it was when the carriage stopped. If we tell the ELS to start threading again, it needs to wait 237 pulses before sending the next pulse. In addition, if we send out non-synchronized pulses to the servo, we need only keep track of how many and in which direction along with the pitch in order to update the encoder offset. This is trivial arithmetic.
 
I'll say on my G0602 with the Clough ELS, a limitation to the lack of torque of the stepper he originally used (and was smart enough to upgrade) and though I want to follow where he went with it, I'm a bit intimidated with what changes I need to make to get it functioning again. Anyway, where I'm going with this...on harder steels with courser threads and larger diameters and slow rpm (80) I can lose a step and the only way to get the ELS working again is to remove power and reboot. At this point all is lost except for picking up my thread and continuing. I think all this points to what RJ is saying. Don't think I'm poo-pooing any ideas here, when I first installed the ELS, I had the same "why can't we" questions. I'm down for whatever, but coding for me? Forget it.
 
Anyway, where I'm going with this...on harder steels with courser threads and larger diameters and slow rpm (80) I can lose a step and the only way to get the ELS working again is to remove power and reboot. At this point all is lost except for picking up my thread and continuing. I think all this points to what RJ is saying. Don't think I'm poo-pooing any ideas here, when I first installed the ELS, I had the same "why can't we" questions. I'm down for whatever, but coding for me? Forget it.
Are you using a stepper motor, or a servo? I am using an iSV57T-180 integrated servo with a 4:1 speed reduction. A closed-loop servo should be much more immune to lost steps than a stepper, not to mention the fact the higher speed allows for the 4:1 increase in torque. I have not as yet had enough of a chance to try any difficult threading or powered turning, so I can't comment further.
 
It’s a stepper, same one clough42 used. He ended up going to a stronger stepper (one with a servo built in if I remember correctly) and as much as I’d like to follow suit, I’m just not ready to attack that just yet. I want to use my equipment more than I want to tinker with it anymore. TBH it’s a few steps above my comfort zone.
 
I am using a Nema 24 hybrid stepper with a 1:1 pulley ratio and 2:1 gear reduction in my gear box. The stepper and driver will monitor lost steps and attempt to recover them up to one revolution. Beyond that, it throws an error requiring a reboot of the driver. My driver is powered separately from the rest of the ELS circuitry so I only reboot the driver. The Stepper is rated at 4.25Nm of torque at a driver voltage of 48 volts and I am driving with 42 volts. I measured a force at the carriage of 110 lbs. at a driving rate of 3mm/rev. and a spindle speed of 300 rpm.
 
Back
Top