Let's Make Robots!


komplet2.JPG242.73 KB
ultrazvuk-servo-uprava2.bas4.48 KB
bridge05.pdf226.18 KB
AXEboard-28.pdf1.12 MB
PICAXE_basic_man_cz.pdf345.36 KB

One day when I accidentally browsed NET settlement, I came across a video in which found a robot with tank chassis, which used to measure the distance ultrasonic sensor and marched to the countryside in a separate room. Due to the fact that in government it is akoráte to the bottom, I decided that instead of solving unnecessary administrative work assigned directly to the workplace will give the construction of this ”robot tank “..... so I started looking for tutorials, schematics and buy some parts.

Necessary components

1) VS-2 - Standard Servo 4.8-6V Power Control pulse width of 1-2ms, repetition interval of 20ms .. Price 196,-CZK

2) TANK-02 - caterpillar chassis, four-speed gearbox TM70168 .. Price 960,-CZK

3) SRF05 - Ultrasonic range finder .. Price 616,-CZK

4) PICAXE 28X1 - the brain of the whole project .. price 340,-CZK

5) AxeBoard28 - the board .. Price 420,-CZK

6) CABAXE025 - cable for programming the board .. price 65,-CZK

7) BRIDGE20 - dual H-bridge control AC motors .. Self price about 350 CZK

8) good luck, nerves and a few unnecessary parts, you can use in the project.


So as you can see it's completely free, so you need to decide whether to go ahead or not. Order bulk items can be http://shop.snailinstruments.com. All of this can be expensive even during experiments. Just as I sometimes choose the method of trial / error and a launch by the ”procák“ from the board. Given that I have never been anything like nestavil and acquisition costs have exceeded a certain threshold, when I could just throw all the trash, I decided on technical advice on this forum ... so once again thanks to Milan (administrator ). Well, because I'm stingy and want to avoid any potential failure, I decided that the instructions to complete the construction will place here with all their details. So if you have purchased or are part of the gain in another way. We start with BRIDGE20 - a double H-bridge for DC motor control with maximum current of 2A for each one that controls direction and speed, with power IC L298D. This you have to make yourself according to this link http://www.rotta.cz/PDF/bridge20.pdf. Power project is a separate battery 6xAA (logic), 1x9V (engines). As the superstructure to the chassis I used the inside of the old CD-ROM drive, which I propped plastic parts of the handles water levels. Free space in the superstructure, I overruled the part of the FDD drive. Development board is placed on a modified plastic canopy shaft case. I got the wiring from nearby scrapyards where I needed dismantled. Since I got my colleagues 'case' on 6AA AAA batteries and I also added some old PC parts to be in the future will use in the construction of other projects. The bridge is trabi dual voltage, one of which must be stabilized +5 V in size, so I created a terminal, where I assemble the stabilizer of this tension and brought a second source I used a 9V battery. Created from the collected terminal voltage of an ultrasonic sensor and servo. The engines must use a stronger lead-in wires (larger current draw) and mainly used suppression capacitors soldered directly to the contacts and the motor frame (see the figure used by the involvement of ceramic capacitors and 4x47n 2x100n). Noise can have a negative impact on the entire facility. The involvement of the whole picture, themes and questions if you write to my e-mail: GoosB@seznam.cz. But we prefer to communicate here on the forum and we will not leave anything for himself. Still, I plan a body, something like a mechanical arm or blade ... we will see in the future. This is a program that controls, not its author, but it works well http://goosb.wz.cz/PICAXE/ultrazvuk-servo-uprava.bas. The program is still regulated, so if I'm going to seem that it is most at our customized design, thus releasing it here.


BRIDGE 05                                                                        AXEboard-28













Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I am not the author of the code, but the point is that the SRF05 measures the distance of objects ahead and determine the direction of rotation. When the subject turns to the right of a tank left according to the size of the object sensor. here is the code that determines the decision where to turn tank. I'm in your code will work, I had to explain to a foreign code.


