Nema14 stepper motor mounts - work in progress

I’ve recently started work on replacing the 28byj steppers with NEMA14. They’re a pricier, but faster alternative that brings us a little bit more flexibility than the 28byj, which comes with its own 1/64 reduction. They’ll require software and hardware electronic changes too, so this is extremely experimental / exploratory.

STL files below. I also have .fcstd FreeCAD files, but am unable to upload them to the forum since only a few extensions are allowed.

28byjToNema14Zaxis-28byjToNema14ZAxis.stl (341.5 KB)

small_gears.stl (248.5 KB)

28byjToNema14-28byjToNema14.stl (248.3 KB)

I ordered 14HR08-0654S steppers, modified the small gear model, so the shaft cutout matches them. They’re the same diameter, but the 28byj has a deep cutout on both sides, as opposed to a shallow one on one side for the NEMA14 steppers. These steppers are larger, have the shaft in the middle as opposed to the 28byj which has it 8mm off centerline, are rated for double the torque of the 28byj.

To drive these, I purchased two hats for the RPi.

There are some downsides to both of them. The waveshare one can run two steppers and isn’t stackable, but offers additional features like software selection of microstepping (which I’ll explain shortly). I have already tried this one and got it to move a NEMA17 stepper with precision and speed. I have a vid of it, which I’ll share in a comment if I’m able to.
The adafruit one can be stacked on top of itself. I haven’t delved deep into this one, but it has microstepping selection. I’m hoping that I’ll be able to either use software microstepping selection on the adafruit, or be able to stack the adafruit on top of the waveshare one (didn’t check the pinout yet either).

Microstepping is a setting that allows the driver to divide a stepper motor’s steps into smaller increments. Most stepper motors have 1.8 degrees as a full step, for 200 steps per revolution. You can set microstepping to 1/2 (halfstep), which would get you 400 steps per revolution, or 0.9 degrees per step. A similar thing is achieved for the 28byj with manual reduction, about which I’ll write in a moment. This setting has some drawbacks though - the higher you go in resolution, the less torque it has and the slower it is.

You can imagine microstepping as two electromagnets that are next to eachother - which get turned on when you apply current to a specific coil, attracting a permanent magnet on a bearing to themselves. If you turn magnet 1 on, the permanent magnet will “point” at it. If you turn magnet 2 on, it will “point” at magnet 2. If you power both magnet 1 and 2, the permanent magnet will “point” in between them. If you increase the number of the electromagnets (or stators, as they are called in this case) to 48, you get a stepper motor with 1.8 degrees per step.

We want to be on the lowest microstepping setting possible for the resolution we need. To find out the resolution, we need to check the 28byj and see its steps per revolution count. The motor inside the unit is a 5.625 degrees per step. This is then divided by the mechanical gearing system - 1/64. We divide 360 by the result, and we get 4096 steps per revolution. There’s a catch though - the 28byj is a cheap stepper, users have reported differences of 40 - 80 steps per revolution from unit to unit.

We bought NEMA14 steppers, with 0.9 degrees per step, giving us 400 steps on fullstep mode. 1/10 microstepping can get us close, but the Waveshare driver only goes in powers of two - so 1/8 or 1/16. 1/8 is most likely enough, but I’ll be doing more testing on this. This gets us repeatable stepper motors with a resolution that is similar to the 28byj.

The Waveshare driver has software microstepping selection though. We have to solder a few pads on the reverse of the driver board to activate it. You can also SMD mount 0 ohm resistors there, which is automation friendly. What this gives us, is rapid movement or precision, depending on the microstepping setting we choose. When scanning for instance, we can move the field of view of the microscope rapidly in X and Y and don’t have to wait for a motor with a large reduction to slowly pan the view. This will also help with smaller objective magnifications, which are problematic with the 28byj and the project being geared to 100x magnification.

The waveshare driver also allows for current setting, so we don’t provide too much current to the steppers, which just gets turned into heat. Also, the waveshare driver has the ability of driving the 28byj too.

