Virtual Reality

Which do you remember better – the city in the chapter on geography that you read just last week, or the location of the vacation that you took many months back? I bet it is the vacation! The reason for this is that physically experiencing something makes it way more memorable than merely reading about it. Now what if you could experience your geography lessons in much the same way?

That is the promise of virtual reality. Virtual reality is all about computers giving you the illusion that you are no longer, say in your living room, but rather in a computer generated virtual world. The goal of virtual reality is to make this virtual world as real and as convincing as possible – hence the name virtual reality.

To experience virtual reality, you don a pair of special goggles, like say the Oculus Rift, that completely blocks out the external world. The real world is replaced in the goggles by a pair of screens – one in front of each eye. Each screen presents the corresponding eye with what it would have seen, had it been looking at the same scene, not in a virtual world, but in the real world. This gives your brain the illusion that you are viewing a real 3 dimensional scene. The googles take the illusion even further – as you move your head around, sensors in the goggles detect the movement of your head and the scene changes to account for your new head position. Further, in this virtual world, you have a virtual body, including virtual arms. A camera on the goggles track your real hand and the software makes your virtual arm mimic the movements of your real arm, giving you the ability to touch objects in the virtual world by moving your real hand.

A person playing a shooting computer game wearing the Oculus Rift goggles. The goggles completely cover the wearers eyes. On the lower right you see the images on the two screens in the Oculus Rift. You can also see the virtual gun in the image being held by the users virtual hand.

Creating this illusion is the result of a lot of team work. The producer of the experience defines the concept for the virtual world. A digital artist then creates the world in a 3D authoring tool like Maya. A computer programmer then takes that virtual world and wires it up so that the goggles can sense the wearers movements and adjust the virtual world.

All of this is technology on the cutting edge. Look for it to become more mainstream in the next few years.

Posted in Uncategorized | Leave a comment

Waterfall performance management in agile organizations!

businessman-573024_640As software engineers, we do not realize it but we live and operate in a weird world, very different from that of our colleagues in sales or marketing or even our engineering colleagues say in manufacturing. We grapple with a level of uncertainty and chaos not found I would argue in any other part of the company. So much so that we have come up with processes like agile to help manage that chaos and so far, that seems to be working pretty well.

However the next challenge, and one that nobody seems to be talking about, is that an agile software team must live within a company with agile friendly processes. Not doing so dilutes the effectiveness of those often vital processes and also results in all sort of other tensions that are hard to diagnose. One example of an area that needs to change to embrace agile development, is performance management and compensation.

What is wrong with the current system?

Well, first of all, what is the current system? The current performance management cycle – setting commitments, doing reviews and so on runs on the HR clock or the annual clock. It happens twice a year, at the same time, across the company. Sales goals are set, manufacturing targets are set and so presumably the goals for software engineers should be set as well – right? Hmmm … not so simple. Software project start up at all times of the year. Some projects slip blocking resources for other projects thus delaying them. Other projects get cancelled – the software train is ready, when it is ready, if at all it ever leaves the station! This can make commitment setting really hard. Software engineers often hear their managers or HR say things like put in what you can and update it later.

Then, there is a lot of hand wringing about creating SMART commitments. To start off with most people cannot even say what the abbreviation SMART stands for. To make matters worse there are a multitude of definitions. Leaving all that aside, writing SMART commitments is not easy as it sounds. Software is notoriously hard to measure – you cannot commit to “Write X lines of code, with less than Y bugs in Z months”. That simply makes no sense. It also makes no sense to put in the specifics of what I am going to build because that changes through the life of the project sometimes drastically. So where does that leave you – a commitment that reads “I will fulfill all my sprint goals on time” – do you really have to put that in writing? That is what is expected!

So what ends up happening is that people make a best effort at putting in commitments and try and make those commitments as SMART as possible. In the mid year and annual discussions, people look at the commitments and realize they changed substantially. So the employee ends up writing what he really did and the manager puts in her comments on what actually happened, largely ignoring what was put in at the start!

