So you want to build a robot, that’s awesome!!!
If you have never built a robot before, you might want to consider a robot kit with detailed build instructions such as our DiddyBorg v2 for your first build. Step by step robot build instructions are available. This isn't absolutely necessary, but it can make the task a lot simpler. Even if you are considering building yourself, the instructions can help you get some ideas on what you could do and how best to do it.
This guide will take you through some important steps such as determining what motors, controller(s) and batteries to use.
When building a robot, it is important to design how everything works together before buying parts that do not operate together. We have written a useful guide on how to build your own robot so that you don’t end up with mismatched parts and so that your robot building experience is a pleasant one :) The following isn’t a detailed engineering list of how to build a robot, but is rather intended for beginners to gain a little understanding about how to get started.
It’s very likely that you will gain a lot of skills and understanding from building your own robot. There’s no substitute for experience, but I think there’s no wrong way to gain that experience. Getting your hands dirty, making mistakes and little improvements is a time tested method. We are always here to help via the PiBorg forum if you get stuck :)
Determine approximate size, wheels, tracks etc.Most people will have in mind an idea of the size and capability of the robot they want to build. It is important to keep things realistic. To try to build the worlds fastest robot as your first project is a near impossible task! Start small and make gradual improvements in design. You might find that after you build your first robot, you have a new set of ideas to build a second one with different capabilities. Still, you should let your imagination wander a little and come up with an idea of the approximate size, how long, wide, heavy, how big the wheels are, how fast it should run.
Important considerations are the diameter of the wheels, which determine the speed and torque your robot has. Larger diameter equals more speed but at a lower torque. With lower diameter wheels the robot is slower, but it has more torque given to the road surface given the same motor, and can more easily turn on the spot.
Once you have this idea, you can start to piece together what is needed to make it work.
For example, let’s say we wanted to build a robot that can support a laptop on it. The size needs to be a little bigger than the laptop, say 40cm long, and 30cm length. If the laptop weighs about 1kg, the motors and frame would normally be bigger and heavier to support that weight, so let’s say about 3Kg for the chassis, motors and batteries. Keep in mind we aren’t certain at this stage, we are just making estimates.
How many wheels/tracks will the robot have? Will it have active steering like a car, or a caster wheel or tank steering? What materials will it be made out of? These are all questions that can help you in the design process. For example, if you have access to a laser cutter and a cad system, you might want to design differently than if you have cardboard, a hand drill and some glue! If you do want to draw up the robot in CAD software, some freely available packages such as KiCAD are useful tools to help you.
Determine motor requirementsSay we want our robot to travel to a neighbors house 500m away, and it should get there in about 10 minutes. Then we know the speed should be 3km/h. In determining the wheel size, we guess that a smaller wheel such as the PiBorg wheel pair in white should be sufficient.
In order for our robot to do 3km per hour, we can first figure out the rpm the wheels need to spin at:
Diameter = 65mm, so circumference = Pi x Diameter
3.141 x 65 = 204mm.
To travel our 500m distance would be approx. 2451 revolutions of the wheel:
500,000mm / 204mm = 2451 revolutions
So the motor needs to rotate at a speed of 2451 revolutions in 10 minutes, or 245 rpm
The PIBorg P25UK12 12v 100rpm motor won’t be enough speed, but keep in mind that the lower the speed, the higher the torque for the same motor size. This is particularly important for being able to turn on it’s axis and is extremely important if you have tank tracks or a particularly long bodied robot. This could be a good solution if we are happy with the lower speed and better turning abilities. The 100 rpm motor would move at:
100x204mm = 2040mm/min or 20.4 meters per minute.
In one hour, that’s 60x20.4 = 1.22Km/h We could try and figure out if this is sufficient for our robot, but let’s assume it isn’t and we need a faster motor.
The PiBorg P28UK12 12v 590 rpm motor is perhaps a good contender, and we can see that the robot would travel at approx.
590x204x60 = 7.2Km/h
which is well above what we need. The torque would be lower with this faster geared motor, so let’s look at another.
The P37UK12 300rpm 37mm MonsterBorg motor would travel at approx.
300x204x60 = 3.6Km/h
Actually, the speed that the motor runs at will depend on the load that is on the robot. When the motor is running in free air, it will spin at near 300rpm. When it is on a very light robot, the speed may decrease to say 250rpm. And when it is loaded with our laptop, it might turn at more like 60%-70% of the speed, approx. 200rpm.
Under load, which is fairly close to what we wanted. We could increase the wheel size, but that would decrease the torque and with a laptop on top, the body needs to be long enough to house the laptop, so let’s keep the smaller wheels for now. With that assumption that 2.4Km/h is sufficient for our robot, we select the 37mm motor and we can decide on what controller we need.
Determine battery requirementsWe now know that the motors we are going to use are the 12V 300 rpm motor version, so we can look at some of the specs to determine what we need from the power supply. The motors run at 12V, so we should pick a battery 12v or close to (preferably a little above). If we were to look at battery cells they are nominally 1.2V per cell in rechargeable format so we would need a 10xAA battery pack. If we are considering LiPo batteries, they normally come in multiples of 3.7V, so a battery with 3 cells (12.6V) or 4 cells (16.8V) could work well here. The battery voltage should be close to the voltage that the motors are rated at.
The voltage should never exceed the motor controller maximum voltage, and because of factors such as back EMF, which is a voltage caused by the motor inertia generating power when we are decelerating. Because of this, there should be some overhead between the battery selected and the maximum voltage the motor controller can deal with. The pack needs to be capable of producing the stall current of 2.7A. (listed in the motor specs) But wait, that’s just for one motor! Let’s assume we are using 4 motors on our robot. We need at least a 2.7x4 = 10.8A power supply.
We also might need to power the Raspberry Pi from the batteries (by using an inbuilt DCDC on the motor controller, or by something like the BattBorg Pi power supply. If you are adding peripherals, or LED’s etc, that wants to be added here. This can all add a few more Amps to the power supply, so in this case we would be looking for something capable of 13A or more, giving ourselves an overhead, best to look for 15A or more.
Now that we know what battery we have and the current requirements, we should add a fuse for safety. That fuse is normally specified at the max current we expect to use (so a 15A fuse should work well). Fast blow fuses will blow quickly if you exceed the current rating for example accidentally short circuiting the battery. This gives the hardware the best chance of surviving such a mistake. Slow blow fuses take a little longer so are unlikely to blow with a momentary high current draw, but in a mistake situation such as the short circuiting, they don’t offer as much protection to the hardware. Resettable fuses such as a multifuse do add resistance to the circuit, and can be unpredictable at times as the resistance (and hence the voltage supplied to the motor controller) changes with how much current has passed through the fuse in operation i.e. how hot the fuse has gotten. Multifuses are more like slow blow fuses in that the hardware isn’t as well protected.
Determine controller requirements
Now that you know what voltage and current requirements you need for a motor controller, it’s time to find out what you will control it with. Will the motors only drive in one direction? Will they need to drive in reverse as well? Will you need to control the speed that the robot drives at? Will the motor controller need to have a DCDC to power the Raspberry Pi?
Motor controllers such as the ThunderBorg include a DCDC to power the Raspberry Pi, and are capable of a 5A power output with protection against drawing too much current. This makes them ideal for driving 2 motors and more than capable of running 4 motors in a 2x 2 parallel motor configuration for applications such as tank steerable robots. You will need one output per motor, so if you have 2 motors, you will need a controller with 2 channels (2 outputs) such as the ThunderBorg. To control 4 motors individually, you will need two ThunderBorgs. If you connect 2 motors in parallel to one of the outputs, both motors will spin at the same speed and direction together. You can add as many motors as you like in parallel, provided you don’t exceed the max current specification, but the motors will all spin at the same speed and direction together.