I have JST connectors and pins on the way to put on the ends of the stepper motors and I’ll be testing the X and Z actuators soon-ish. I’ll probably write up a Thing to control the stage with the stepper motors, but it’ll still be a while before I get to it and before it’s ready.

Since these steppers have double the torque, I should be able to get rid of the gears altogether and connect a spider coupling for direct drive, while doubling the microstepping setting. This gets rid of the backlash between the large and small gears. This means more precise and repeatable movements of the stage. The smaller couplings cost around 2 euro each. All of that will come later, the files above use a very rudimentary printed bracket to mount the steppers where they need to be.

4 Likes

And here’s the video of the NEMA17 stepper, in fullstep mode, then in 1/32 microstepping, both going at max speed that allows for repeatable steps.

This is connected to a Raspberry Pi with a hat on it and runs a slightly modified demo that waveshare provides. This is a python script that sends X amount of pulses, switches the microstep settings and provides X*32 pulses for precise but slower movement.

Edit: Eeek, I should have read your post more thoroughly before posting. You basically already said all this.

Uff, these motors hanging off to the side really look ugly. I wonder if just mounting them directly onto the screws would be better. Then we had a gearless drive train that should have a lot less backlash.

I understand this is an early prototype and aesthetics are not a priority. But getting rid of most backlash might justify the additional cost and complexity.

Moving with halfsteps and only using 16 or 32 microstepping for the final position might allow for faster moves while keeping the precision. Also using higher microstepping for the Z axis than XY. There is at least an order of magnitude between the requirements for precision between them if not more. Well, and 2 to 3 in movement range during normal operation.

Part of this is already in the mechanics, the xy has a speed up ratio in the levers of 7/4, the z ratio is 1.

I’d guess we could get away without a spider coupling as the screw isn’t really constraint anyway. Maybe just print a fixed coupling and see if you run into any issues.

Edit: Actually you could hang the screw from the motor and use the motor bearings for the screw, too, instead the washers. This would be basically a stepper with a lead screw as used in some 3D printer. May be that’s something that should be used in the first place although I guess it comes with an additional price tag and will require changes to the actuator to fit the new nut.

1 Like

Yeah, but that’s not even a factor of two.

Combining several of those things together:

Torque: This does not seem to be a problem for the 28byj-48 motors with gearing changed past 1:1. The fastest ratio of gears that will physically fit on xy is 0.8:1, which seems to have no problem with torque.

Resolution: On xy the speed up of changing gear ratio is useful, and the resolution is still appropriate for most magnifications.
On z, the step resolution needs to remain small because the depth of focus is small (at high magnification). The speed also needs to remain relatively slow for autofocus to work - the fast autofocus looks at the camera mpeg stream, so the framerate of that sets a limit to how fast it is sensible to move. Flexibility of microstepping modes would of course be great to get faster motion when it is uesful, and slow fine motion for focusing.

Edit:
Speed: The speed is determined partly by the mechanical things like gear ratio and levers, but also by the (micro) stepping rate. The 28byj-48 steppers only operate reliably up to 1000 steps/second. The Nema probably will manage faster than that.

This is a main body with the mounting lugs for NEMA 14 round stepper motors. The x and y axes are adjusted neatly with a change of the parameters, but the z-axis is rather a hack because of the need to put the motor outside instead of inside. I think it is correct, although the wide z-motor lugs might get in the way of the Allen key when mounting the optics.

(edit: I now see that the motor mounting lugs are M3 tapped, rather than M3 clearance :frowning:)
main_body_NEMA_14.stl (2.0 MB)
main_body_NEMA_14_counterbore.stl (2.2 MB)

1 Like

Another thing I have always been wondering is if the screws for XY can be replaced by a “winch”: Mounting the stepper at 90° with the axis above the actuator column and pulling it up with a string (well, Dyneema fishing line). The 28byj-48 motors never looked like they’d do well with such a stunt but the NEMA steppers with their two ball bearing have much better chances.

