On my Jointer/Planer combination machine I had to crank the table all the way up and down if I switch the machine, because the dust shroud has to flip under the cutterhead. I replaced the Handwheel with a 1.2Nm closed-loop-stepper. Controlling it via Arduino and the huge advantage of the closed loop stepper here is: I also have a display connected that shows Theoretical Position to 0.1mm. And since the stepper doesn't lose steps, I can really count on that. I essentially have a digital readout with position control (normal and fast travel and a 0.1mm button). Now I don't have to hand-crank anymore, its way faster to switch the machine around, I don't have to bend down (The button is higher up than the hand-crank) and the machine is also way more accurate. The original scale was 1mm accuracy. Now I can thickness down to 0.1mm accuracy - repeatably!
I've never seen this guy be happy with anything. In my experience most people find problems with things sometimes, but this dude is a know-it-all and has built a following, which makes me scratch my head. I'm not trolling but go back and listen to him prattle on about this and that being wrong with everything. He contributes zero to the engineering content like smaller channels. I keep blocking his channel yet autoplay keeps putting his videos on when I'm tinkering. Haha.
Used to use those on home built CNC machines . In the past you had to buy double ended stepper motors and add the encoder to it. They have fallen out in favor of DC servo motors now. Much cheaper and easier to do this stuff now than it was 15 years ago. And steppers are far stronger today than they usded to be.
You can get NEMA planetary gearboxes that will fit right on the end of that stepper for a bunch of extra torque Your speed seems high enough to still have it operate quickly enough
Thank you. So much quieter too. This is incredibly useful and I'll be buying a couple of these in the near future. I'm capable of goggling "closed loop stepper motor". I wouldn't mind buying them from an affiliate link tho...
I've used a brand of closed loop steppers, ClearPath by Teknic. They allowed for tuning once mounted and all hardware was attached so they could run at their fastest. They were pretty cool to work with.
Oh man more homework for me now. This might solve several challenges I have with traditional stepper motors in my projects. The additional cost is a pity, but might be a non issue due to the additional complex scenario accuracy. Thanks for making this video.
6:55 another option is a stepper controller with a build-in motion controller, f.eks. tmc5160. You just tell when to go and how fast via SPI or UART and it does all the ramping. As long as you don't to synchronous the motion of several motor, like for a CNC, they are easy to use
For a single motor: this form of closed loop steppers is great. For any multi-axis CNC, the "reaction" time means that the absolute position of the end effector is unknown, as the controller on one axis may already be there, while the other is "making up missed steps". Tracing an arc (for example) with two of these, when pushed anywhere near their limits, will result in inconsistent and difficult to reproduce behavior.
True enough, but the idea is to give both of them motion curves they can follow. And if the controller somehow pauses for 10 ms, both motors will stop, so still on the path
@@Metalcastr Correct. On CNC machines, a simple example of this is feed rate override. When the spindle starts to overload, the feed rate, sometimes multiple axes coordinated, slows down to prevent overloading the spindle motor or ruining the tool or the part being made
A better example is the standing desk Mathias shows in various videos. Assuming a motor per leg, when one side of the desk is heavily loaded, the controller limits the progress of the lessor loaded motor so that it doesn't race ahead. This keeps the desk level
I upgraded my CNC machine to Teknic Clearpath SDSK closed loop steppers. They’re cheaper than servos, but they can be driven with 5V signals. They do require separate 75V DC power supplies. My machine is WAY more powerful and performant, and it doesn’t lose steps. If I have a crash and it does, the controller gets feedback and stops. There are other versions of the motors and they’re easy to control using a Raspberry Pico with PWM or frequency positioning. They’re just amazing. I have some videos of my automatic height dustboot that uses one of those.
9:07 - for a rougly the same price (little bit higher) you can get an integrated step-servo in nema 23-24 size. same performance but with 2-3Nm torque. look for IHSS57 type. as for terminology - "servo" is not a motor type it's a drive type. so any motor with closed loop control is a "servo". closed loop AC motor - AC servo, closed loop DC motor - DC servo, closed loop stepper motor - stepper servo. saying that servo is better than stepper is incorrect because stepper can be a servo too )
Never get here this early. Happy you got your channel back so quick. Really good video. Might be interesting to see these closed loop motors in more "compliant" uses. But would need to overcome the "out of sync" failure. Might be better to have a seperate encoder and handle error correction in the microcontroller.
@@josephesposito9173 most of those things use a direction pin and a step clock to the driver board, even old fasioned pics will do real time output to the drivers.
As far as I know the RP1 doesn't have any standalone RTOS capabilities that would make it better suited for driving motors. There are still some secrets to it I can't worm out of Raspberry Pi, but I think dedicated controllers are best for any applications where you want stability/predictability.@@josephesposito9173
The magnetic encoders can work really well, and commonly have resolution ranging from 14 bits (16384 cpr) to 21 bits (2M cpr). Step loss correction vs field oriented control is entirely decided in the firmware, and I've used the magnetic encoders to great effect in my own projects with field oriented control. I think the closed source firmware for the super cheap mks stepper servos is likely the biggest problem with them, not the encoder.
I can't find the resolution of the motor he bought, but, some of the cheap 12-bit magnetic angle encoders have a significant amount of noise and error (look up MT6701). You won't get a true 12-bit position, and may need to calibrate them first as well. Optical encoders have limited error.
The magnetic encoder is not the problem. The worst close loop steppers don't behave like servos. They simply send a few extra steps at the end of a move if steps were lost. Better than nothing, but I wouldn't pay much for it. A true servo drive the stepper with the minimum current needed to minimize error.
@@propheteyebert7063 yes, you need to use FOC or sine commutation on the stepper which some claim but I have not seen verified yet. Its definitely possible to do.
I think we all wish you had a cnc AND a 3d printer. Not because you need them to make things obviously, but because the rest of us have to rely on those things for our projects. If you had those, I can only imagine all of the awesome things you would discover and share with us about making them work better :)
@@matthiasrandomstuff2221 I think we end up relying on them because we don’t have the skill that people like you have to overcome challenges with conventional tools :)
from a controls perspective its still a good idea to provide higher order motion profiles in closed loop control systems due to higher order vibrations in the rest of the system if you have a more complex/sensitive system. It will also limit overshoot and such, though I am curious as to how these steppers have their controllers tuned and if you could change them to adapt to your given loads/motion profiles.
A third thing to keep in mind when relying on the closed loop driver and not using motion profiles, is that you have no idea how much it's out of position before the move happens. With a motion profile, however, you reduce the likelihood of losing position while also being in control of where it is. That means you can do more complex processing based on that variable.
Could you provide a link to that closed loop stepper? I have an application where it would be great if I could just use a Pi rather than an Arduino + separate stepper control.
My current project involves closed loop stepper motors with a discrete driver, but I'm tapping into the motor's encoder signal with a microcontroller timer peripheral so that it always knows the position of the motor, even when it stalls. I want to avoid the condition that you demonstrated where the motor stalls too far into the "overload" range and the driver shuts down, then needs a power cycle to recover. I'm just having the microcontroller send steps in the direction of the stall to keep the driver outside of the "overload" range. So far I've been testing with a 4 Nm NEMA24, but I just got a 12 Nm NEMA34 to evaluate... That thing is a beast!
When in proximity with machines with large motors (high magnetic fields) and noise (VFD motor drives), you may find optical encoders are preferable. Both will need careful positioning, cable routing and magnetic/electrical screening to avoid spurious behaviour. But they are excellent tools
I believe the ones that detect back emf instead of optical are also more efficient, since they can tell how much force is on the shaft / magnets instead of just position and can output the exact amount of power to counter act it.
Excellent walkthrough of the closed loop stepper motors. Could you provide a link for the motor please? As you mentioned options for the motor are kinda confusing.
For many high torque applications I use Geckodrive DC servo drives. These allow me to repurpose large DC brushed motors up to 80 VDC and 20A. In most cases you have to build your own encoder or a mount for a commercial one but after you figure out how much resolution you really need usually a very simple encoder will suffice. Often I 3D print my encoder assemblies. Industrial motors often have fans that can be removed and the space used to install encoders.
Oh, cool, just what I want. But I'd have to have a business case to get one of those. I could also get a good size closed loop stepper for less than that.
When i went with closed loop on my CNC i had the issue where i had 1.5m long 16-20mm ballscrews attached to it with rigid couplers (after ripping apart flexible ones several times) and it caused a bad feedback in the pid loop . usually you turn the ball-nut at those lenghts but the design didnt allow for that. It became a huge torsion spring that makes the PID loop freak out and screams like its never seen grease in its life at certain feeds.
You can get stable semi-realtime outputs on the Pi if you leverage the chip's DMA functionality. A few years ago I toyed with the "pigpio" library. It lets you create waveforms in software and then the hardware plays it back with perfect timing even if your code gets delayed for a few moments.
Very interesting! The closed loop steppers look like a real winner. BTW, I've used magnetic encoders with FRC robotics and they can resolve 4096 counts per revolution. That may be better, actually, than what the optical encoder is giving you.
regarding the closed loop controller that use a magnet glued on the shaft, I do not see any issue with that instead of an optical encoder. Those hall angular sensors have much higher resolution and speed than the usual optical encoders.
Some of the closed loop steppers like servos can have an autotune feature where they can learn the kind of load they are powering and self adjust to a pretty good motion curve.
4:55 As far as I know, stepper motors (like Nema) can get really hot with no risk of failure. I don't remember exact values, but it can get hot that you can't touch it and it still should be ok.
@eitantal726 they are both. It's a stepper motor with a closed loop feedback system. It reads the position and the controller sends the steps to get to the desired angle. They have come down in price, they used to be very costly but they are not as expensive now. Because the motor and controller are a closed loop it helps with accuracy, if it misses a step, it will just keep adding steps until it gets to the desired angle.
@eitantal726 its called a servo because it is closed loop system. A servo uses position feed back and the controller adjusts to get to the desired position. A stepper just steps a desired amount but depending on the load may skip a step ot 2 and thus not be at the exact position you want. its not just a stepper and encoder. It is tightly integrated with the controller or speed control. It it goes past a point it quickly turns the other way to bring it back to the desired point. so it is a servo because the control and motor are designed in a closed loop system to ensure accuracy. It's not just counting steps, it's ensuring a specific end position can be reached. And stepping in both directions to get to that position.
@@newmonengineering I see. From my perspective (Firmware), I'd just call it a closed-loop stepper. Servos need to be updated with an analog signal every ms or so, and suffer from bounciness. Steppers are harder to control actually, as they need a steady supply of pulses
@@1pcfred Always. Though I think it's fair to say the pretty good stuff has also come down a lot. The ClearPath Servos are quite affordable relative to the best available 20 years ago.
@@1pcfred I guess it's a matter of relativity though. $3-400 for a Nema34 self-contained, programmable, closed loop servo drive with enough power to move a serious machine is a bargain. Even if it's maybe not 'cheap' by hobbyist standards. I paid nearly that much for comparable dumb stepper motors not that long ago.
@@bradley3549 I haven't priced anything in the market lately but generally prices do not drop for quality merchandise. ClearPath is a newcomer in the market. I don't think they were around 20 years ago. Perhaps they were and just were not very high profile? At any rate it was nothing I was familiar with in the past. Slapping drives on motors seems like a monumentally stupid idea to me on the face of it purely from a thermal standpoint. But whatever.
I have these closed loop steppers on a Farmbot that I purchased in China a couple years back. Talking with the supplier, he told me that they were looking to replace the stepper motors and the Farmduino with RS423 closed loop steppers. Via RS423, the stepper can be told how far to go and it will just go there. Under certain circumstance these seem useful but there are bound to be some limitations.
The motor and drive integrated closed-loop stepper motor in the video is produced by our factory. Please consult me if you need. Our algorithm will be better, with a 485 communication version
Do you have a link to where you bought these And could you also talk about the dip switch settings? Lastly, I am so glad you recovered your channel so quickly, I was very sad to see that notice on your second channel! I have been watching for years and love this channel!
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
Stepper motors are fine for the gruden implementations, where it doesnt matter where something ends. And compensate something with just more power. But these computerized allow so much great things be done in modern era... These are fancy tools for DIY for future creators.
Mathias, there are stepper drivers that support non-realtime interfaces. They are usually expensive and designed for industrial or CNC systems, though. I'm sure someone has designed and developed a nice hobbyist grade one out of a cheap micro-controller, though. Being able to send "+500 steps at 300steps/second" over i2c or uart and then not having to worry about timing would be really nice.
That looks good, I was working on a robotics project and had the same issue, the only issue with optical encoders is the stepper doesnt know where it is when powered on, I was going to try using a hall effect encoder which would know the angle at all times, but not got round to finishing it.
Write to EEPROM the last position the servo stops at, every time. On power-up or reset read that last position back then rotate the servo to 0/home, or at least know where you last were mid-code execution. Your implementation will differ from mine of course in my basic rotate between 0-359 degrees only (and never crossing that boundary). Hall and limit switch hysteresis is a real pain, otherwise.
Did you have to write anycode specific to rhw closed loop logic, or did you just use the connections from the R232 connector to the driver A+ A-, B+, B- ?
Hey Matthias, I've noticed that you've been making a lot more projects related to automation lately. Do you think you'll ever build a CNC or anything similar?
Those closed loop steppers really are quite impressive, do they have the ability to output the encoder signal or have a real time positional data feed? This would allow dynamic tuning of motion profiles with the right software.
Have you tried Trinamic's stepper drivers? I've heard great things about them. They seem to make steppers "kind of" closed loop by measuring currents, and they can detect missed steps and stalls.
You might want to look into the Odrive, its an open source brushless motor controller designed for use with encoders, it supports up to 100A so you can get a crazy amount of torque and speed for not a whole lot of money.
Yeah, when you get a stepper motor out of synch, basically you'd have to realign it as with a standard floppy disk drive (but not the more modern kind like Iomega Zip and Clik!). My dad used to have to take our Commodore 1541 over to the shop to realign the drive, but then we got 1541/1571 Drive Alignment and I could follow the relatively simple directions to realign it myself even as a mere kid.
The 1541 used a stepper motor to move the head. It had no means of detecting where the head actually was, so the only way to know was to move the head in one direction until it hit the stop, and skipping steps while at it. Making a horrible noise while it did that. And it always ended up doing that when it got confused. So when you heard that sound, you knew, something was going bad with the disk!
@@matthiasrandomstuff2221: Not necessarily going bad. It and similar drives would make that sound for other reasons too. Drives like the 1541 make that sound when they start a full format, so it doesn't mean anything is going bad. But after a while, the drive would make that sound a lot more than normal, and that is because it started to get out alignment, meaning that the drive was bad more than the disk. But yes, it was caused by bad disks sometimes too. I wouldn't call that sound hugely horrible, though.
5:25 I think that that makes sense, you are asking to perform a greater work, more torque, and either lifting the weight or lowering it is pumping the coils to lift or brake.
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
The magnet is FAR more precise than optical check - actually knows actual position even after reboot, while the optical knows only a "distance". They are far better. And some of the magnetic ones can get 36V, giving you plenty of power to control even larger steppers. And as they use position feedback, they only use high currents when necessary, so the load on the actual stepper during standard operation is lower, extending its life span.
Not all hall sensor based closed loop drivers are positional feedback drivers. Some really are just step compensation drivers. They are not all on the same level.
This is mostly true. The magnet does give the angle in relation to the reading chip. But it also has to do with the failsafe software that drives it. Not all firmware acts the same when it is out of sync.
@@EnlightenedSavage Would you mind to share the details? I, so far, was not able to find optical encoders able to compete with price and ease of installation that would be at least close to precision of magnetic encoders. Especially the need for extended shaft is really the issue on my end.
i've been looking at using CHEAP motors with glass scales, interfacing them with the cnc controller is an absolute pain without spending much bank on a mesa card. so, for semi-auto drilling, i've had to brush off the old ttl circuit design files in my faltering memory. just today struck on the idea of using digital comparators with bcd counters and old fashioned 74ls74 d flip flops to read the encoders, the trick i've thought of is using a target count, a count from the scales, then using the comparator outputs, which are 4bits per, to control the speed through a switched resistor network. i've got a dro waiting in my jungle site cart, my design will probably be more expensive if i sold it in small amounts, but pretty interesting for the other weirdos out there, or for those that want to learn ttl, for some odd reason, many use arduinos for such a simple thing, but hardware works fine.
@matthiasrandomstuff2221 Sorry if you already wrote it somewhere, but I cannot find the reference for the motors you are using and where to buy them. Thanks,
a closed loop stepper and a brushless servo is essentially the same. The advantage of a closed loop stepper is higher torque at the cost of lower max speed so you might be able to skip a gear
He'd get more sponsors if he didn't complain so much about everything he's ever been given. What do I know though. I keep blocking his channel but yt keeps serving me his drivel. He complained about that 20 year old dso he bought for not being feature rich enough ffs. He makes about 20k cad a month I suspect and can easily afford a decent one.
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
It's not that difficult to CNC gears though, just use a 1/8" bit or even smaller bit. The fillet that it gives in the inside corners you can transfer to the larger gear as well and the outside corners for it to mesh properly. But still, your band saw technique still beats a cnc for speed for a single or a few parts what with having to cam, setup/clamp stock and cut and sand the part. CNC really comes into its own for repeatability, 2.5D/3D cutting and larger numbers. I bet if you add a few more gears with a higher gear ratio, that small servo can pull more weight than the stepper motor and do it faster too since it can spin faster and torque at higher speed will improve. But it's no good as a 1:1 replacement. Servos (or the servo controller) can have tuning software to adjust the control loop so it doesn't overshoot/oscillate under certain loads. It's always a trade off of course.
Actually, I think this might be just the solution I've been needing without knowing it. Been wanting to make a pet feeder that was both accurate and reliable but also simple. And the drive system always turned me off. Not satisfied with simply running a brushed DC motor for a specific time. I think a Nema 17 with a similar control scheme to this one would check all the boxes. Provide feedback if the mechanism jammed. Could run on an ESP32 with no quirky issues and no extra components!
I wonder if that closed loop stepper would have a better chance at replacing the beefy stepper if you changed your program so that the motor operates smoothly instead of having to advance in bursts.
Perhaps a different gearing so the closed loop stepper can run continuously? Or faster processing to allow the closed loop stepper to run as fast as the normal stepper continuously?
Nice as long as you only need one of them. As soon as you need two to coordinate PRECISELY which one is where when (such as any X-Y CNC mill/printer), you're SOL.
@@matthiasrandomstuff2221 this has nothing to do with ability of the motors to follow the directed path and everything to do with the CNC controller being no longer able to control the actual path if it doesn't control the acceleration curves itself - which it doesn't, this being the whole point of having the servo in charge.
Are motion profiles hard? I'd say most point to point or velocity moves can be performed with a 345 polynomial, which is about as difficult as high school math and plenty advanced unless you really want to extract the maximum performance out of your machine if you're acceleration limited.
ok, now code the step timing for that with integer math on an embedded processor. then you might not find it so easy. also, polynomials don’t necessarily work. gotta avoid resonance on startup, and available acceleration decreases with speed
I'm not familiar with integer math on embedded processors, i was under the impression that the profile itself was hard, and didn't consider that the difficulties would lie in the implementation. I have an industrial automation background and it is surprising how many servos are controlled by infinite jerk 'naive' motion profiles because people think motion profiles are hard. I suggested a 345 polynomial especially because they're easy, have finite jerk so shouldn't excite resonance, and the acceleration peak doesn't match the velocity peak.
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
Are there any models which have an absolute optical encoder? Also what are some best practises for “homing” the motor in case of power failure? Are hall sensors good enough?
On my Jointer/Planer combination machine I had to crank the table all the way up and down if I switch the machine, because the dust shroud has to flip under the cutterhead.
I replaced the Handwheel with a 1.2Nm closed-loop-stepper. Controlling it via Arduino and the huge advantage of the closed loop stepper here is:
I also have a display connected that shows Theoretical Position to 0.1mm. And since the stepper doesn't lose steps, I can really count on that. I essentially have a digital readout with position control (normal and fast travel and a 0.1mm button).
Now I don't have to hand-crank anymore, its way faster to switch the machine around, I don't have to bend down (The button is higher up than the hand-crank) and the machine is also way more accurate. The original scale was 1mm accuracy. Now I can thickness down to 0.1mm accuracy - repeatably!
I've never seen this guy be happy with anything. In my experience most people find problems with things sometimes, but this dude is a know-it-all and has built a following, which makes me scratch my head. I'm not trolling but go back and listen to him prattle on about this and that being wrong with everything. He contributes zero to the engineering content like smaller channels. I keep blocking his channel yet autoplay keeps putting his videos on when I'm tinkering. Haha.
Is this a hammer planer/joiner? I'll be curious to see pictures as I've also considered making this exact set up for my combo machine
I used closed loop steppers on my home made CNC router, I couldn't be happier with the way it performs and it was so easy to do.
I put then on a lathe and a mill and am also very happy with them, they do not get hot in use like the previous open loop motors.
Used to use those on home built CNC machines . In the past you had to buy double ended stepper motors and add the encoder to it. They have fallen out in favor of DC servo motors now. Much cheaper and easier to do this stuff now than it was 15 years ago. And steppers are far stronger today than they usded to be.
You can get NEMA planetary gearboxes that will fit right on the end of that stepper for a bunch of extra torque
Your speed seems high enough to still have it operate quickly enough
Thank you. So much quieter too. This is incredibly useful and I'll be buying a couple of these in the near future. I'm capable of goggling "closed loop stepper motor". I wouldn't mind buying them from an affiliate link tho...
The affiliate link might also be good to get the right "kind" of closed loop motor, like he discusses at the end
What have you used before?
(Yes, I know what this is. 😁)
I'm interested too tbh
same here!
I've used a brand of closed loop steppers, ClearPath by Teknic. They allowed for tuning once mounted and all hardware was attached so they could run at their fastest. They were pretty cool to work with.
Oh man more homework for me now. This might solve several challenges I have with traditional stepper motors in my projects. The additional cost is a pity, but might be a non issue due to the additional complex scenario accuracy. Thanks for making this video.
6:55 another option is a stepper controller with a build-in motion controller, f.eks. tmc5160. You just tell when to go and how fast via SPI or UART and it does all the ramping. As long as you don't to synchronous the motion of several motor, like for a CNC, they are easy to use
For a single motor: this form of closed loop steppers is great. For any multi-axis CNC, the "reaction" time means that the absolute position of the end effector is unknown, as the controller on one axis may already be there, while the other is "making up missed steps". Tracing an arc (for example) with two of these, when pushed anywhere near their limits, will result in inconsistent and difficult to reproduce behavior.
True enough, but the idea is to give both of them motion curves they can follow. And if the controller somehow pauses for 10 ms, both motors will stop, so still on the path
Would a computer read each encoder and sync operations that way? Like control other motors if one gets slowed or jammed, to keep a process in-check?
@@Metalcastr Correct. On CNC machines, a simple example of this is feed rate override. When the spindle starts to overload, the feed rate, sometimes multiple axes coordinated, slows down to prevent overloading the spindle motor or ruining the tool or the part being made
Thank you! @@gregfeneis609
A better example is the standing desk Mathias shows in various videos. Assuming a motor per leg, when one side of the desk is heavily loaded, the controller limits the progress of the lessor loaded motor so that it doesn't race ahead. This keeps the desk level
I upgraded my CNC machine to Teknic Clearpath SDSK closed loop steppers. They’re cheaper than servos, but they can be driven with 5V signals. They do require separate 75V DC power supplies. My machine is WAY more powerful and performant, and it doesn’t lose steps. If I have a crash and it does, the controller gets feedback and stops. There are other versions of the motors and they’re easy to control using a Raspberry Pico with PWM or frequency positioning. They’re just amazing. I have some videos of my automatic height dustboot that uses one of those.
@gary8564 Please post a link to your videos!
9:07 - for a rougly the same price (little bit higher) you can get an integrated step-servo in nema 23-24 size. same performance but with 2-3Nm torque. look for IHSS57 type.
as for terminology - "servo" is not a motor type it's a drive type. so any motor with closed loop control is a "servo".
closed loop AC motor - AC servo,
closed loop DC motor - DC servo,
closed loop stepper motor - stepper servo.
saying that servo is better than stepper is incorrect because stepper can be a servo too )
Never get here this early. Happy you got your channel back so quick. Really good video. Might be interesting to see these closed loop motors in more "compliant" uses. But would need to overcome the "out of sync" failure. Might be better to have a seperate encoder and handle error correction in the microcontroller.
That fun little Pi heatsink looks like it's about to take flight!
just a bit of aluminium flashing, but surprisingly effective
Could the Pi5 with the RP1 chip do the real time drive of the stepper that Matthias was taking about in a single board?
@@josephesposito9173 most of those things use a direction pin and a step clock to the driver board, even old fasioned pics will do real time output to the drivers.
As far as I know the RP1 doesn't have any standalone RTOS capabilities that would make it better suited for driving motors. There are still some secrets to it I can't worm out of Raspberry Pi, but I think dedicated controllers are best for any applications where you want stability/predictability.@@josephesposito9173
The magnetic encoders can work really well, and commonly have resolution ranging from 14 bits (16384 cpr) to 21 bits (2M cpr). Step loss correction vs field oriented control is entirely decided in the firmware, and I've used the magnetic encoders to great effect in my own projects with field oriented control.
I think the closed source firmware for the super cheap mks stepper servos is likely the biggest problem with them, not the encoder.
Those with a magnet, have a Hall effect encoder. 12 -15 bit so more accurate than most optical.
Yeah, hopefully Matthias picks one up because I'm sure they have their own unique quirks.
I can't find the resolution of the motor he bought, but, some of the cheap 12-bit magnetic angle encoders have a significant amount of noise and error (look up MT6701). You won't get a true 12-bit position, and may need to calibrate them first as well. Optical encoders have limited error.
The magnetic encoder is not the problem. The worst close loop steppers don't behave like servos. They simply send a few extra steps at the end of a move if steps were lost. Better than nothing, but I wouldn't pay much for it.
A true servo drive the stepper with the minimum current needed to minimize error.
@@propheteyebert7063 yes, you need to use FOC or sine commutation on the stepper which some claim but I have not seen verified yet. Its definitely possible to do.
I think we all wish you had a cnc AND a 3d printer. Not because you need them to make things obviously, but because the rest of us have to rely on those things for our projects. If you had those, I can only imagine all of the awesome things you would discover and share with us about making them work better :)
you don't *have* to rely on CNC and 3d printers. Conventional tools cost less than those.
@@matthiasrandomstuff2221 I think we end up relying on them because we don’t have the skill that people like you have to overcome challenges with conventional tools :)
You certainly do not speak for all of us.
@@cjhoyle Correct. A poor wording choice on my part
from a controls perspective its still a good idea to provide higher order motion profiles in closed loop control systems due to higher order vibrations in the rest of the system if you have a more complex/sensitive system. It will also limit overshoot and such, though I am curious as to how these steppers have their controllers tuned and if you could change them to adapt to your given loads/motion profiles.
A third thing to keep in mind when relying on the closed loop driver and not using motion profiles, is that you have no idea how much it's out of position before the move happens. With a motion profile, however, you reduce the likelihood of losing position while also being in control of where it is. That means you can do more complex processing based on that variable.
Could you provide a link to that closed loop stepper? I have an application where it would be great if I could just use a Pi rather than an Arduino + separate stepper control.
My current project involves closed loop stepper motors with a discrete driver, but I'm tapping into the motor's encoder signal with a microcontroller timer peripheral so that it always knows the position of the motor, even when it stalls. I want to avoid the condition that you demonstrated where the motor stalls too far into the "overload" range and the driver shuts down, then needs a power cycle to recover. I'm just having the microcontroller send steps in the direction of the stall to keep the driver outside of the "overload" range. So far I've been testing with a 4 Nm NEMA24, but I just got a 12 Nm NEMA34 to evaluate... That thing is a beast!
I'm curious what application require that.
Yes doing small+deep on a CnC is tricky, but you can make many very precise thin gears and glue them together
And as we know via Wandel experimentation the glue is stronger than the wood - but can you overlay and stack them as a laminate accurately.
I have no knowledge about electronics and motors but it's still enjoyable and facinating.
Looking forward to seeing all teh projects with these stepper motors
how have you not build your own cnc yet, with your programming skills and everything the sky is the limit :)
When in proximity with machines with large motors (high magnetic fields) and noise (VFD motor drives), you may find optical encoders are preferable. Both will need careful positioning, cable routing and magnetic/electrical screening to avoid spurious behaviour. But they are excellent tools
I believe the ones that detect back emf instead of optical are also more efficient, since they can tell how much force is on the shaft / magnets instead of just position and can output the exact amount of power to counter act it.
LOVE working with Clearpath closed loop servos. Fast, quiet, strong and onboard software and monitoring. Would never go back to steppers.
Excellent walkthrough of the closed loop stepper motors. Could you provide a link for the motor please? As you mentioned options for the motor are kinda confusing.
For many high torque applications I use Geckodrive DC servo drives. These allow me to repurpose large DC brushed motors up to 80 VDC and 20A. In most cases you have to build your own encoder or a mount for a commercial one but after you figure out how much resolution you really need usually a very simple encoder will suffice. Often I 3D print my encoder assemblies. Industrial motors often have fans that can be removed and the space used to install encoders.
Oh, cool, just what I want. But I'd have to have a business case to get one of those. I could also get a good size closed loop stepper for less than that.
Nice to see you discovering the "joys" of closed loop :)
Be carefull though and safety first :)
When i went with closed loop on my CNC i had the issue where i had 1.5m long 16-20mm ballscrews attached to it with rigid couplers (after ripping apart flexible ones several times) and it caused a bad feedback in the pid loop .
usually you turn the ball-nut at those lenghts but the design didnt allow for that. It became a huge torsion spring that makes the PID loop freak out and screams like its never seen grease in its life at certain feeds.
You can get stable semi-realtime outputs on the Pi if you leverage the chip's DMA functionality. A few years ago I toyed with the "pigpio" library. It lets you create waveforms in software and then the hardware plays it back with perfect timing even if your code gets delayed for a few moments.
I appreciate that you make things by hand rather than CNC.
Very interesting! The closed loop steppers look like a real winner. BTW, I've used magnetic encoders with FRC robotics and they can resolve 4096 counts per revolution. That may be better, actually, than what the optical encoder is giving you.
Are you going to put one on your screw advance box joint jig like it was originally? Maybe put a pneumatic piston on it to push it through the saw.
Would be an improvement, but the gears work very well
Now you need to hook that up to your box joint jig
a motorized table saw fence would be interesting too.
He did that in the original design, forever ago.
The gears are way more practical and reliable :)
regarding the closed loop controller that use a magnet glued on the shaft, I do not see any issue with that instead of an optical encoder. Those hall angular sensors have much higher resolution and speed than the usual optical encoders.
Some of the closed loop steppers like servos can have an autotune feature where they can learn the kind of load they are powering and self adjust to a pretty good motion curve.
I think most things the stepper would drive would have less inertia as seen from the motor, so it probably does ok with normal loads.
4:55 As far as I know, stepper motors (like Nema) can get really hot with no risk of failure. I don't remember exact values, but it can get hot that you can't touch it and it still should be ok.
biggest risk is probalby exceeding the curie point of the permanent magnet
I like servo steppers, they are a bit more expensive but they are easy to use and perform very well.
servo steppers? are they servo or are they steppers?
@eitantal726 they are both. It's a stepper motor with a closed loop feedback system. It reads the position and the controller sends the steps to get to the desired angle. They have come down in price, they used to be very costly but they are not as expensive now. Because the motor and controller are a closed loop it helps with accuracy, if it misses a step, it will just keep adding steps until it gets to the desired angle.
@@newmonengineering why do you call it a servo then? There's no servo, just stepper + encoder
@eitantal726 its called a servo because it is closed loop system. A servo uses position feed back and the controller adjusts to get to the desired position. A stepper just steps a desired amount but depending on the load may skip a step ot 2 and thus not be at the exact position you want. its not just a stepper and encoder. It is tightly integrated with the controller or speed control. It it goes past a point it quickly turns the other way to bring it back to the desired point. so it is a servo because the control and motor are designed in a closed loop system to ensure accuracy. It's not just counting steps, it's ensuring a specific end position can be reached. And stepping in both directions to get to that position.
@@newmonengineering I see. From my perspective (Firmware), I'd just call it a closed-loop stepper. Servos need to be updated with an analog signal every ms or so, and suffer from bounciness. Steppers are harder to control actually, as they need a steady supply of pulses
ooh, super excited about this subject. These have really improved and come way down in price in recent years.
Cheap stuff be cheap. The good stuff still costs a lot.
@@1pcfred Always. Though I think it's fair to say the pretty good stuff has also come down a lot. The ClearPath Servos are quite affordable relative to the best available 20 years ago.
@@1pcfred I guess it's a matter of relativity though. $3-400 for a Nema34 self-contained, programmable, closed loop servo drive with enough power to move a serious machine is a bargain. Even if it's maybe not 'cheap' by hobbyist standards. I paid nearly that much for comparable dumb stepper motors not that long ago.
@@bradley3549 I haven't priced anything in the market lately but generally prices do not drop for quality merchandise. ClearPath is a newcomer in the market. I don't think they were around 20 years ago. Perhaps they were and just were not very high profile? At any rate it was nothing I was familiar with in the past. Slapping drives on motors seems like a monumentally stupid idea to me on the face of it purely from a thermal standpoint. But whatever.
I have these closed loop steppers on a Farmbot that I purchased in China a couple years back. Talking with the supplier, he told me that they were looking to replace the stepper motors and the Farmduino with RS423 closed loop steppers. Via RS423, the stepper can be told how far to go and it will just go there. Under certain circumstance these seem useful but there are bound to be some limitations.
The motor and drive integrated closed-loop stepper motor in the video is produced by our factory. Please consult me if you need. Our algorithm will be better, with a 485 communication version
Do you have a link to where you bought these And could you also talk about the dip switch settings?
Lastly, I am so glad you recovered your channel so quickly, I was very sad to see that notice on your second channel!
I have been watching for years and love this channel!
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
Stepper motors are fine for the gruden implementations, where it doesnt matter where something ends. And compensate something with just more power.
But these computerized allow so much great things be done in modern era...
These are fancy tools for DIY for future creators.
Mathias, there are stepper drivers that support non-realtime interfaces. They are usually expensive and designed for industrial or CNC systems, though. I'm sure someone has designed and developed a nice hobbyist grade one out of a cheap micro-controller, though. Being able to send "+500 steps at 300steps/second" over i2c or uart and then not having to worry about timing would be really nice.
I wish my rear wiper on my car was like this, and not slowly "progressing" towards downward position throughout the years.
That looks good, I was working on a robotics project and had the same issue, the only issue with optical encoders is the stepper doesnt know where it is when powered on, I was going to try using a hall effect encoder which would know the angle at all times, but not got round to finishing it.
Write to EEPROM the last position the servo stops at, every time. On power-up or reset read that last position back then rotate the servo to 0/home, or at least know where you last were mid-code execution. Your implementation will differ from mine of course in my basic rotate between 0-359 degrees only (and never crossing that boundary). Hall and limit switch hysteresis is a real pain, otherwise.
Clearpath SD nema 34 are a beast. I have them on my CNC
Can you link to the closed loop stepper motor you got please?
I love your videos Matthias!
Did you have to write anycode specific to rhw closed loop logic, or did you just use the connections from the R232 connector to the driver A+ A-, B+, B- ?
9:39 I believe those controllers run real field oriented control, the magnet sensor output a 12bit absolute angle
Hey Matthias, I've noticed that you've been making a lot more projects related to automation lately. Do you think you'll ever build a CNC or anything similar?
Those closed loop steppers really are quite impressive, do they have the ability to output the encoder signal or have a real time positional data feed? This would allow dynamic tuning of motion profiles with the right software.
Have you tried Trinamic's stepper drivers? I've heard great things about them. They seem to make steppers "kind of" closed loop by measuring currents, and they can detect missed steps and stalls.
They can detect, but they just error out.
@@Tedlasman yes, they don't replace those neat closed loop systems, but they would be an upgrade for his old and trusty buh motor, I guess.
You might want to look into the Odrive, its an open source brushless motor controller designed for use with encoders, it supports up to 100A so you can get a crazy amount of torque and speed for not a whole lot of money.
This is actually the first closed loop stepper I've seen with a stepper driver built in 🤔 Normally they all need a separate driver
The wheels on the stepper go round and round
Yeah, when you get a stepper motor out of synch, basically you'd have to realign it as with a standard floppy disk drive (but not the more modern kind like Iomega Zip and Clik!). My dad used to have to take our Commodore 1541 over to the shop to realign the drive, but then we got 1541/1571 Drive Alignment and I could follow the relatively simple directions to realign it myself even as a mere kid.
The 1541 used a stepper motor to move the head. It had no means of detecting where the head actually was, so the only way to know was to move the head in one direction until it hit the stop, and skipping steps while at it. Making a horrible noise while it did that. And it always ended up doing that when it got confused. So when you heard that sound, you knew, something was going bad with the disk!
@@matthiasrandomstuff2221: Not necessarily going bad. It and similar drives would make that sound for other reasons too. Drives like the 1541 make that sound when they start a full format, so it doesn't mean anything is going bad. But after a while, the drive would make that sound a lot more than normal, and that is because it started to get out alignment, meaning that the drive was bad more than the disk. But yes, it was caused by bad disks sometimes too. I wouldn't call that sound hugely horrible, though.
Maybe you don't want to endorse a particular brand, but a name and/or link for these would be appreciated, thanks!
5:25 I think that that makes sense, you are asking to perform a greater work, more torque, and either lifting the weight or lowering it is pumping the coils to lift or brake.
How many encoder lines does this have per rev? Most specs seem to say 1000/4000 which is a bit confusing (which one is it?)
Man, I wish these things were available when I converted a mill/drill into a homebrew CNC. It would have made things quite a bit easier.
I’m now waiting for Wooden CNC..
Great video! Would you share a link to purchase the motor? Thanks!
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
Do I have a project in mind for this? No. Did I just buy one anyways? Yes.
ha ha, neat toy!
great explanation and demo, thx!
Would love to try a motor like that some day.
The magnet is FAR more precise than optical check - actually knows actual position even after reboot, while the optical knows only a "distance". They are far better. And some of the magnetic ones can get 36V, giving you plenty of power to control even larger steppers. And as they use position feedback, they only use high currents when necessary, so the load on the actual stepper during standard operation is lower, extending its life span.
Not all hall sensor based closed loop drivers are positional feedback drivers. Some really are just step compensation drivers. They are not all on the same level.
This is mostly true. The magnet does give the angle in relation to the reading chip. But it also has to do with the failsafe software that drives it. Not all firmware acts the same when it is out of sync.
This is not necessarily true. Careful when making sweeping generalisations.
@@EnlightenedSavage Would you mind to share the details? I, so far, was not able to find optical encoders able to compete with price and ease of installation that would be at least close to precision of magnetic encoders. Especially the need for extended shaft is really the issue on my end.
That’s not true. There are absolute-position optical sensors available. Doesn’t mean this isn’t a better solution, of course :)
Great video, thanks for sharing what you learned!
"I can just treat that like it was a stepper motor..."
Of course; that's because it IS one.
i've been looking at using CHEAP motors with glass scales, interfacing them with the cnc controller is an absolute pain without spending much bank on a mesa card.
so, for semi-auto drilling, i've had to brush off the old ttl circuit design files in my faltering memory. just today struck on the idea of using digital comparators with bcd counters and old fashioned 74ls74 d flip flops to read the encoders, the trick i've thought of is using a target count, a count from the scales, then using the comparator outputs, which are 4bits per, to control the speed through a switched resistor network. i've got a dro waiting in my jungle site cart, my design will probably be more expensive if i sold it in small amounts, but pretty interesting for the other weirdos out there, or for those that want to learn ttl, for some odd reason, many use arduinos for such a simple thing, but hardware works fine.
Very interesting! I wonder what could you be building to use these? I guess we shall have to wait 🙂
@matthiasrandomstuff2221 Sorry if you already wrote it somewhere, but I cannot find the reference for the motors you are using and where to buy them.
Thanks,
Hi Matthias, could you share the link for the motor? Thank you!
Can you post the closed loop stepper you used?
does your strength tester take a picture when it fails!? I see image @8:13
yes, at start and at failure
The question we all have Matthias is, what are you cooking? We are all eager...
I'm rather non commital. Just dabbling. But I've used stepper motors for various projects before -- see link in description
Do you have any info on these stepper motors? A link? I looked in description but didn’t see anything. Are they 12v ?
how do you restrict it to say 180 degrees? In your example it seemed to rotate all the way around
If you only want it to turn 180 degrees, then tell it to turn 180 degrees instead of telling it to turn all the way around
Do you have part number, brand or location where you purchased the motor?
This is what love must feel like.. PLEASE be a reasonable price..
Excellent
a closed loop stepper and a brushless servo is essentially the same. The advantage of a closed loop stepper is higher torque at the cost of lower max speed so you might be able to skip a gear
we should get a "stepper killer" vendor to sponsor you with some motors
He'd get more sponsors if he didn't complain so much about everything he's ever been given. What do I know though. I keep blocking his channel but yt keeps serving me his drivel. He complained about that 20 year old dso he bought for not being feature rich enough ffs. He makes about 20k cad a month I suspect and can easily afford a decent one.
@@jstro-hobbytech Wow you sound extremely miserable
@brandonb6164 not at all I'm young. Rich. Retired and do a ton of charity work. What about you
@@brandonb6164this guy is a knob though. Just stating a fact
Used a lot in 3D printers/CNC machines
can you post a link to the page where to buy this stepper with encoder, please? Thanks in advance.
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
Can you please evaluate a similar integrated servo?
It's not that difficult to CNC gears though, just use a 1/8" bit or even smaller bit. The fillet that it gives in the inside corners you can transfer to the larger gear as well and the outside corners for it to mesh properly.
But still, your band saw technique still beats a cnc for speed for a single or a few parts what with having to cam, setup/clamp stock and cut and sand the part. CNC really comes into its own for repeatability, 2.5D/3D cutting and larger numbers.
I bet if you add a few more gears with a higher gear ratio, that small servo can pull more weight than the stepper motor and do it faster too since it can spin faster and torque at higher speed will improve. But it's no good as a 1:1 replacement.
Servos (or the servo controller) can have tuning software to adjust the control loop so it doesn't overshoot/oscillate under certain loads. It's always a trade off of course.
Actually, I think this might be just the solution I've been needing without knowing it. Been wanting to make a pet feeder that was both accurate and reliable but also simple. And the drive system always turned me off. Not satisfied with simply running a brushed DC motor for a specific time. I think a Nema 17 with a similar control scheme to this one would check all the boxes. Provide feedback if the mechanism jammed. Could run on an ESP32 with no quirky issues and no extra components!
I wonder if that closed loop stepper would have a better chance at replacing the beefy stepper if you changed your program so that the motor operates smoothly instead of having to advance in bursts.
Software limitation. But also, the load cell amplifier takes a while to get a reading, so it helps to let it settle just a bit.
Perhaps a different gearing so the closed loop stepper can run continuously? Or faster processing to allow the closed loop stepper to run as fast as the normal stepper continuously?
Nice as long as you only need one of them. As soon as you need two to coordinate PRECISELY which one is where when (such as any X-Y CNC mill/printer), you're SOL.
in that case, I just wouldn't give them motions that are impossible to follow.
@@matthiasrandomstuff2221 this has nothing to do with ability of the motors to follow the directed path and everything to do with the CNC controller being no longer able to control the actual path if it doesn't control the acceleration curves itself - which it doesn't, this being the whole point of having the servo in charge.
I’ve been using motors from Lin Engineering. Similar but commanded over serial.
+1 for pliers hammer at 7:57! 😄
Are motion profiles hard? I'd say most point to point or velocity moves can be performed with a 345 polynomial, which is about as difficult as high school math and plenty advanced unless you really want to extract the maximum performance out of your machine if you're acceleration limited.
ok, now code the step timing for that with integer math on an embedded processor. then you might not find it so easy.
also, polynomials don’t necessarily work. gotta avoid resonance on startup, and available acceleration decreases with speed
I'm not familiar with integer math on embedded processors, i was under the impression that the profile itself was hard, and didn't consider that the difficulties would lie in the implementation. I have an industrial automation background and it is surprising how many servos are controlled by infinite jerk 'naive' motion profiles because people think motion profiles are hard. I suggested a 345 polynomial especially because they're easy, have finite jerk so shouldn't excite resonance, and the acceleration peak doesn't match the velocity peak.
Can you share which motor model you bought and where?
We Are China's closed-loop stepper motor r & D and manufacturers, if there is a lot of demand (more than 1000 sets) , you can contact us directly to buy.
The cheap boards with the glued magnet, uses the same encoder chip as "proper" servo's, it performans about the same, its more janky though.
what if you used a wood gear reduction, how much newton meter advantage could you potentially get?
The motor and drive integrated closed-loop stepper motor in the video is produced by our factory. Please consult me if you need.🎉
send me an email
Are there any models which have an absolute optical encoder? Also what are some best practises for “homing” the motor in case of power failure? Are hall sensors good enough?
I don't find this topic very interesting or useful to me, but I always love your videos, so thumbs up anyway!
Fascinating!