An Electronic Lead Screw controller using a Teensy 4.1

I have the Clough42 code up. It's not difficult to read, but the IDE (Eclipse) is new to me.
It's not just new to me, it's downright goofy. I have used a number of IDEs before, but that one gives me all sorts of fits if I try to do anything more than just edit, compile, and upload the code to the MCU. Volatile (debug ) mode is nice, though.
He is a programmer by trade, so he obfuscates some things from us mere mortals without even knowing it! lol.
Well, for me it seems more the C++ structure itself that is unclear, for the most part. Some of the objects are a bit hard to find, however.
The arduino stuff is much easier to learn.
Well, that's true, but then Arduino code isn't really a full-fledged programming language like C, C++, or Python. It's designed specifically for an MCU, not a generalized programming platform.
Lack of a proper IDE is somewhat painful
You don't consider the Arduino IDE to be a proper IDE? Clearly it does not have all the features of Code Compose Studio, but it gets the job done.
 
Arduino IDE, V2, has the look and feel of an actual featured IDE. The earlier versions are more like an editor with build scripts. In the old version, it's a lot harder to develop than in a better IDE like a well setup Eclipse development environment. That being said, Eclipse stinks unless you have a well thought out project file. I found it difficult and non intuitive to setup that file.

All that aside, I am going to continue development on V1.8.19. No need to clutter up an existing project by changing ships. Things are working now, so I want to keep it that way. Next major code development project may occur on V2, just because there's not much to lose.
 
That's a little strange. Most scales out there are either 5um (0.0002') or 1um(0.00004") resolution. It's hard to imagine a scale with only 0.001" resolution. Optical scales 900mm long and 5um resolution can be had under $50, and 1um scales the same length run a little over $100.
Nowadays, that's true. But this is not a newly manufactured lathe. It's second hand. Grizzly is not known for putting in normal or high end features for their low cost machines. They probably searched high and low for these cheap readers! For all I know it was a custom design at the expense of performance to make it cheaper.

I want a magnetic DRO reader, due to the ease of installation. I was looking on AliExpress last night and the prices I quoted were last night's. If you know of less expensive mag heads and tape, from a supplier that has decent sales and ratings, please let me know. I am looking for two read heads and about 700mm of tape total. My lathe is only a 10 x 22, so I don't need a lot of tape.
 
Some incremental progress. The second PCB ran some lvgl demo code which was nice. Ran at 65 FPS, but I could push it to 100 FPS. Was a bear to get going, though. And I don't know how to use the library just yet. It will force a rewrite of everything. That's not inherently bad, but think that will be a longer haul thing. LVGL graphics are a lot nicer than mine, so there's some incentive. They have a lot of widgets to choose from, which would make things look a lot better.

On unit #1, got the RH and LH threading buttons working. Had to add a lockout to the buttons, ie, can't change the handedness of the thread while threading! When the button is active it is orange with blue writing. The inactive button is grey with black writing.

The stepper didn't really care with the lead screw engaged (not cutting) but prudence dictates that one not do that ordinarily! Been staring at the boxes (cases) today, pondering the packaging and bezel problems. I can see that I can fit this in a box, only if I lower my Teensy. It's currently in a socket, which elevates the part high enough it just hits the bezel I designed. If I solder it in place, or find a lower profile socket, it will be fine. I only need a mm or two more clearance. The sockets I have are 8.5 mm high female headers, and the Teensy has 6 mm pins. Maybe I can solder the Teensy into the board with some low temp solder, so if I have to remove it, I have a fighting chance. The Teensy is a 2 x 25 pin device DIP separated by 0.7", so it's kind of hard to free up all those pins at the same time.

I made a video of the ELS running. Got to figure out how to get it online and viewable. Ran it slow 100 RPM and at 100 TPI, so things wouldn't get out of hand right away! No fun crashing with anyone looking.
 
Dunno if this works. No words. Not rehearsed. Never done this before... First cut. ;)
 
Well, there's a first time for everything! It looks pretty decent. I have some constructive criticisms, if you like, especially if you would like to make more of these. If not, it's good enough for demonstration purposes.
 
Some incremental progress. The second PCB ran some lvgl demo code which was nice. Ran at 65 FPS, but I could push it to 100 FPS.
FPS? Frames per second video rate?
The stepper didn't really care with the lead screw engaged (not cutting) but prudence dictates that one not do that ordinarily!
I don't follow.
Been staring at the boxes (cases) today, pondering the packaging and bezel problems. I can see that I can fit this in a box, only if I lower my Teensy. It's currently in a socket, which elevates the part high enough it just hits the bezel I designed. If I solder it in place, or find a lower profile socket, it will be fine. I only need a mm or two more clearance. The sockets I have are 8.5 mm high female headers, and the Teensy has 6 mm pins. Maybe I can solder the Teensy into the board with some low temp solder, so if I have to remove it, I have a fighting chance. The Teensy is a 2 x 25 pin device DIP separated by 0.7", so it's kind of hard to free up all those pins at the same time.
I might suggest a custom printed PCB. That's what I usually do. OSH park will print 3 boards at $5 per square inch of design.
I made a video of the ELS running. Got to figure out how to get it online and viewable. Ran it slow 100 RPM and at 100 TPI, so things wouldn't get out of hand right away! No fun crashing with anyone looking.
 
Well, there's a first time for everything! It looks pretty decent. I have some constructive criticisms, if you like, especially if you would like to make more of these. If not, it's good enough for demonstration purposes.
I can handle constructive criticism. The first board is socketed, because, you know, I wasn't actually expecting everything to work. Eliminating the socket would lower the Teensy and get it out of the way. As for the UI, umm, yeah, working on that.
 
FPS? Frames per second video rate?

I don't follow.

I might suggest a custom printed PCB. That's what I usually do. OSH park will print 3 boards at $5 per square inch of design.
FPS, yes frames per second video update rate, on a SPI 320x240 TFT display.

You wouldn't want to change from cutting a right hand thread to a left hand thread while everything was in motion. Bad stuff happens.

You are looking at a custom PCB in the video. I designed it in KiCAD. JLCPCB made the board for me for the princely sum of $7.50 for 5 boards. They are roughly 100 mm x 100 mm in size. I suspect I got a new customer break, but, that price included shipping! Two week turn time, including shipping.
 
OK, well. the first suggestion is: get closer. Fill up that video frame with the subject. The view of the control panel (nice, by the way) should completely fill the frame, with the edges of the panel touching or nearly touching the edge of the video.

The second suggestion is not to move the camera. Hold it still throughout the segment, or better yet, use a tripod. When you want to show a different view, stop the camera and move it, or at least use a video editor to remove the sections where the camera is moving. An even better solution is to have multiple cameras running during the shoot and splice the video sections together. Of course, the latter is probably only of interest for someone who wants to publish a lot of videos.

Finally: talk. Write up a brief script and talk while the camera is running, or better yet, voice over the video after filming is done.
 
Back
Top