In reality what happens through the year is that the manager and the employee or the employee with the scrum team figure out what needs to be done every two weeks and they just do it. Their inputs vary widely – they respond to new management initiatives, new market information, competitive threats, beta feedback, lessons learnt from the last sprint and more. Some things go well and  others fail, for various reasons . However there is constant explicit and implicit feedback to the employee from their peers and their management chain and corrections are made. So commitments are set, actions are taken and reviews happen multiple times through the year – in the scrum tool chain and via hallway conversations. These are the commitments that really matter and they do not sit in the HR system.

So Why Do We Set Commitments?

Here are the reasons I can think of:

  1. Clear Expectation Setting: The idea is that if there are specific measurable (the S and M in SMart) commitments, then employees can be held accountable to deliver. However, as we saw, the specific measurable commitments are in scrum tools and seldom in the HR system or they quite often evolve in hallway conversations. Further in sound organizations, you expect people to deliver what the promised without having it in writing. If there are issues they are caught and fixed immediately without waiting for a 6 month performance review.
  2. Compensation: This is how an employee thinks this works – I set Specific Measurable (SM in SMart) commitments, exceed them (and Measure that!) and then get a big bonus. That makes sense right? If I set Achievable goals (the A in smArt goals), it should be possible to achieve and with some elbow grease, exceed them! The problem is that in a high performing organization, everybody hopes to exceed their goals. The reality is that companies have limited bonus pools. This and the fact that we do differentiated compensation, means that and not everybody can get an out sized bonus. What eventually ends up happening is that the managers sit together and see who had the biggest impact. However impact is as much or more about opportunity than hard work or skill. Think about the software engineers who have made the biggest impact – do you think Bill Gates or Mark Zukerberg were the smartest, most hardworking people of their times – far from it. They were one among thousands of smart and hardworking people – they were the people who had the opportunity and a ton of luck, made the impact and got the outsized bonus.
  3. Established “best practice”: You can set a specific, measurable, achievable sales quota at the start of the year and at the end of the year measure results and hand out a bonus, proportional to how much over the quota the salesperson came in. It is easy to give manufacturing a specific measurable production, quality or cost savings goal and then at the end of an arbitrary period of time ( a year) measure it and give people bonuses in direct proportion to revenue impact. If this works so well with sales and marketing, it must work well with software engineers right? Wrong! In the 70’s and 80’s software projects were managed like sales and manufacturing projects. Goals were set, plans were made and military like execution began – that failed miserably. It turned out that software development is CHAOTIC! So much so that the software industry ditched waterfall and embraced the chaos but rather than call the process CHAOS named it agile.

So what should we do?

  1. Replace Commitments with Visions or Epics: Do not pretend that you can set explicit commitments at the start of the year that will not change through the year. Work out your product vision, your scrum epics, whatever it is that you use to rally the troops, divvy up tasks and let the team go. Good responsible employees will do what they need to do to get the job done. Peer pressure and stand up meetings are really all that is needed to hold most reasonable people accountable. If you find people not meeting their commitments, pull them up, find out what is wrong and if necessary, have the hard manager-employee conversation. If they repeatedly do not meet commitments, let them go – they are not the right fit.
  2. Simplify Compensation:  Do away with bonuses! Compensate everybody fairly and according to market value. Save yourself as a manager the awkward conversations around why they got only an X% bonus. Stop lying to employees that they are solely responsible for exceeding expectations. I don’t think bonuses are effective motivators – the reality is that most people do not walk around everyday mapping every task they do to the bonus that will be credited to their account several months down the line. And no, this is not socialism! Socialist countries could not fire their citizens – a company can. Moreover, a combination of people genuinely enjoying their work, the peer pressure of not letting their peers and their boss down and ultimately, the fear of holding onto their jobs is enough motivation for most people.
  3. Performance Evaluations at the Right Time: When planning a project, also plan a post-mortem. During the post mortem do not just look at the overall project but also individual performance. There is huge value in taking stock and looking for trends in an individuals strengths and weaknesses. However the best time to do that is at the end of a project and not at the end of the year. This makes sense because that is when memories are fresh. Also right after that project is likely coming up another project – the perfect opportunity to act on feedback and grow.
