Servomotor Serendipity and Preaching the End of the World

Was I the only one expecting the Covid-19 lockdown to go on for a long time, like a year or more? It is so strange to realize that a lot of people don't really understand the concept of social distancing and an airborne pandemic. Perhaps I was right in my prediction. Although Germany, and for the most part, most of the European countries managed to flatten and stop the first wave of infections, which cannot be said for all, especially countries being "governed" by nationalist leaders, I would consider a lockdown open when the global aviation traffic reaches at least 50% of pre-pandemic levels. It seems like a reasonable metric and something that is not going to happen soon.

But I digress.

I'm doing that a lot lately, particularly especially because I'm still sucking hard at my masters. I didn't realize I would be this bad at memorizing stuff from slides and repeating that stuff at will, verbatim. But I am. And it is a problem I don't really have a clear cut solution to. Feel free to post something that works for you. I would be more than happy am desperate to try.


Enough about that. This year is already very not-so-nice, so let's talk about something that is actually quite cool. Something that when I first saw, made my head spin. Something that is controlled yet dizzying, rapid yet precise.

Long story short, I got a small side project and in that, I got to play with a small servo motor. Also, please appreciate the puns.



No, not this nonsense. Well, it's not actually nonsense, it's quite a cool thing, and if you want to play around with these, SparkFun, Adafruit and other hobby electronics websites are a great place to start. But these have literally no standing in front of what I got now. Presenting an industrial servo motor. 

Drumroll, please...

Hmm, does not look that impressive, TBH
It is small as well. 22 mm diameter and 32 mm long.


Let's go through it slowly. What is it?

It is a motor. A BLCD or Brushless DC motor. The type you would find in quadcopters and so on.

Big deal, what is so special about it? I can get those on eBay for cheap.. or no?

I'd like to see you try. This is what is called a servomotor. You get to control the position of the shaft with accuracy in degrees. Kind of like steppers, but that is half of the story. In stepper motors, there is (usually) no feedback and thus no way to confirm if the shaft is at the position you requested it to be. Also, for normal NEMA stepper motors, the typical accuracy is ~0.9(degrees) without dabbing with micro-stepping. Hobby servos (which usually just used a geared brushed DC motor with a potentiometer) have a typical accuracy of +/- 1 degree. Remember that hobby servos cannot spin continuously, and can go from -180 to +180 degrees approx, and do not have position feedback. Only some hobby servos with a 4th "white" wire have feedback, and still no continuous rotation.

(Side Note - There are some hobby BLDC motors and controllers that can effectively transform standard BLDC to the positional servomotor. I think hobby BLDC motors already have Hall effect sensors to sense the position of the magnets to switch the coils accordingly, and these are exploited to modify them to use as a servo. I have not looked into the details, but you can find it here)


The text is not very readable. All the more reason to go see the video on servos from HowToMechatronics.com
But you get the idea for the "Hobby Servo"


Ok, so it is like a hobby servo, but with position feedback and continuous rotation available... That is different but I am still not impressed...

It is so much more than that. Not only it has a positional accuracy of +/-0.1 degrees(? - need to check), but it also has absolute encoder built it. That means it can count the number of total turns the shaft has done and use that information accordingly. It can spin at speeds of up to 7000 RPM and still be precise to 0.1 of a degree(again, need to check). It has hall-effect based position encoders built right into the casing.

Speaking of sensors, it has two temperature probes, one for the coils and one for the casing, and uses them to share the operating environment data as well as self-protection applications so that the motor does not burn itself out. It has stall torque protection and overcurrent protection and overdrive protection. With an input voltage range of 8 to 30V, it is also quite resilient.

Now I can say I am impressed... 

There's more. Obviously, if you have such sensors, there must be a microcontroller inside the motor, right? And there is! you can actually directly program and store the instructions to be executed by the motor, ON THE MOTOR ITSELF! You can program it in BASIC with some company-specific additions to move and control the motor exactly as you want it to. You have Digital input and output pins and a single analog input pin to use the traditional PWM speed control if you or your application so desires. And because you already have a microcontroller in there, why not use it to the max? So the motors (depending on the model) can be chained together based on RS-232 serial or even CANBus, the comms protocol that was used in automotive applications until very recently.

No exploded view photos of the construction are available. But its basically a microcontroller with some sensors and BLDC driving circuit at the end of the motor.


