The story of the creation of another robot. Part One, Design

In this series of publications, I want to share with you the story of creating my first robot under the control of a microcontroller, as well as the mistakes and omissions that I made during the whole process. I will say right away that the software part of the robot has not yet been completed and only part of the functions has been implemented, but I continue to struggle with bugs and laziness and in the future I will definitely complete everything that I have in mind, please do not judge strictly. If I am of interest to you, please. Part one, design .

Perhaps it all started with the fact that I wanted to spend my free time more productively. The decision to build a robot was lightning fast and unshakable - I always liked articles on the topic of robotics and various DIY, and I also held a soldering iron in my hands and heard about microcontrollers.

The first thing I decided to makesmall technical project of the future creation.
After several hours of thought, an approximate dimensional drawing of the robot was drawn up and the main design requirements were determined:

1) I decided to make the robot with two drive wheels and one swivel;
2) In terms of size, he wanted to keep within a maximum of 200x200 mm, since he always liked small and even miniature robots;
2) To use a printed circuit board as a chassis to reduce the dimensions seemed a good idea;
3) All this should be powered by a regular Li-Po battery (a broken helicopter was lying in the closet and I already had the battery along with charging).

Then the turn came to determine the functions that the robot must perform :
- Follow the line;
- Interface for wireless data exchange and control from a computer ;
- The ability to automatically identify and go around obstacles in the way .

Now one could think about developing a schematic diagram of our future scarf-chassis. I decided to make the circuit in Altium Designer (since P-CAD and Eagle already knew a little and wanted to try a new package).

For the first week, I decided on the components and entered them into the Altiuma library, I didn’t strain much with 3D models and made them in a hurry, for the sake of assessing the overall dimensions, and not to please the aesthetic feelings. Due to the fact that I watched a lot of articles and videos about robots, I had almost no questions about the element base, which would carry out all of the above functions.

- I chose motors powered by 3-9V, Chinese brands N20 miniature + wheels came complete with motors.
- Engine management on a typical L293D (may not be the best choice, but it was easy to purchase).
- For the line sensors , the cheap TCRT5000 were selected .
- The well-known Bluetooth module HC-05 is responsible for exchanging data with a computer . - I wanted to implement an obstacle detection system on an ultrasonic rangefinder HC-SR04, which was planned to be mounted on a standard 9g. server . -

The brain for the device was also selected from among the most popular, it became ATmega16A , it fully met the requirements and even with a surplus.
- Looking ahead a little, I’ll say that even at the stage of designing the circuit, I decided to hammer the free pins of the controller by adding a Nokia 5110 LCD monitor connector to the circuit .

By the way, looking at the wheels, you can see cutouts on them, which were clearly made specially.

image

Sparkfun has confirmed my thoughts with its selection of the same wheels with optical encoders. Then I got the idea to read the number of wheel revolutions (at least approximate).

image

But do not buy another set of wheels, this is not ours! I decided to make my own version of the encoder. Puffing around the wheels and motors with a caliper, I realized that I could not repeat the Sparkfan scarf. But what comes to mind if it is inconvenient to use optical encoders in development - correctly, magnets and Hall sensors! On ebay were found almost perfect in form rare earth magnets, there were ordered Hall sensors brand US1881 .

There are many articles on connecting and working with all electronic peripherals. Questions arose in the design of the supply part of the circuit. The battery I had was a Li-po 2S1P with a voltage of 7.4V and a capacity of 800 mA / h. The controller, servo, bluetooth module and ultrasonic sensor needed to be powered from 5V, and the LCD monitor was generally gentle and expected 3.3V from us, but it was logical to power the motor directly from the battery.

And here I made the first flaw for which circuitry and engineers can beat me. Choosing a 5V power supply regulator did not calculate in detail the consumption of all the elements and figured it out around 300mA, and the existing LT1763 5V microcircuit was already dusting in my pantry for a long time and was eager to be soldered into a robot. This LT1763 is a small linear regulator at 500mA with a low voltage drop and with an input voltage of 1.8V to 20V.

Well, let's estimate how much the whole circuit powered by 5V can consume. Take the maximum numbers:

- The MK core on the datasheet should consume 15 mA when clocked from 16 MHz, we will use 12 MHz, but we will focus on the fact that the MK will consume an average of 30 mA;
- Serva we will have almost no load and ideally consume 150-200mA;
- Logic L293D will take a maximum of 60mA;
- The bluetooth module in the transmit state consumes no more than 10mA;
- The line sensors in total should consume 15-20mA;
- Ultrasonic sensor in measuring state 15mA;
- The display, even with backlight, should not eat more than 40mA;
- Hall sensors will take on 10mA;
- Well, let's put 10mA on top of the buffers and suspenders.

As a result, we get ~ 400mA, but when you turn on all the equipment and the maximum consumption, which is extremely unlikely. I would say that on a 5V power supply in reality there should not be more than 300mA. So the choice of LT1763 cannot be called a mistake, but in any case, in the next version of the robot, I’d better put LT1963 or some kind of DC-DC.

So, it took me a few more days to design our small circuit.

image

As you can see, I decided to use 8 line sensors and accordingly use all 8 channels of the ADC of our MK, thanks to the 74HC4051D I reduced the number of pins needed to light the sensor LEDs. To work with the monitor, the SN74LVC245ADW buffer was takenwhich should solve the issue with stress levels. It is powered by a small 150mA linear stabilizer chip with an extremely low voltage drop LTC1844 . He also added discharge sensors for Li-Po batteries, just for every fireman.

Next I was waiting for the most “laborious” stage in the manufacture of any electronic device - the creation of a printed circuit board.
After several evenings of scattering elements on the printed circuit board, something was born:

image
image
image
image

It took about 2 weeks to complete the wiring and dopilka of the board. As a result, a full-fledged pcb looked acceptable:

image

On this I will finish the first part of my story. I hope you were interested.

I hope for your constructive criticism on the design and presentation of my habropost. In any case, I’ll do one or two parts that will describe the process of creating the printed circuit board itself, tell a little about how the whole robot was assembled, show a photo of the finished device, talk about a program for the computer, and put a short video of the robot working.

Also popular now: