An Electronic Leadscrew Controller using a Pi Pico

They said they have recently run out of them and the Shanghai factory is under government shutdown (I think there is a virus going through there now), so they don't have a schedule for a replacement. But they will replace it. No real problem for me at this time as I'm not cutting threads for anything important. I could probably 3D print a temporary replacement, but I'm not planning to mess with that. So it will get fixed, and the warranty is 3 years, so we're well covered there. Great service, three email responses in one afternoon, some well after closing time.
 
I had some spare CAD time today so I started a plan for the test setup. Omron encoder, nema17 stepper, breadboard. Room for control encoder/switch and toggle switch. Have to settle on a display and decide what to do with that. Finalize mounting holes/etc for the controls. I can 3D print this when it is ready and make a nice organized test setup. Suggestions? Plan to add some triangular gussets and side lips to support the front panel and stiffen the bottom. Dug out some old 3D printer parts for the motor and driver. Suggestions?

1653714589124.png
 
If it was me, I'd separate the stepper and put it on the opposite side of the panel. I like to separate inputs from outputs. It also balances the assembly a little. Other than that, it's a test fixture, so you have free reign to change it as you please.

At first I thought I'd make a fixture plate for everything, but I have backed off on that, since I didn't have a piece of scrap the right size. So things are still a bit haphazard on my desk for a while. Won't be that long before it all moves to the shop, so I will put up with the chaos a little while.
 
I put the stepper and encoder next to each other to make it easy to see the relationship, and it is heavy so needs to be near the middle. The Omron is light.

I don't have dimensions on the display mounts, but doing what I can from what I have. Probably will have to get the 3.2" display before making the test frame.

1653748517457.png
 
I put the stepper and encoder next to each other to make it easy to see the relationship, and it is heavy so needs to be near the middle. The Omron is light.
When I was starting out, I was spinning the encoder by hand. If your hand is on the encoder, it may block your view of the stepper. At least, that was my reasoning for separating them. You are free to implement whatever you like.

As an aside, asking for feedback and then summarily rejecting the feedback you solicited, doesn't feel particularly motivating. You might want to lighten up in that area, because biting the hands that are freely offering suggestions isn't a good long term strategy, in my humble opinion. It drives people away. If you don't agree with someone's suggestions, that's ok. Thank them for the suggestion, and the fact that they offered something. There is such a thing as polite disagreement, please exercise it, if you need to. Frankly, it is your project, so you can proceed as you like, no matter what others think. But we do take care here to be kind, that's what makes Hobby Machinist a good place to be. Aside over.

Getting back on track, what CAD program is that?
 
Thanks for the input and your comments. I absolutely did consider them, but the stepper is so heavy I didn't want it on the edge. It's a 40mm iron and copper cube. This layout puts the user interface and controls on the right, and I'm right handed. The left side is the lathe input/output. I can use the left hand for simulating spindle inputs and not block the view of the motor. I suspect most of the activity will be user interface and display, once the spindle encoder/motor works it won't be used much, and I expect that to work pretty quickly. As you point out it is a test setup so not too critical.

I use OpenSCAD at this point, it has been excellent for 3D printing, no licensing hassles and I can use it for my small business without interference. I'll probably have to find something else for CNC when I need that.

I did find some dimensions on the display but haven't worked through that. Also need to detail the other encoder/switch. I have a USTA match today so will be busy with that shortly.

Thanks again.
 
Well, thank you for your explanation. As my wife patiently taught me, tone goes a long way. My NEMA-11 is tiny and pretty light weight, so I didn't even consider that. I was primarily thinking of hand clearance.

Yes, I don't think you will be playing with the encoder for very long. Once it works, it is pretty much done. I'd recommend an encoder simulator, perhaps running on another controller just to check that you don't miss counts (, more accurately, determine when you will miss counts). It is good to know the limits where your system breaks.

OpenSCAD. Thought I've seen that display before. I'm using FreeCAD. It is far from perfect, and I'm far from being good at it, but so far it has worked for me. I don't have a 3d printer at this point (maybe someday) but I have printed a design from a FreeCAD model. A friend of mine printed out a small bracket for me, as a prototype. All I had to do was to export the model to stl, which was a 2 second painless effort.
 
Touche - I think I suggested the encoder simulator over in your Teensy thread early on. :)

Maybe I should make room for another knob for the quadrature generator... Is there enough room on the breadboard for dual Pico's and everything else? Might get a bit crowded on the panel for another control.

I have a bunch of Nema 17's from a 3D printer kit I bought in 2014 that never quite was completed, so I cannibalized it for parts. It also had the drivers that should work on a breadboard. A Nema 11 would be a better choice but this is in hand and unlikely (and available) to be used. I think there are five motors in this kit. So I have a few.