Posted in People Management | Leave a comment

Smart Glasses

Last week we  looked into augmented reality or AR. In AR, a user could point their phone camera onto a scene and look at their screen and see not just what the camera saw, but also also other things which are not in the real world, but that the phone created and added in, creating a new enhanced, augmented world.

However experiencing this amazing technology took a lot of work from the user. The user had to take out a phone, start an application, point the phone at something, and then, finally see an augmented image. While people will do this once or twice to see something novel, it is unlikely they will do this on a regular basis. Hence to date, augmented reality has remained a fad!

All that is about to change – enter smartglasses. Smartglasses look like a bulky pair of glasses. However in reality, they are literally computers worn like a pair of glasses. These glasses have a really powerful computer, battery and sensors built right into the frame. More importantly, the glasses also have small transparent computer screens placed right in front of the wearers eyes, and a small camera. This is transformational as it makes augmented reality truly seamless. As you look around at the world through the transparent screen on the smartglass, it can overlay information on objects you are looking at.

The opportunities for this technology are limitless. You could sit in a room with no TV and have your smartglasses make a big widescreen TV appear right in front of you. As you walk towards the station, information about service disruptions could appear right in front of your eyes, hovering in space.

On a Car mechanics could have repair instructions appear overlaid on the engine including fully animated instructions on exactly what needs to be done to perform the repair.

A number of technology giants are working on this technology, including Microsoft with their Hololens and Google with Google glass and MagicLeap. However significant problems still need to be overcome before this technology gains widespread adoption as the glasses tend to be big and bulky and it is an open question whether people will wear these 24X7 as they do regular glasses. It is likely that the initial applications of the technology will be in the space of computer games or in industrial or professional settings. Either ways, we have an exciting future ahead of us!

Posted in Uncategorized | Tagged | Leave a comment

Interviewing

It is no secret that hiring good talent in general is hard, and good software engineers is especially hard. Here are some of my thoughts on the subject of interviewing?

Candidate Screening

The real challenge with candidate screening is that the quantity of candidates coming through is generally not that great This means that the team has to spend a lot of time interviewing candidates who do not meet the bar.

To solve this I leverage a combination of recruiters and a coding challenge. I use a great job description, the company website, and most importantly the recruiter to sell the company and the position. However before the candidate gets time with my team, we pose the candidate a coding challenge. We provide the candidate clear instructions and no more than 3 submissions in which they must get the answer correct. If they do, we get on the phone.

Areas I probe in the interview

What I do not like asking:

  • Hard Data Structures/Algorithms: One school of thought favors giving candidates algorithmic questions that involve data structures and algorithms. This approach does have its advantages – you get to see the candidates grasp of the fundamentals. Also, one gets to see how well the candidate can solve problems in code, and write intricate code. My gripe with this approach is that in most cases these problems have little bearing on the real work that we do on a day to day basis. Further this line of questions discriminates against older candidates who have lost touch with these topics.
  • Puzzles – I avoid these for the same reason as above. While it could indicate a candidates ability to think, I think that asking software design questions force candidates to do the same thing, and also draw on their professional experience, which a puzzle does not do.

What I do like asking:

  • Simple Programming Problems: It continues to blow my mind how so many people get stuck on simple programming problems. So I tend to ask some relatively simple questions.
  • Software Design Questions: The idea here is to provide the candidate with a real world software design question and ask them to work through that. I ask them to list out requirements, do the technical design, discuss trade offs etc. These I think are great indicators of a persons ability to do the job – first and foremost because this is the job! Further, you are able to assess how well you can have a discussion with the candidate – something critical to the job.
  • Behavioral questions/questions about past experience. My goal here is to understand how the person thinks, works and collaborates. It is also about seeing what makes this person tick and what they have accomplished. Questions on accomplishment also helps one determine what this person values.

Candidate Presentation

This is a system we use at the VW ERL. The start of the interview is an opportunity for a candidate to present themselves to the whole interview panel. This avoids each person from then asking the “tell me about yourself” question.

Posted in Uncategorized | Leave a comment

Augmented Reality

