An Electronic Lead Screw controller using a Teensy 4.1

If you want an analog speed control on the lead screw, just disable the controller input to the stepper and add a simple variable rate pulse generator. A simple 555 oscillator with speed set by the potentiometer. No coding necessary.
 
Hmm. I just go to my feed menu and select what I want. Have lots of room for feeds, pretty much 25 easily selectable values for either metric or imperial. Practically speaking, more than I would ever need.

Setup > Feed > Imperial or Metric > touch the desired feed > Return > Start. Done. Not as fast as twiddling a pot, but I'd bet you need to push or click a lot of things to get that feed safely enabled. My instructions are the total number of steps needed for my implementation.

Pots and all are ok, but you just don't know what value you are getting, and repeatability declines with use. Digital approach, select a value and you get it, every time, today, tomorrow and ten years from now...

Got diverted from working on the ELS.

Our household Pi-Hole died the other day. Pi-Hole is a DNS blocker, aka, ad-killer. Tried to update it, and the update failed - breaking Pi-Hole. Not a friendly failure mode. Apparently Debian Stretch is no longer supported by Pi-Hole, and mine was running on Stretch. So updated the OS to Bullseye and reinstalled everything. Really reduces the number of distracting and obnoxious ads. Highly recommended. It works on the whole network, so you don't have to individually install ad blockers. Pi-Hole doesn't get everything, but it does get rid of a whole lot. In 36 minutes it blocked 104 out of 402 DNS searches. Those 104 are tracking or ad servers. Pi-Hole logs them, and allows you to make your own blacklists. My Pi-Hole is running on an RPI3B+ and I notice no slowdown of the internet. In fact it is a lot faster, because all those slow ad servers are being blocked, so the web page does not have to wait for those servers to respond. Get a lot faster page loads.

Back on topic. Some electronic parts came in today from DigiKey. Piles of resistors and buffer ICs to replenish my electronic parts stash. Could make a few more of the ELS devices, if I needed to.
 
More RPI distractions. Thought I would update our Sprinkler Controller, also an RPI(2). Updated its OS from Stretch to Buster. Took an absurd amount of time. During the update, the wireless disappeared, which of course broke my connection to it. Had to direct connect to ethernet to continue. Since the sprinkler system is getting blown out for the winter, tomorrow, it is a good time to update the OS. It appears the OpenSprinkler code is still intact, which is good.

Got to work on the ELS a bit. Did some mundane clean up of code, trying to reduce the number of warnings generated by the compiler. Fixed a bug that blanked the X DRO when the Z DRO changed. Was a simple bug, but it took a while to find. Added a special function button.

The special function button is to go into the advanced feature mode. For now, that is just feed to a stop and thread to a stop. Wrote out some notes on doing feed to a stop. Tomorrow I will storyboard how it should work.

Also made the right hand/left hand threading a toggle button. In right hand mode the button is white with normal black writing, and a black outline. In left hand mode, the button is orange with red writing and a red outline. It catches your eye, which is good. Took me a couple of times to get the logic right, but it seems to work. At the moment, the handedness of the thread is locked out during operation. Only in stopped mode can the handedness change. However, any pending touches are processed the moment stop is touched. I don't know if I like that. Have to mull that over.
 
I like the knob idea but I’d make it an encoder so you can use the input for a variety of things.
I agree. You already have one encoder, so coding for a second one shouldn't be much of a challenge. Unless you are out of digital I/O pins on the MCU, I see no reason to add an analog component. Not only that, but potentiometers have gotten rather expensive. Not only can it be potentially used for other purposes, as jwmelvin remarked, but it can also allow for much greater precison.
 
I agree. You already have one encoder, so coding for a second one shouldn't be much of a challenge. Unless you are out of digital I/O pins on the MCU, I see no reason to add an analog component. Not only that, but potentiometers have gotten rather expensive. Not only can it be potentially used for other purposes, as jwmelvin remarked, but it can also allow for much greater precison.
A lot of it is personal preference. Looking over different TIG welders a while back, I really hated the push-push-push-push-push to get to a menu. Finally found one that was mostly knobs:
I really like this more than the 'fancy' push button ones. It's a lot easier to just tweak things just a bit when getting set up. And all of the settings are visible at a glance. Ok, so there's no presets you can save to (But who remembers what's in all those presets anyway!).

Again, it's really personal preference. A good $10 or $20 pot dedicated for analog feed control isn't going to break the bank. That and I have a box of high quality 10 turns laying around anyway! ;) )
 
You all can implement whatever you like! Makes no never minds to me. This thread is about my implementation, and my decisions along the way.

