Getting Started with Servo Motors and the Micromelon Rover

Servo motors are a type of direct current (DC) motor which is a very common type of motor you can find in lots of electronics around your home. Servo motors are very good at making precise movements since they contain a built in controller which ensures the output speed is more reliable. The driving motors on the sides of the rover are freely spinning DC motors. This post will be a brief introduction to how servo motors work, what are the most common servo motors, where to buy them, and how to use them with the Micromelon Rover.

 

What is a servo motor?

A servo motor works by using a controller to set the exact position or speed it needs to stay at. There is a small device (the control circuit) that takes an analog input and determines the motor’s position. These motors are more focused on giving you precision over speed/power, and are generally quite weak in terms of torque.

Servo motors are useful for robotic arms, DVD player trays, cameras, as well as many other devices that need an accurate and/or gentle motor movement.
This kind of servo is called a positional rotation servo motor, and is by far the most common type of servo motor. You can set the exact amount of rotation for the motor in terms of degrees from -90 to 90, giving you 180 degrees of rotation.

The other type of servo motor is called a Continuous Rotation Servo motor which can spin freely much like a regular DC motor. 

Setting the speed of a regular DC motor is fairly challenging because you need extra components and circuits to do so. You can read more about these circuits called H-Bridges. A continuous rotation servo motor has all of this functionality built into it already, which is why it is used over a DC motor as it makes it significantly easier to use.

 

Buying servo motors

There are many different stores to buy servo motors from. With electronic components it is always highly recommended to look into the supplier you are buying from to make sure you do not buy something of bad quality. We at Micromelon recommend you do your own research into reputable suppliers before purchasing equipment as prices and quality can vary significantly. Some examples of where these parts can be found are Core Electronics, Jaycar, RobotGear, Sparkfun, etc. Some servo motors are stronger than others so it's a good idea to get metal geared ones where you need a stronger, longer life motor and to prevent wasted components.

You also have to be careful that the motor you are buying meets the electrical specifications of the rover. The rover servo connectors are 5V which fits within the specifications for most hobby servo motors, and can provide around 1A of current per motor. The most common hobby servo we recommend is the MG90S 9g servo motor with 180 degrees of rotation and the larger MC996R 55g servo motor with 120 degrees of rotation for when more torque is required.

We’ve provided some product links below of motors we have tested and used with our Rovers. 

https://www.jaycar.com.au/arduino-compatible-9g-micro-servo-motor/p/YM2758?pos=3&queryId=c2ebbc26559d7559d5f5e7caf8f29784&sort=relevance

https://core-electronics.com.au/9g-micro-servo-1-6kg.html

 

A note about servo ratings

The servos that we have suggested for light duty applications are called 9g servos. A 9g servo simply means that the motor itself weighs 9 grams. These motors typically give you something around 1.6kg*cm of torque. Which is to say they can lift a 1.6kg weight, at a distance of 1cm. The longer this distance, the weaker the output force will become. This relationship is inversely proportional, so as the distance from the motor doubles, the output force is halved. (E.g. at 2cm this motor will only lift up to 0.8kg of weight) This is usually the most important specification to consider when shopping for a motor as you want it to be able to comfortably supply enough force for your application. 

This specification is usually denoted as “stall torque” which means that the motor cannot physically lift or move anymore when that weight is on it. Exceeding the rated torque is never a good idea and can drastically reduce the lifespan of your motors.

 

Connecting Servo Motors to the Rover

On the back of the Micromelon rovers there are two servo ports that you can servo plug motors into. Note that servo motors need to be plugged in the correct way around. The back of the rover has an icon that shows which way they should plug in. On most motors the red wire means power or +, the brown wire means ground or - and the yellow wire means signal or S. On the right is an example of something we’ve made with servo motors!

 

Using Servo Motors in the Micromelon IDE

To use a servo motor with the Micromelon IDE, you have to access the “Extension” section on the left of the user interface. (UI)It is here you can find all of the useful blocks that will interact with servo motors.

These blocks allow you to set the position of servo motors in terms of degrees. The position you see when you enter a certain value for degrees will depend on the servo motor you are using.

For using Python the relevant functions can all be found in the functions library for Servos. These all work the same way the blocks do outlined in the more detailed description below.



 

Blocks

Python

Servos.setBoth(45, 30)

Description

This block allows us to set the exact position or speed of both the servos at the same time. Usually this is measured from the right horizontal test this out for your specific servo motor!. This block will only take inputs from -90 to 90, representing a range of servo motors with 180 degrees of freedom. It can go slightly higher than that from my testing, where -80 was closer to -90 in my experience, but generally it works out.

You can use the exact same block for Continuous Rotation Servos, but they scale up in speed with the same input. This means 90 is maximum speed one way, and -90 is maximum speed the other way. The real speed produced depends on your specific servo motor.


Servos.left(30)

This servo motor block works functionally the exact same as the block above it. It allows you to move only one servo motor in the scenario where two are plugged. You can use the drop down menu by clicking on it. You can input a number, or one of the data blocks.


Servos.read()

This block allows us to utilize what it knows about the servos position. This block gives the value of the servo positions in degrees, and allows you to substitute that value into other blocks.

 

Wrapping Up

Now that we’re familiar with some of the key concepts behind servo motors, the blocks, and the code to use them. We’ve got a bunch of activities you can try and extend with servo motors now that you know how to use them!

Related Posts

Previous
Previous

Balloon Battle Bots at Trinity College Beenleigh

Next
Next

A Crash Course on 3D Printing in the Classroom