Notice anything weird about the image below? Normally when you point your cellphone camera on an object, the cellphone screen shows you exactly what is in front of it. However in the image below, rather than see just a black square on the phone screen, an elephant seems to have magically appeared on the square! Are you curious how this is achieved? Well, let me tell you about Augmented Reality – a technology which adds to the real world – i.e. augments reality.

There is no elephant in the real world – then how did it appear on the phone screen?

There are three pieces to making this magic happen – computer graphics, object recognition and your smartphone. Let us first tackle these one by one and then see how they are put together.

Computer graphics is the technology behind countless Disney movies like Toy Story. In the image below, computer graphics is used to generate the character Woody, who runs on a flat wooden floor. However Woody, created using computer graphics alone, lives only in your computer but not in the real world around you.

Computer graphics generated an image of Woody running on the floor.

Object Recognition is the technology which allows a smartphone that has a camera, to look at the real world and identify objects. For example look at the rather simple rectangular pattern in the image below. It is possible for the phone to recognize that pattern.

Untitled

A simple pattern for the phone to recognize

In fact, the image below shows an iPad looking at precisely the same pattern laid on a table. The ipad indicates that it recognized the pattern, by placing a bright green border around it.  Also, the green border seems to lie on the table, just over the pattern – i.e. our iPad has found a flat surface in the real world!

photo 3

The phone recognized the pattern and drew a green box around it.

So how does all this result in Augmented Reality? Well, let us look at the pieces we have right now. Graphics gives the phone the capability, to make virtual characters appear on virtual flat surfaces, in a virtual world, . Object recognition gives the phone the capability to recognize a real pattern on a real surface, in the real world. If you put those two technologies together, it should be possible to make a virtual character appear on a real surface, that the phone sees in the real world.

That is precisely what was happening in the first picture – the phone camera looked down and saw a flat black square pattern. It recognized the pattern and hence the flat surface. Before the phone showed that image on the screen, it created an elephant and placed it on the pattern. Viola – you now see an elephant where there is none! Not magic but some very clever engineering!

Posted in Uncategorized | Leave a comment

Why did Zeo fail?

The news is out – the sleep coach company Zeo is shutting its doors. There has been a lot of discussion about the possible causes – hopefully the founders will do a blog post with a postmortem so that the rest of us can learn.

The one opinion out there that I disagree with, is that Zeo did not address a real pain. There is a lot of evidence out there that people today really need help sleeping.

This is the way I look at it – what is the competition to Zeo today – really? Well, one could argue that it is a cheaper device like Lark, but if you pause to think one step deeper, you realize that the real competition, is sleep “medication”. Among sleep medication users – there are two kinds – the first are the ones who need it just once in a way – would a $400 Zeo compete with OTC options like Nyquil or a glass of wine – unlikely? People with serious sleep issues would go to a doctor to get stronger medication or real help. However, it does not appear that the Zeo was marketed to doctors – they did not get cleared by the FDA and do not have any published research on their website, that I could find. Going via these channels could also have helped them offset the $400 cost, by lobbying to get it paid for by insurance (long and painful likely).

The thing that I am curious about is how much of this had to do with a failure of the coaching aspect. This is a key question, as a lot of wellness applications and devices today consider this a key part of their product. I think it is an open question as to whether people find products like the Zeo, which attempt to be “non human” coaches, helpful. I personally find it hard to stick to exercise regimes and act on self help books, which is why human coaches are still around and still matter. Unlike these passive approaches, a good human coach actively leads you to your goals – they dont just make suggestions but they have conversations with you, coax you, cajole you, connect with you at a human level and provide you with moral support along the journey – all things that a sterile machine may not really be able to do – real and good coaching is hard

Zeo is an offshoot of the quantified self movement which is trying to cross the chasm from early adopters to the masses. There are going to be various people attempting to make the leap, each of whom makes different bets. So while it is sad to see such great entrepreneurs having to go home, it is neither surprising nor are they going to be the last ones.