When I initially looked into the motor, I thought, well this is unnecessarily complex. This is engineering trying to solve a problem that does not exist. Why put so much complexity in a simple motor? Motor and controllers should be separate so if one part fails, you only replace what has failed, saving costs. But once I started to work on it, and started to test it, I slowly understood why something like this exists and why it is amazing. It is all about industrial settings and applications.


Consider a large machine with a lot of smaller moving parts. Gears, arms, sliders, injectors, pumps, etc. In a production line, everything needs to be in sync, and keep working like clockwork. Motors control all the movements inside such a machine. and there can be tens, if not hundreds of motors in a large production line. If we use "dumb" or normal motors, we need to run power cables from the controller to all of those motors and depending on the type of motor, it may be up to 5 wires per motor. Not to mention the current requirements and losses. And that is before adding positional feedback for accuracy. Again depending on the type of positional sensor, more wires are added again that need to be sent back to the controller. This is not good.

Even if you manage all that, you have a central PLC (Programmable logic controller) that manages all the motor drives and the sensors. In the hobby area, its Arduino with the L293 Motor Hbridge for DC or stepper control or the PCA9685 for PWM servo control. In industrial applications, it is something like a Siemens Simatic 7. Not so easy to program, and hell expensive to replace if something goes wrong.

Let's say you run a company. There are a lot of things you have to do, in a sequence to run a company. If you are the only employee of the company, not only do you manage the inventory, you operate the machines, produce whatever it is you make, transport it, and then do the sales. Everything is on you. What you should do is hire workers. Duh. Someone should check the inventory, someone else works on the machines, a third person handles the sales. What you do is only coordination between the workers. Maybe keep a track of the overall process and adapt accordingly. Here, you are the PLC. And your workers are like these small industrial servo motors.


Now, if these servos attached/chained to each other, with an independent power supply, and they can be individually controlled by the PLC. Because each motor has a fixed purpose, you can program the individual motor for that particular task only. You can sync the motor sequence based on RS-232 or CANbus or even a simple DigitialPin status. Execute a motion when Digitial Input is High, stop when it is Low. Can you see how simple the resulting wiring and machinery would be? Not only that, but you would also have diagnostics that are built into the machine itself. You can get the performance status of independent modules of the overall machine directly, and you don't need to program any of that into the PLC. Replacements and fault identification would also be improved.


Digressed again. I'm writing this mainly because it's cool, and maybe someone someday will end up in a position like me, and this might help them get the motor at least in some sort of working condition. But that is for the next post. I think this has already been a bit too long to read. For the next part, I'll share the basic datasheets and point of interest for the motor, how I went about connecting the bits and bobs, and the first run of the motor, along with some cool graphs and performance insights. This is a so-called viewer engagement trick, BTW. 

Allow me to close this post in a typical way. And that is by sharing some photos I captured over the past months. As always, feel free to share them, use them as wallpapers for your device. If they bring a smile to your face, let me know of a job well done.

Disused railway line with a very interesting history. Was probably used until the 1930s to ship out the coal from the region of Vetschau.
I so want to make a rocket carriage and zip along here. Maybe some sort of Hyperloop test facility as well?


It is amazing how much a polarizing filter can affect your images. And it's one of the few effects you can't fake on photoshop very well. Highly Recommended.

Not only the sky is bluer, but the grass is also greener... Almost as if it was the other side.

American truck from an older spacetime







This is just random clutter looking good because f/2.8 lens


Stay strong





One of the valley towns in the Black Forest


This one is clearly going overkill on the polarization, but it looks nice to my eyes.











My oldest lens, the EF-S 18-55 f/3.5-5.6 II finally broke. Repeated zooms caused a fatigue failure in one of the ribbon cables controlling the comms from the lens to the aperture blade system. It is very impressive that a supposedly cheap lens lasted this long (12+ years). Maybe once I get some tools, I can do a teardown of that lens... In the meantime, donations anyone? :P

Finally, maybe someone noticed the title of this post. Its quite a fitting song from Chris Cornell, written in the late 1990s. To be fair, all his songs are wonderful, so that would be my music recommendation for this post.

I hope you enjoy reading my little blog. Feedback and other thoughts are, as always very welcome!
So if you have something to share with me...


...Just call and I'll get right back
If your intentions are pure
I'm seeking a friend
for the end
of the world...


Comments

Most viewed posts

Jewel of the Summertime - (2022 edition)

Dead Wishes of The Optimist

Ryzen Room - Part 1