So, I thought about all the connectors for the motor control box, and this is what I have come up with. A GX16-9 for the motor control signals and Alarm feedback. Two cord glands for the motor cable and the motor encoder cable. These cables have disconnects near the motor, so I will use the cable glands. And a IEC power cord input with an integral switch and fuse. I have Dykemed the edge of the box in the rough locations of the parts. I will use a 5/8" chassis punch for the GX16 connector. Probably drill out the corners of the power cord socket, and hack my way through the box. I do have a hand nibbler. Somehow it doesn't feel "good" to mill out the hole. I have an 1/8" carbide end mill, but I'm pretty scared of the flimsy box and not being able to clamp it convincingly. Would make things a lot easier though. First thing will be to check Z height. Might be a moot point after the measurement.
PXL_20221013_200633234.jpgPXL_20221013_200646448.jpg
Edit: Z limited. Can't drill the 1/8" holes using the drill chuck in the mill. Could use an 1/8" end mill in an R8 collet. Enough room for that. Need a way to keeps things from getting away from me. I can see an edge catching and the box folding right up. The box is 10" x 12" x 3". Here's the box.
PXL_20221013_205800470.jpgPXL_20221013_205808313.jpg
 
Last edited:
A lot of it is personal preference. Looking over different TIG welders a while back, I really hated the push-push-push-push-push to get to a menu. Finally found one that was mostly knobs:
I really like this more than the 'fancy' push button ones. It's a lot easier to just tweak things just a bit when getting set up. And all of the settings are visible at a glance. Ok, so there's no presets you can save to (But who remembers what's in all those presets anyway!).

Again, it's really personal preference. A good $10 or $20 pot dedicated for analog feed control isn't going to break the bank. That and I have a box of high quality 10 turns laying around anyway! ;) )
I also have a box of new high end 10 turns. I avoid using them for applications like this because it takes ten revolutions to go from one extreme to the other. A better solution is a single turn pot with a fine adjust pot if you want high resolution.
 
Got the power socket hole made. Wasn't the safest thing I've ever done. It's only by luck the box didn't turn into a pretzel. Rough marked up the hole outline in the Dykem. Drilled out the corners, and then slotted out the hole. Once I got the piece out of the center, removed it from the mill and filed the rough edges and made the 45 degree angles. Hand fitted it to the part until the part would just drop in. Did not lock it in place just yet, as I'd like to get the wiring attached first. Waiting on a chassis punch for the 16mm connector, found a used 5/8" Greenlee punch that ought to work. 16mm is a hair over 5/8".
PXL_20221014_000401336.jpgPXL_20221014_000517187.jpg
 
Got my git server all set up and tried it out. Now I can be sure that changes made upstairs in the comfort of my office, can be remotely accessible to the platform connected to my lathe. This helps out a lot. The git server is my repurposed RPI4 file server. Someday, when I can afford a pair or more decent HDD's or SSD's, I will set up a RAID array again.

Stayed up too late last night, and I'm paying for it today. All out of sorts. Like being in slow motion for the day. Hope tomorrow will be a bit more productive. Had guests for dinner last night. Spent nearly an hour in the basement showing off the ELS. My buddy was quite taken by it, although I had told him about it earlier. Guess he had to see it to actually comprehend the scope of it all. I could see the gears turning in his head as he was talking... Anyways, that was fun.

Still waiting for some parts. While trying to fit the PCB and display to a case (box) I discovered the Teensy controller was too tall. This is because I had installed some tall sockets in the board. I was reluctant to solder the Teensy directly into the main PCB, initially. I found I had some machined pin sockets that I could use that would reduce the height considerably. However, I don't have the matching round pin headers. I ordered some male machined round pin headers that are compatible with the female machined pin socket strips I have.

Worst case, I directly solder the Teensy to the PCB using low temp solder. (137C melting point) Should there ever be an issue, then I would be able to remove it more easily. De-soldering 50 0.025" square pins of normal lead free solder is quite tough to do without component or PCB damage. The low temp stuff is significantly easier to rework the board. I will use normal lead free solder to solder the header to the Teensy, but low temp lead free for the pins to the board. I bought a syringe full of the low temp solder paste a few years ago, and haven't used it up. Took the stress out of SMT work, and has been great as a poor man's chip quik, desoldering aid. Chip Quik is good, but pricey. Using the LF low temp stuff seems to work as well. My low temp solder paste (Sn42/Bi57/Ag1) "expired" two years ago, but works fine for this use.
PXL_20221015_172923292.jpgPXL_20221015_174637904.jpg
 
My 5/8" Greenlee chassis punch showed up, and I punched a hole in the larger motor chassis box. Also made up the motor driving cables for inside the motor box and inside the controller box. I am using GX16-9 connectors. I have 4 twisted pairs, ENA, DIR, PUL, and ALARM. Tomorrow I will make up the rotary encoder internal cable using a GX12-5 connector. Think I will convert the existing DRO connectors to GX12-4 connectors to have everything consistent. Waiting on a 1/2" chassis punch, cable glands, narrow Faston terminals and a bunch of other stuff to arrive this coming week.
PXL_20221017_010222853.jpg
 
Back
Top