This Component solves "All" Motor Problems?! (Motor Encoder) EB#58
ฝัง
- เผยแพร่เมื่อ 4 พ.ค. 2024
- Check out SOLO Motor Controllers here: www.solomotorcontrollers.com/... (affiliate link)
/ @solomotorcontrollers
Try the world's most trusted PCB design software, Altium Designer with
365, for free and 25% off your purchase:
www.altium.com/yt/greatscott!
Check out Altium 365: www.altium.com/altium-365
Check out OctoPart: octopart.com/
You can get the shown components here: (affiliate links)
Magnetic Encoder: s.click.aliexpress.com/e/_DcQ...
AMT102 Encoder: s.click.aliexpress.com/e/_Dlh...
Round LCD: s.click.aliexpress.com/e/_DCv...
Gimbal Motor: s.click.aliexpress.com/e/_DkL...
Previous video: • How TINY Can I go? The...
Stepper Motor video: • Electronic Basics #24:...
Facebook: / greatscottlab
Twitter: / greatscottlab
Instagram: / great.scott.lab
TikTok: / greatscottlab
Discord: / discord
Support me for more videos: www.patreon.com/GreatScott?ty=h
In this electronics basics episode we will have a closer look at motor encoders. Those can not only turn any motor into an awesome and satisfying input device for your projects; but can also turn any kind of motor into a kind of stepper motor. There are many different types of such encoders. So let me show you how they work, what they do and how you can use them. Let's get started ;-)
Websites that were shown during the video:
github.com/scottbez1/smartknob
thesolaruniverse.wordpress.co...
www.mouser.com/datasheet/2/67...
ams.com/documents/20143/36005...
Thanks to Solo Motor Controller for sponsoring this video
www.solomotorcontrollers.com/
0:00 Motor Encoders?
1:23 Intro
2:16 Rotary Encoder Basics
4:40 Disadvantages of Rotary Encoder
5:38 Using a Magnetic Encoder
7:32 Why Precise Positioning of Motors?
8:45 Turning BLDC Motor into Stepper Motor
10:59 Verdict - วิทยาศาสตร์และเทคโนโลยี
I've always wanted to make that SmartKno, and now you go making a video about it and go into more details. Love it!!
I will see what I can do :-)
I also wanna make one please help me out
Me too.
Please make one for home assistant :)
me too
So many amateur astronomers that build encoders to their rig need to know this!
The repeatability / accuracy is pretty bad for on axis magnetic encoders. They're better off with optical / off axis magnetic tape / capacitive encoders.
Technology has been around for decades. They know about it.
@@DUIofPhysics beat me to it lol. still has room for improvement tho!
They're known as digital setting circles. We already have them.
I was going to make the same comment! Thank you for sparing me 😊
However, I wonder how expensive an encoder with 10 arc seconds resolution would be 😬
Encoders on motors have been a key part of my robotics builds, being one of the ways to estimate how far a robot has moved, or try to keep multiple motors going at the same speed. Paired with PID loops they are a key component.
Hey Scott, thanks for your great and always so informative videos. I just wanted to add a small correction, namely that the CUI encoder has a PPR of 2048 - but that is pulses, on each A and B outputs. Because these outputs are in "quadrature", they form a 2-bit Gray code, and the actual resolution is 4x higher than the number of pulses, because you count both the up and down transitions on both signal lines. So the CUI encoder has a PPR (pulses per revolution) of 2048, but a CPR (counts per revolution == resolution) of 8192, which works out to an amazing 0.044° resolution, twice that of the AS5600...
Awesome. Thanks for the feedback.
One of the primary issues I've had with quadrature outputs is needing to read them on interrupts to avoid missing position (which causes a bunch of issues on slow microcontrollers) or needing peripheral microcontrollers just to keep track of position that can be polled when required. Having raw angle from the encoder would make it simpler, at least for cases I've been having trouble with.
If you do know of any way to simplify reading from quadrature outputs, please do let me know.
@@Munjaal7 Yes, depending on the hardware you choose, you can read encoders with no interrupts and zero overhead. It depends on the MCU having support for this, but for example STM32 MCUs or SAMD51 MCUs can do this using their encoder inputs (part of their timer peripherals). ESP32 has support for it also, although its a bit more complicated there, and RP2040 can do it using its handy PIO units.
But a magnetic encoder such as the AS5600 used in this video, or the faster SPI based encoders like a AS5047, AS5048, MA732, MA330, MT6835 and many others can also be read out using digital protocols like I2C or SPI. Compared to using ABZ mode in quadrature using SPI or I2C has higher latency, but for most applications that's not a problem. Using the digital protocols to read the encoders means you don't need any interrupts and can't miss counting them 🙂
If you're interested in this, please drop by www.simplefoc.com and check out our "Drivers Library" where we have Arduino drivers for a variety of magnetic encoders...
@@runger1 I had no idea about MCUs with such support built-in. Thanks a bunch for the info, it'd help me out quite a lot :D.
I'll certainly look into simple FOC as well, looks quite interesting tbh.
one more advantage is there is no mechanical mating between the motor shaft and encoder, so there is no wear or strain induced by the assembly due to possible slight misalignment. This is a huge advantage for durability. Once the magnet is secured and positioned in the center, and the sensor board is secured in an assembly, only initial calibration is needed. This means, it should be stable under vibration, bumps, etc.
Encoders have been around forever, we already knew this
At this level, these matters that you mentioned are very small to the point of neglect.
In fact, this can be approximated to the generation of heat and electromagnetic pollution as a result of the flow of electricity in electronic circuits and wires !! also the sensor in this video is a type of mechanical sensor.
When working on a ventilator system over covid shutdown we got exposed to encoders on motor shafts and I've never looked back. Great way to control all aspects of the motor and now being used on my CNC machine to avoid any skips. Worked extremely well in the ventilator also.
ahh i loved the original video and i checked 3 weeks ago if there where any updates on the project. i hope with this attention somebody will pick it up.
I Ordered this to test for a project at work. Thanks Scott! This should work perfectly!
Glad I could help :-)
I was reading up the project few hours ago! Thanks for uploading this
Scott, You have the finest drawing hand/skills of any youtuber..
GreatScott never disappoints!
Thank you so much :-) I try my best.
he was better back then
I love this topic! I am trying to learn more about encoders. I'd love to see you going a bit "low level" and read an encoder position using a dedicated peripheral of a microcontroller. Showing how to configure the peripheral and all
With all love I appreciate the statement of any kind saying can fix all problems. That’s the a right attitude for someone who is into something. Know the humor of a statement so bold it’s worth giving it a look. One who stands behind an all.
Glad to see someone keeping the smart knob view alive!
This is a game changer for building rotary actuators with feedback. I also have plans to build a homespun weather station and the wind direction sensor is always hard to make accurate with mechanical encoding
Perfect timing, I just rewatched that video, and was curious about the motor used.
Very well (simply) explained, thanks!
Best explanation of rotary encoders I've seen up to date.
Thank you! ^^
Genius Great Scott!
I was planning to make a gaming wheel and, all the rotary encoders were too expensive and the potentiometers were not accurate. But I found out about those magnetic encoders from this video. Thank you!
Fuck yeah! I revisited the video to see any updates but not luck... and suddenly one of my favorite youtubers revive the project!!
I have to get one of those Motor controllers, thankyou for showing how awesome they are :-)
I love scottbez1's smart knob. Thanks for this video!
Great as always!
Great scott worth watching it..
Brilliant video.
Thank you, I've been trying to figure out how to add rotary encoders to my mechanum drive robot and this is exactly what I need. I just ordered 5 off Ali express.
Genuine AS5047P development boarsds can be bought :)
Missed opportunity to talk about SimpleFOC, a true open-source project to drive brushless motors and what the SmartKnob project actually uses under the hood.
😂
The marketing dept might have had issues
Yah SimpleFOC is a great library to use and the source code is quite readable to understand what's happening under the hood. I wish there were more driver boards in the 50A range that were compatible though.
@@matthewremington Almost every driver board is compatible, anything that has an stm32, esp32, or rp2040. That means anything vesc compatible, along with all sorts of other stuff.
@@copper280z Yah I should look more into those VESC boards, many of them have great specs and prices.
This is how my Open Sim Wheel works. Just a big motor with an encoder on the back and a steering wheel on the front. I might not remember properly but it's at least 15000 steps or 0.024 degree, crazy accurate 1kW 10Nm servo motor. Super good force feedback wheel way before direct drive wheels became affordable. And became an instant fan of encoders on regular motors over stepper motor crap.
Great explanation. Thanks a lot
I saw his video on this like a week ago. Good timing
Thanks for your video! Your videos always make my day.
Great work! Keep it up!
Glad you like them!
When I first saw that Haptic Thermostat video, I had a gut feeling that you're going to make a video related to it!
Always interesting and always learning!! Thanks!
My pleasure!
Thanks!
inspirational
Nothing like another great Scott video
Glad you enjoyed it
A good introduction video. It might be a good project to show implementing an encoder setup on the RC car you showed in the video to synchronize the motor speeds. I bet there would be a lot of hobbyists who build RC cars for Arduino projects who would take notice of that. It's a common issue as you pointed out.
Great work! Keep it up!👍🏻
Thank you 🙌
Thanks 👍
I am building a CNC machine and will definitely check out SOLO Motor Controllers‼
Awesome :-)
Thanks for this video, it's very interesting!
Great info thanks.
Very handy. great video 2x👍
Thanks 👍
👍🏻 i recently had a pull request merged to esphome to support that AS5600 encoder. Hopefully will be in the next feature release.
you are the best ❤
Still better than watching the Super Bowl. Thanks for the great videos!
The first time i used a magnetic rotary position sensor was in 2011, a wonderful device from STmicroelectronics
Wow, great video 😊
I learnt something new❤
Thanks very much ❤
My pleasure 😊
I can see a few handy uses for this. didn't know there was an encoder that could handle the sort of torque a big BLDC motor could generate
you are very great!
The magnetic encoders work like magic, except on motors. Especially on BLDC using PWM, they get very confused by all the stray magnetic fields. After evaluations, we went with a glass optical disc to get absolute positioning on hobby-style, high performance, compact drives.
At last you came to know if it. I hope you make good use of it
Really great video, I was looking for such driver.
Glad I could help
This would be awesome in a custom sim steering wheel. Even though such encoders are already being used for precision control.
My thoughts as well
Force feedback is already used in sim steering wheels. Cheap ones use belts or gears but more expensive ones use direct drive. What do you think that could be added from this video that they don't already do?
Entering the motor driver and controller realm is a big one, maybe tomorrow you will use sensorless control using current and voltage values to estimate the angle and speed. Filed-oriented control is a go and maybe later you will use model predictive control.
Your take on a programmable smartknob would be highly appreciated!
Awesome video
Really interesting indeed! Thanks, dude! 😃
Stay safe there with your family! 🖖😊
Maybe 1/8" square neodymium would be easy to align N-S horizontally for such sensor and they are tiny 🤔
Thanks for the video Scott!
detailed
Man, I love your intro
beautiful 👌, is a economical closed loop motor,. i use this sistem in my cnc ( stepper + driver ),. but whit this sistem you can control all motor, very interessing ❤
I've been building encoders, decoders and motor controllers for years and they are so fun. Just hard to sell. I'm currently working on a very affordable absolute nonius encoder.
Great 👍
Thank you! Cheers!
I put such a magnetic rotary sensor on the crankshaft of my Moped (Simson 2-stroke). 😂
I tried to move a BLDC motor according to the crankshaft of the engine. I never finished this project though.
It's interesting to read out the engine rotation though.
Wow, the magnetic encoder is perfect for my project! I didn't even know they existed till now, thanks! The physical ones have a pretty low rpm limit.
Glad I could help!
Been around decades, The early ones had lots of problems, That's why optical encoders using glass plates became industry standard. Optical encoders easily cope with 2800 Rpm.
Servo drives all have optical encoders and tacho generators.
@@dogwalker666 you also get magnetic encoders that work similarly to other relative encoders too, the ones shown in the video were absolute magnetic encoders though. For relative encoders rather than just a magnet put on the shaft it needs a disc with alternating magnetic poles and just produces a similar output to mechanical or optical rotary encoders. Optical is good because of the high number of pulses it can produce per rotation, it is common to use a plastic disc with black paint on it to block the light.
@@conorstewart2214 true and obviously an optical will have much higher PPR than a magnetic, For absolute encoders it is always optical, The plastic disks don’t have the temperature range of the glass due to warping. and the pattern is photo etched rather than paint.
I immediately in my mind placed like 3 or 4 of these in a dash of a modern car. Then you would just select the function for each knob. Be it temperature, fan speed, air flow position, volume etc. the option for a given knob could be on something like a sliding multiposition switch.
there is one car that got main infotainment knob with magnetic encoder and brake. It features not only multiple resolutlion of force feedbacks when rotating but also it locks when you turn it to the end of selection menu, it would be nice to implement sort of feature as this.
Those magnetic encoders aren't entirely linear, but its pretty easy to use a stepper to slowly go through its range and map out the error, then correct for it in software.
I think you'd need to figure out how to calibrate the encoder while the encoder is connected with the motor you plan to use. I think the act of mounting the encoder would introduce small errors to the calibration.
@@ddegn . Yeah, use a small stepper to rotate your whole motor-encoder assembly.
Those encoders tend to have less than 1 or 2 * of non-linearity, so if you don't need THAT much precision, don't worry about it.
@@roboman2444 It's been a while (about ten years) since I've worked with this sort of encoder. I have a video titled *"EncoderPositionAndSpeed130824a"* which shows my attempt to mount an AS5055 encoder inside a hobby servo. My setup had lots of error since the PCB and magnet weren't precisely mounted.
Since my setup included the servo's gear train, I don't think your stepper motor idea would have worked for me.
If I were to try this again, I think I'd just use a good quality quadrature encoder on the servo's output to use to measure the actual vs. theoretical position.
It's nice to see these sorts of encoders being commonly used now. Back when I made my video, I had to order a large batch (100) of diamagnetically magnetized magnets. These sorts of magnets weren't nearly as easy to find ten years ago.
Very interesting, wasn't aware how encoders work!
Glad I could help!
Careful using the Delay function in Arduino it Pauses the whole sketch and stops anything from being sensed conrolled or computed during the delay. It is preferable to establish a timer variable that is updated by the ms of the microcontroller up time and using that to reference on and off timer states.
Superb video bro, 👍 👍👍👍👍
Thanks ✌️
About 2 yrs ago someone invented the HAL effect sensor analog stick for gaming controllers and handheld consoles as a solution for the drift issue of the potentiometer wearing off on the traditional analog sticks, the same principle can be use to replace any potentiometer. My respect and admiration for you Mr. Scott
Hall effect sensor joysticks have been around in consumer electronics since the 1990s at least. They only just started coming back into the light due to stick drift becoming more of a problem.
They also have their share of issues AFAIK, like overshooting artefacts when releasing a stick.
Yeah, my old Taranis X9D has hall effect gimbals. And it's a pretty old radio already.
The first thumbstick, that found in the N64, uses a hall effect sensor. They are still common in higher end flight sim equipment and radio controllers.
Modern consoles don't use them because they are more expensive. They were not invented 2 years ago.
@@Aethid thnx
hi ,thanks for the video, as i have that very problem right now. can you give a little more information on how you connected the 3 wires with the one side of the encoder? it looks like you soldered one half of the wires from the one cable to one contact point and one half to the other. help would be much appritiated
I think you meant to use an ‘interrobang’ ‽ 😊
Great vid!!
Would additional magnetic sensors, spaced a little further, be useful to subtract external magnetic fields from the signal of the magnetic encoder?
There are inductive Sensors available with good resistance against magnetic stray fields, from Renesas or Melexis.
Not like anyone would ACTUALLY use a rotary encoder grafted onto a motor shaft... but along with the reasons you mentioned, you'd burn out the shaft bushing in no time flat since it's only meant to be turned slowly (ish) by hand!
The capacitive encoder looks like it might work very similar to how most calipers work.
I guess when using 2 encoder-rails internal you might even be able to make an absolute encoder which doesn't need cross a reset point to know the position.
But those absolute encoders often use a different interface, thus not A/B quadrature encoding.
The optical encoder diagram you created is slightly off. Generally it's easier to manufacture the encoder if you put sensors A and B on opposite sides of the wheel. That way they can be at the same height making it easier to build. For example, from your diagram, if you put sensor B over to the left of the wheel at the same height as A you will see it will be on the same side of the hole as where you drew it on the right. But I guess you put them together like that to make it easier to show they are offset from each other.
I printed out 125/128 gearing to use my 1024 encoders with locked 1000 count drivers.
Almost all modern industrial servomotors come with high resolution encoders, usually resolvers, that send position using a protocol, like the royalty-free BISS protocol. By high resolution, I mean 2 million counts per turn. The reason for such a high resolution is that PID calculations are much more accurate and therefore the servo follows the target path mich better amd handles small errors better. I used 2000 count encoders for years, and when I switched to 2M, life with servos got a lot better. Now of only there was a hobby grade high resolution encoder.
So now I know what to uses when I can't find anymore old mechanical computer mices.👍
This may be usefull to build cheap wire encoders, for doors/windows or anything that cannot be done with normal encoder.
I am about to repair / build a Handheld vacuum with special functions but I'm not sure how to power / control the DC motor for the vacuum Turbine best. As far as the data sheet goes this mother needs a current Limit but most DC Motor drivers that could be control via Arduino don't have one
How big is the error with off-axis magnet? Did you try it instead of the "black box" capacitve?
Great topic great Scott!
For 50 bucks you can get a bldc motor with built in encoder that’s really beefy if you just look for a AE8Z-7C604-A it’s the clutch motor for the ford automated manual transmission and it’s has the 5 pins you want the 3 phases and 2 encoder outputs
There are other types that work by means of a glass disk that has dark and transparent areas and underneath it is a laser transmitter and receiver.
Great video from Sri lanka😊
Thank you so much 🙂
The display is very cute. I wonder if I could be able to program it
you probably know but you can also control position of bldc motor without encoders using HFI in VESC
Last one is great for building DIY sim racing wheels i think
This could be so useful for an Icom RC-28 alternative.
How is that gimbal motor if you rotate it by hand? Do you feel the steps when unpowered? Or is it smooth? Would you consider it good enough for a smartknob?
cooles Video!
Hello Scott, do you think we can use this for a diy steering wheel? I mean both the encoder and the motor controller?
Just for information sake: once I took apart a broken Y-axis driver from a vinyl cutting plotter and it had an optical encoder attached to a simple brushed DC motor as one unit, so may be there're some cheap off-the-shelf motors with feedback one could buy online, I mean "cheap and affordable", because in my case the spare motor for that fancy cutting machine cost just unreasonable and ridiculous money.
Hey, in your last video a resistor book was shown. Do you know how much power these resistors withstand?
I'd like to see inside of an industrial motor encoder, if you're willing to make a video on them? 😉
The lowest resolution i work with is a 19 bit encoder and the biggest so far is 26 bit encoder, which is 524k and 67.1M pulses per revolution.
I've always wanted to see how they're constructed and how they operate.
Looks interesting, wonder if I can make something like it DIY
Go for it!