While I have not used their product, I think they did some things which I think are really important to succeed here.

  • To succeed one has to go beyond just data collection, and address a concrete scenario. Collecting data to explore and geek out is not going to appeal to a mass market.
  • The scenario has to address a real searing pain head on. Issues like sleep and weight loss are good examples.
  • Devices should not just present data, but rather, render interpretations, though rendering compelling interpretations may be harder than we think. 
Posted in Health | Tagged , , | 1 Comment

R Tutorial

I have long been meaning to find an alternative to Matlab. I looked at Octave, but it failed on some pretty basic stuff like reading an image. R is something I have heard a ton about, and finally got down … Continue reading

More Galleries | Leave a comment

Hobby Servo Motors

Control

There are two sorts of motor control:

  • Position Control – In position control, one attempts to control the angular position of the motor shaft. I.e. if you command the motor to move to a position, it moves to that position and attempts to hold that position even if one attempts to move the motor shaft.
  • Speed Control – In speed control, one attempts to control the angular velocity of the motor shaft. Think of your table fan, where by turning the speed dial you control the fan speed.

The rest of this post talks about position control – speed control will be covered in a future post.

Hobby Servo Motor

In hobby robotics, position control is achieved using hobby servo motors and that will be subject of the rest of this post.

836

A hobby servo motor made by Hitec Servos.

Hobby Servo motor is a generic term used for a family of motors, made by a host of different manufacturers, where the motor case contains not just the motor, but also a gear train that increases the torque output and reduces the speed and also feedback control circuitry to provide easy position control.

File:Servo Stripped.jpg