I don't understand why folks who know how to use them don't have 3D printers. It is the best tool ever for someone who wants to make things. That first kit didn't quite work out for me, but the Prusa MK3 has been amazing. I have a stack of factory upgrades for it to bring it to the latest version, but it just keeps on humming so the upgrades are still on the shelf. A lot of what I do with the 3D printer is to make tools and jigs for other machines, as well as organizers and holders for tools. 3D printed plastic can do more than I ever expected.

Learning FreeCAD is on my list. I hope they sort out some of the issues I've heard about with it. Having a programming background I find OpenSCAD very easy, but it doesn't have the right metadata for CNC and it falls short in some areas. So I'll have to choose something else for CNC. But for 3D printing the OpenSCAD works quite well.

I need to choose a display. At the moment I'm leaning toward the Adafruit 3.2". The Pico Arduino library for the ILI9341 is said to be optimized and so I was looking for displays that used it. It does have touch but I'm not planning to use that part. It also has an SD if I decide to play with that. The Pico Arduino setup has a file space in the flash so I can put config files there, but they have to be written with the Arduino environment. Easier to start there than worry about the SD card support.

Had a great tennis match. Now we're back.
 
Last edited:
The encoder simulators will have a lot more patience than you or I. The simulator will send 1M pulses to your system, at whatever rate you want. The system had better see 1M of those pulses. The better simulators can vary duty factor and add bounce. So they are a good thing to use. You gave good advice.:)

For me, the only reason I don't have a decent 3d printer at the moment is cost. At the moment, I'm a bit cash poor. Hopefully by the end of the year, things will be a little better. I want to get the Prusa. I don't want the printer itself to be another rabbit hole to fall into. I'd rather just use it, instead of having to fiddle with the darn thing to get it to print well. As for motivation, I've had dozens of times I could have used a 3D printer, just in the past year.

Since you already have the experience with 3D CAD, FreeCAD should be easy for you to pick it up.

I'm using the 3.2" ILI9341 display from PJRC. It has resistive touch, but doesn't require using multiple ADCs, it is all digital. At the time of purchase it was $19. Also have the 3.2" display with capacitive touch from Adafruit. That one was quite a bit more. Both seem to work well. Although the Adafruit library is pretty good, I am finding that it limits the SPI speed to a fixed value. The PJRC libraries don't have this restriction, and allow independent read and write rates.
 
That is a great price on the PJRC display. I may have to try one of those.

The Adafruit displays are more expensive, and they aren't shipping too fast these days. Both Adafruit and PJRC do a good job on software support. I suspect the Adafruit SD card slot works. I see there are mods to make the PJRC SD card work too. I don't mind sending Adafruit a few dollars, they have done great things for the hobbyists.

I read that there is an optimized library for the Pico that is faster than the standard libraries. I'll definitely give that a try.

I fiddled with FreeCAD briefly a little awhile back, but didn't give it a serious run. I'll have to do that when I need toolpaths for CNC.

The Prusa MK3 (now ...S+) is a wise choice if you want a tool and not a project. I bought mine as a kit to save a few bucks and be familiar with the assembly for future maintenance and upgrades. I'm collecting parts to build a Voron Trident, I probably should have waited for Voron kits which are starting to be available. But the support from Prusa has been excellent. New firmware, major upgrades to the slicer, updates to the printer have been ticking along so it has been getting better with age. The default settings for filaments generally work without fiddling, and they have a lot of them. There are redundant safeties to prevent overheating of the printer. It has required very little maintenance. It is quiet and a real workhorse. I keep spare parts on hand but have only swapped a few nozzles over years of use. I suspect the few nozzle clogs are more due to impurities in the filament more than anything else. The linear bearings have needed a little grease a couple of times.

For a budget printer many recommend the Prusa Mini. It is a bit smaller and lower in cost, and actually has a more modern 32 bit processor and display. I don't have one, but those who do say it works well. My son wanted to print larger stuff, so we got him an Artillery Sidewinder, which is quite a bit larger (300x300x400mm? build volume) than the Prusa. It has been trouble free. And it cost about half what the Prusa did. So you can save money, but there is risk that it may occasionally take some time.

Many folks swear by the Creality Enders. I have not messed with them, but they are immensely popular. If one has more time than cash they may be the ticket. If you restrict to mods that are actually necessary and important it should not turn into much of a project. Many of the mods have no real impact on the printing.

There's a new Prusa coming out, the XL at 360mm cubic build volume. It has a lot more features (like the ability to support multiple tool heads), and a higher price point. They say third quarter, but I suspect it is going to be late and sold out for awhile.

Thanks for the tip on the display.
 
Last edited:
Back
Top