Thursday, January 28, 2021

Electrical components of the robot.


The goal of this exercise is to create an autonomous mobile robot that can drive around my house and maybe even perform a task such as pushing balls. In order to do the advanced computation required I'm going to use a Raspberry Pi 3 A. This little computer should be enough to take in data from the sensors (camera, ultrasound) and output the signals to drive the motors. 

The raspberry pi runs on 5 volts, but the motors require 12V. Furthermore the pi can not supply enough current. To solve this issue I am going to use the L298N motor controllers. These are fairly popular in the hobbyist community and can handle my voltage. They are also capable of PWM (Pulse width modulation), which is used to control speed of the motors.

In order to drive 4 motors I am going to use 2 of these controllers since each of them has 2 outputs. And to power the motors, I am going to use a simple battery holder that can house 8 AA batteries. When using non-rechargable batteries of 1.5V each I will be able to get 8*1.5=12V that I require. This is purely because I am being cheap and do not want to shell out for a bulky LiPo battery that is used to power drones, and RC cars. Eventually I can switch to rechargeable batteries. Those have the voltage of 1.2 volts, which will get me about 9.6V, this the robot is just used to drive around my house this will be fine as I don't need it to go as fast as it can.

The raspberry pi is powered by it's own stand alone battery, which is essentially a phone charger. But Peter, why can't you just use the main battery pack to power the pi??? I'm glad you asked. The reason for that is that the pi needs a specific voltage and current, which I can not accurately produce with the main battery. I have tried using a populu voltage regulator to step down the battery voltage to 5V, but it wasn't consistent enough power the pi.

I was really excited to get started with this project, so as soon as I put the chassis together with screws I slapped on all the electronics with tape and tested it.

 

 As you can see this is a huge mess. One of my favorite robot philosophies is BEAM. Which stands for Biology, electronics, aesthetics, mechanics. The idea behind BEAM is to build simple robots based on simple organisms such as instincts. As such just like insects these robots do not have a brain. Meaning the don't use micro-controllers, but instead use analog circuits to control the robots. This is very different from what I am doing, but the philosophy of aesthetics applies all the same. Aesthetics are important, because often times they are directly related to safety and overall sense of the concept. If a gazelle had its guts hanging out it would be pretty ugly right? Yeah! It's the same with the robots. Having a bunch of wires everywhere looks pretty gross and is not very safe.In the future I will install the board with screws onto the board. I also need to figure out how to mount the camera and the ultra sound sensor that will be used to measure distance.

But for the time being I can test this thing. Using a simple python script and the Rp.GPIO library I was able to test the motors. And the results were not great. Each motor spins backwards and forwards, but when I try to spin them together, they aren't synced up. Sometimes some of them don't turn on. I'm happy that all of them spin, but I need to work on making them more consistent.

No comments:

Post a Comment

NEW Project Autonomous underwater vehicle!

  I have been more and more interested in Autonomous Underwater Vehicles and ocean exploration. I live on the coast with direct access to th...