Cross section of a hobby servo motor. Note the motor itself (blue box at the bottom left, the gear train and the circuitry. All this is inside the hobby servo case. The servo horn is actually outside.

Block Diagram for using a Hobby Servo Motor

There are typically 3 parts to any hobby servo motor control circuit – a computer, connected to a servo controller which is in turn connected to one or more hobby servo motors. The servo board is typically powered from an external battery or a wall charger.

  • Computer: This is the computer (or Arduino board) running your robots main control program. The computer determines what sort of movements the motors should make and commands the motors to do so via the servo controller.
  • Servo Controller: The servo controller is a circuit board (typically purchased off the shelf) which converts the command provided by the computer into the signal that the motor expects (i.e a PWM signal – more on this later). Arduinos likely have servo motor shields (I have not searched for them, but I would be surprised if they did not exist).
    • To make your life really simple, servo controllers typically accept very simple commands – typically just a simple text string like “M 4 23” which means move servo number 4 to position 23 (the specific syntax depends on the servo controller board manufacturer). The servo motor controller then converts that command to an appropriate train of PWM pulses to move the motor to that position. Sophisticated servo controllers can move multiple servo motors in a synchronized manner, where you can command motor 1 to move say through 30° and motor 2 to move through 120° and have both movements start at the same time and end exactly 2 seconds later. The command for this movement could be as simple as “M1 30 M2 120 T 2”, where the controller will take care of the rest. Sophisticated servo controllers can even generate the motor commands to move a whole hexapod robot.
    • The servo controller also provides the current to drive the servo motors (which does not come from the USB Port of the computer).
  • Hobby Servo Motor: Obviously! Hobby Servo motors plug into the servo controller.

All the pieces needed to control a hobby servo motor.

Pulse Width Modulation (PWM)

The servo controller commands the hobby servo motor to move to a position, by encoding that position in the form of a pulse width modulated signal. What does this mean?

How pulse width affects motor position. Note in the lower 3 figures, that despite the fact that the pulse width changed, the interval between the square pulses does not change – it is always 18 ms.

The servo controller sends the hobby servo motor a regular train of rectangular pulses.  I.e., like clockwork, every 18 ms, the servo controller sends the hobby servo motor a rectangular pulse.

The rectangular pulse itself, has a width – the time for which the pulse is “high”. Note that as the width of the pulse is specified in terms of how LONG, the pulse is high, the unit of measurement for pulse width is a unit of time i.e. milliseconds and not a unit of length (e.g. millimeters)

Position Control: In pulse width modulation, the width of the pulse is changed – for hobby servo motors, this width typically varies between 1-2 ms (could vary based on the motor). So, as the name pulse width modulation implies, the actual position you want the motor to move to, is encoded in the width of the pulse. As can be see in the figure above, for a motor which has a motion range of 180°, when the pulse is 1 ms, the motor moves to one extreme position (0°). At a pulse width of 2 ms, the motor moves to the other extreme position (180°). And if you feed it a pulse width between 1-2ms, the servo stops a corresponding position between the extreme positions.

Speed Control: It is clear now that the motor shaft position tracks the width of the pulse train. So if you change the pulse width of the train of pulses being fed into the motor in our example, from 1ms – 2 ms, in 5 seconds, the motor will move from its initial position to its final position, in 5 seconds. If you change the pulse width from 1-2ms in 1 second, the motor would make the movement from its initial position to its final position in 1 second (see the section on motor specs for more on the upper limits on this). I.e. the faster you change the pulse widths, the faster the motor will move – put another way, the rate at which you change the pulse width determines the speed at which the motor shaft moves.

How does a Hobby Servo Motor Work?

Parts of a hobby servo motor

Before we get started, to avoid confusion, note that everything described in this section is INSIDE the hobby servo motors case. Everything in the previous section is OUTSIDE the servo motor case.

With that out of the way, how does a hobby servo motor move to the position that you want it to move to? A motor on its own would not be able to do that – if you turn a motor on, it would just spin continuously without stopping.

To make the motor move to a particular position and stop, we need some way of figuring out where the motor shaft is. To do that, we the motor shaft is connected to a potentiometer so that as the motor shaft rotates, the potentiometer rotates. The potentiometer is the same thing that is used in the volume control of your stereo so just as your stereo knows the position of the shaft to change the volume of your music, using the potentiometer, it is possible to know where the motor shaft is.

The third piece in the puzzle is the control circuit. When you plug your hobby servo motor into the servo controller, the servo controller is actually plugging into the control circuit. So when the servo controller sends a PWM signal, that signal is actually going to the control circuit. The control circuit is in turn connected to the motor and the potentiometer. The servo controller uses the potentiometer to figure out where the motor shaft actually is. If the shaft is not where it should be, the controller sends the motor current which cause the motor shaft to rotate. As the shaft rotates, the potentiometer rotates along with it – this way, the control circuit always knows where the shaft is. As the shaft gets closer to the commanded position, the amount of current sent to the motor get less and less till when the motor is where it needs to be, no more current is sent to the motor so it does not move.

Once the motor shaft gets to where it needs to be, if you try to move the motor shaft, the control circuit will kick in and send current to the motor, to get it back to its commanded position. If you power up an actual hobby servo motor and try and do this, you will hear a buzzing sound, which is actually the sound of the motor making tiny movements to correct its position – dont let the buzzing noise worry you – that is quite normal.

The algorithm that the controller circuit uses to determine how much current the motor needs to get, depending on the how far the motor shaft is from where it needs to be, is called PID control. More about this in the section on motor specifications.

Selecting Hobby Servo Motors

This section discusses the various parameters one must consider while selecting a hobby servo motor for a position control application. While it may seem that at the end of this section you will be able to make very scientific choices regarding the hobby servo motor, to pick for your application, nothing could be further from the truth. At best the parameters are published for hobby servo motors are very coarse grained and will just allow you to get in the ball park of the motor you need. In reality, you will need to keep this ball park in mind and try and exceed it however much your budget will allow.

This is a good link to get a feel for the sort of parameters published for hobby servo motors. You should browse that page while reading the rest of this section.

Performance

  • Torque – This is a measure of the turning “force” of a hobby servo motor. The higher the torque, the more massive the object the motor can move. Torque is measured in kg-cm or oz-in. Intuitively, if a motor is rated at a 4 kg-cm torque, it means that if you attached a rod to the motor shaft and suspended a weight of 4kg, at a distance of 1 cm, the motor would not be able to move – i.e. the motor would be stalled. If you reduced the weight a tiny bit, the motor would rotate. If you increased the weight even by a tiny bit, the motor would no longer be able to fight it and hold its position. In other words,  the torque rating, could also be called the “stall torque” of the motor.
  • Speed – this is a measure of the maximum angular velocity the motor shaft can achieve – of how fast the motor shaft can rotate. While conventionally angular velocity would be measured in degrees per second (the number of degrees the motor shaft would rotate in one second), hobby servo motors are usually rated in units like 0.06 sec/60°. I guess the goal of the servo manufacturer is to give the reader a more intuitive feel for how far the motor moves. One can quickly appreciate that a motor that takes just 0.06 seconds to move 60°, must be really fast. The other thing to note about this rating, is that this is the no-load speed of the motor. I.e. if you actually use the motor to move something, the speed is going to be lower. Also, unfortunately, I have never seen a hobby servo motor manufacturer publish a load-velocity curve.
  • Rotation Range – All the motors/engines that one typically encounters, can rotate round and round continuously. Hobby Servo Motors however, typically have a limited range of motion beyond which they will not move (e.g. a motor may only be able to move through a 180° range, no more!) so always check this before purchasing a motor. There are continuous rotation servo motors out there – people also modify servos with limited range of motion to have a full range of motion (which ofcourse invalidates the warranty on the motor)
  • Resolution – this is a measure of the smallest angular movement that the motor can be commanded to make. This is pretty crucial because this determines how finely you can control the position of the thing you want to move using the motor (e.g. imagine if you were building a robot arm). However, things get quite tricky here, because most hobbys servo motors do not provide their angular resolution ratings – this can be quite infuriating, as servos will be rated as “super accurate”, but nothing more. Resolution is also confusing because in reality there are two resolutions at play here – the Servo Controller Resolution and the Servo Motor Resolution. The Servo Controller Resolution is the smallest change to pulse width that the servo controller can make. If the exact pulse width is specified to your servo controller, by a 16 bit number, you should be able to specify 216 distinct pulse widths. If the servo motor that you have, has a rotation range of 180° the controller should be able to command it to move to one of 216 positions, giving you an angular resolution of 0.003°. However in reality, because of the physical design of hobby servos, the servo motor resolution is much coarser than that. Depending on the motor, you should be able to get between 0.5° to 0.3° (an exception is the MX-28 which has a resolution of 0.088°). I.e. it would take a few step changes in the pulse width, before the change in pulse width got large enough for the hobby servo motor to actually detect it and move. Like a bunch of other properties, it turns out that resolution depends on the load that you are trying to move – at larger loads, the resolution of the motor could drop off (though you may be able to counter this by operating the motor at higher voltages – provided you stay within the rated motor voltages).

Electrical Properties

There are two categories of electrical properties – voltage and current properties.

Voltage: Hobby Servo motors can operate over a range of voltages ranging from ~4.8V to ~6V. Note that the servo torque and speed are rated at a particular voltage and that servo torque and speed are directly proportional to voltage and speed. So if you have a servo that is rated as providing 3 kg-cm at 6V, if you apply 4.8 V, you should expect to see less torque. The same is true of speed.

Current: Servo motors “draw” current from the servo controller. The amount of current that the servo motor pulls depends upon the load on the servo motor – the greater is the load, the greater is the current draw.

Current draw against load – note the large variation in the motors current draw

One needs to ensure that the servo controller that one will use for ones project, can satisfy the current needs of all your servo motors at the same time. So if you are going to use 3 servo motors in your project and you know that each servo motor will draw a peak current of 1A, then your servo board must be able to source well over 3A of current. If your servo board was not designed to source this much of current, the results could vary between the servo board getting burned out to the servo board rebooting – the latter will cause very random behavior where suddenly for seemingly no reason, your robot arm (assuming you are building one) would just flop.

Unfortunately, like many things hobby servo, you will not find the current draw on the typical hobby servo spec sheet! To figure out the current needs of your motor under load, you need to measure it – see this for more information. Some hobby servo motors provide power output ratings. Assuming that these ratings are for peak power output, one could compute the peak current requirements, at a particular voltage using the formula:

Physical Construction

You should take into consideration the following physical properties of the hobby servo motor, prior to purchasing it:

Dimensions: Hobby Servo Motors come in a range of dimensions and you need to ensure that the motor you pick is the right size.

Hobby motors come in a range of sizes. Smaller motors weigh less.

Brackets and mounts: Given that hobby servo motors come in standard sizes, one can also find pre-fabricated metallic brackets that can be used to mount the motor and transfer motion. An example is the servo erector set where the folks at Lynxmotion have thrown together a bunch of pre-cut aluminium parts from which a variety of robots can be built. Browse their website to expand your mind on what can be done with done with standard brackets.

The thing to be careful about is to make sure that the motors and mounts you buy match each other. For example the mounts that Dynamixel sells for their motors are not compatible with regular hobby servo motors. Also brackets and mounts for smaller hobby servo motors will not work with larger hobby servos.

Servo Horns: Servo horns are attachments to hobby servo motor shafts. Typically servo motors ship with a few different horns in the box. Horns can be used to transfer motion from the hobby servo to other mechanisms or as attachments for other parts.

Servo Horns come in a variety of sizes and shapes.

The images below show some examples of horn usage, some from the robotics world and some others from the radio control world.

Attaching servos to the servo bracket using screws. The servo horns do not have screw threads – you just turn a screw in and the screw will tap its own threads.

Use of a push rod in an RC aircraft to move the control flaps. The push rod connects to the hobby servo motor as shown in the picture, via a hole on the horn. A clevis could have been used for this purpose as well. The rod and the part on the other end can be purchased at an RC hobby store.

Gearing/Servo Life: As gears turn the gear teeth constantly grind against each other and over time, wear off. Some applications like a biped robot, where the motors in the leg take a lot of load and impact as the robot walks, may wear out much gears faster compared to motors say in the elbow of the same robot, where the motors take less load and impact. As gears wear out, slop is introduced in the gear train which means that it will be possible for one gear to move a small amount, without the next gear in the train moving. This will obviously make the motor less precise.

It is possible to mitigate this problem, by shelling out for motors with more robust geat trains. As can be seen in the image below, there are a variety of materials that are used for the gear train inside the servo motor. The material determines the strength and the life of the gears. The trade off here is between strength and life, vs cost – equivalent motors with stronger and longer lasting gears, cost more.

Gear train materials and their impact on life and strength

One question you may have looking at the table above is what it means to have a gear that lasts “years”. Admittedly that is a vague statement – the thing to keep in mind is that these motors are built for hobby applications like radio control toys where people are expected to use these toys for at the most a few hours every week. So most likely when they say a life of a few years they mean a life of a few years under RC usage conditions. The only manufacturer that I have seen that actually specifies life in concrete terms is Firgelli (who BTW are the only manufacturers I know of who make linear servo motors) who rate their motor life time as 20,000 strokes. So that should give you another indication of the life of these motors.

Analog vs Digital Servos

Analog Servo and Digital Servo are confusing terms that you see on websites selling servo motors. All you need to know really are that digital servo are better than equivalent analog servos. The only con of digital servos are that they consume more power – this should be a concern if you are building something battery powered.

If you want to know more, a great explanation of the differences between analog and digital servos may be found here.

Another advantage of digitial servo motors is that SOME of them (note that most aren’t) are actually programmable. If you recall earlier we mentioned that the control algorithm in the hobby servo motors is PID control. PID control is a complex topic, worth its own separate post. However, for the purpose of this post, the PID control algorithm takes 3 numbers as parameters – the proportional gain, the integral gain and the derivative gain. Most hobby servo motors, come from the factory with these numbers hard coded in. Programmable servo motors allow you to change the numbers allowing you to change the behavior of the servo motor as it moves to its commanded position. So if you see issues like the motor in some positions moves exactly the position you commanded it to move to and not in other positions, or if you see the motor swing around the position you commanded it to move to, you may want to look at programmable motors.

Conclusion

Hopefully you found this tutorial helpful in getting your head into the hobby servo motor space. At the end of the day, there is no substitute to actually buying some motors and playing with them – I would urge you to do that – happy motoring 🙂

Posted in Robotics | 4 Comments