symbol dangerlevel = 15 ' how far away in cm should something be, before we react?
symbol turn = 750 ' how much time to allow for robot to turn in milliseconds
symbol servo_turn = 700 ' how much time to allow for servo rotation in milliseconds
symbol trigger = 3 ' trigger (pulse out) pin for SRF05
symbol echo = 6 ' echo receive (pulse in) pin for SRF05
symbol range = w0 ' 16 bit length variable for the range returned by SRF05
symbol distance = w1 ' 16 bit length variable for the calculated distance in cm to object in front
symbol front_left = w2 ' 16 bit length variable for the calculated distance in cm to object to the front-left
symbol front_right = w3 ' 16 bit length variable for the calculated distance in cm to object to the fron-right
symbol objwidth = b26 ' 8 bit length variable for the width of a detected object
symbol oldrange = w4 ' 16bit length variable for previous range
symbol rangeoffset = w5 ' 16 bit length variable for the difference between current and previous range
symbol tolerance = 15 ' how much difference can be tolerated to be part of the same object
symbol detectionflag = b25 ' flag that reflects if an object may have been detected
symbol forwardrange = w6 ' range to object directly ahead

main: ' the main loop
gosub one_ping_only ' for range
if distance => dangerlevel then ' if nothing ahead within reaction distance,
gosub nodanger ' drive forward
else '        otherwise
gosub somethingthere ' check to see if this is a valid target
end if
goto main ' this ends the loop, the rest are only sub-routines



gosub one_ping_only ' sometimes Djeff stops when there are no obstacles (ghost returns to sensor)
if distance > dangerlevel then return ' this is a range re-check to prevent this
gosub allstop ' first stop!
gosub look_left ' look left
pause servo_turn ' wait for the servo to be finished turning
gosub one_ping_only
let front_left = distance
' gosub allstop
gosub look_right ' look right
pause servo_turn ' wait for the servo to be finished turning
gosub one_ping_only
let front_right = distance
' gosub allstop
gosub targetcheck
gosub whichway



whichway: ' Decide which is the better way:
if front_left > front_right then ' if the empty space to the left is greater
gosub bot_lturn ' turn left
else '        otherwise
gosub bot_rturn ' turn right
end if

forward B : backward A ' turns the robot left
if objwidth = 6 then ' if there is a valid target ahead
pause turn' turn twice as much to flee
endif '            otherwise
pause turn : gosub allstop ' make a normal turn

forward A : backward B ' turns the robot right
if objwidth = 6 then ' if there is a valid target ahead
pause turn ' turn twice as much to flee
endif '            otherwise
pause turn : gosub allstop ' make a normal turn






Hey! Formatting! Embedded pictures! Your post is much improved. Thanks so much for sharing.

What decision progress do you use to determine how many degrees left (or right) the tank turns? 

I was looking at some quiz complexity, yet it is simple. I am also glad to be here. Still planning your project, a body forward.



It is a replacement for the PICAXE 28X bought together with the AXEBoard28. http://shop.snailinstruments.com/ I try to be precise in their work, so it was also nice to look at.



I was looking for detailed instructions for someone who is completely at the beginning and I could not find, so I worked with one man Milan (administrator) PICAXE.CZ and acted according to his advice. I'm not stingy so I placed the instructions here. I am the author of this code, I found it here and just a little modified for themselves. I was very happy when it works properly. I've struggled with the registration here, I was looking for pitfalls in response to a simple question. I finally found the right answer. Apology for my English.


Hey, your English is better than my Czech!

Sorry about the quiz. It is to keep spammers out, not to make it hard for legitimate users. Glad to have you here.

Nice tank here,and very neat(comparing to mine). Is this an homemade board or a newer version of the Picaxe 28x1 ? Congrat for your project :)

I see that it originated on a post on the Czech Picaxe forum. Thanks for sharing it here as well.

Taking a quick look through your code, what are you trying to accomplish with the targetcheck routine? If an object is a certain width, you define it as a target and then simulate a 'panic' with the objectdetected routine? I'm curious to know if you are working towards something here. It looks interesting.