This looses about a factor 30 in precision: 15mm per rotation instead of 0.5. With micro stepping this should still be enough 15mm/200/16*7/4 is 0.0082mm per step. This is a bit course for a 100x objective which should have a FOV of slightly more than 0.1mm but should still work.

Ofc this would speed up the XY axis by a factor of 30, too.

I’ll give it a print later, once I mess around with this setup. Thanks for sending over the stl, I think if I drill / edit the STL so it has a subtractive cylinder going through the mounting, it’ll work fine with the m3 tapped. It’s weird though, since the drawing they attach to each stepper claims it is supposed to be a through-hole.

1 Like

Right now I’m focused on the steppers themselves and direct drive. I don’t think we need much more speed than a stepper can provide, though would love to see a proof of concept of this if you want to make one. I know there is a Z-actuator-only model that would be perfect for this

1 Like

It turns out that changing from nut traps to counterbore is as simple as it should be. I have made a new STL and edited the post.

1 Like

I’ve gotten the Z axis moving when mounted to the microscope, in 1/16 microstepping, on the target motors. I think I’ll drop it to 1/8th and see how that works.

I also have an idea on how to get the third motor running - I should be able to use another Waveshare board. The only issue with them stacking is three pins. The motors use six, but three of those are for software stepsize control, which should be the same for both X and Y axis motors anyway. The Enable pin is also iffy, I don’t see a situation where some motors would be turned off, but others wouldn’t. Maybe if there are temp problems?

So what I need is a hat stacking board, or an adapter board:

I’ll see which one of these makes the most sense, or find other boards. Next steps after would be to get USB-C power working, so it doesn’t run off of a lab power supply, and getting it working with the OFM server.

2 Likes

Good to see this experiment. Another option for changing the gear angle is bevel gears. This might be easier with a 1-1 gear ratio.

1 Like

I got recommended a Voron printer board - BIGTREETECH SKR Pico V1.0. I connected it up via UART to the RaspberryPi, installed klipper through KIAUH and using the config provided by bigtreetech. Essentially used the 3d printing software to setup motion control for the microscope. There are a bunch of options for the illumination on the board too, so I’ll be putting together a full-fledged stepper motor OFM soon. Integration with the server software comes next, but shouldn’t be much of a problem.

I run it from a desktop power supply at 24V. The entire setup was annoying to do for the first time, the how-to is a bit dated and lackluster. I managed to set it up in ~5hrs, but repeated installs would be a matter of minutes if done manually.

My printer is currently occupied with printing more main bodies. Once those finish up, I’m printing the remaining elements. With the “webcam” function, I should even see a live preview from the camera in fluidd, so I’ll try to record something with a 100x objective this time.

2 Likes

Very nice demo, complete with different speed on xy compared with z.

How fast are the xy motors in that video? About 1s per revolution?

Completely default settings, I think I have it marked as a cartesian printer so the speed is governed by acceleration that’s set in the config.

kinematics: cartesian
max_velocity: 500
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30

All of the steppers are at 16 microsteps, tommorow I’ll try to get it moving as fast as possible

1 Like

Photo from the soon-to-be-made builds post. The good news is the motion board fits great, just needs the tray redesigned a tiny bit. I got the microscope moving in Klipper and sharing the camera’s view as a webcam. There are obvious issues with that setup though - need to set gain, exposure and other settings through console, but once I get it cooperating with the OFM server, it should be plug-and-play. Also I stole 5v and ground from an ARGB pin for the illumination.

1 Like

Linking it here, as well as the build category. Vid of the nema14 setup moving under 100x. I’ll try to get it zooming now and send over a second video

1 Like

Okay, the speed is essentially infinite. Below two videos - one of the recording of the screen and one of the microscope. I’ll debug the 100x objective a bit and see if I can make it better, or is it just a case of “bought a used lemon”.

This is at 15000 accel and 1000 max velocity. I imagine I could go even faster on speed, but I see no reason to? Already seems essentially instant

1 Like