Páginas

miércoles, 13 de agosto de 2014

Build your own Picaxe bluetooth controlled servo robot (EN), Blueserbot

The robot described below is one of the simplest things you can design in micro robots.
Its about a Picaxe 08m2 with 2 continuous rotation servos and a bluetooth adapter, so we only use 3 or 4 pins in our micro.



In this case 2 cheap servos (4,5 euros each one) have been modified and 2 cheap wheels have  been adapted, but you can get modified servos and wheels that fit correctly to the axis so you can save time and efforts. However, there are many guides on internet to modify servos.

An axe021 kit has been used. Its a basic Picaxe pcb for 08M with a prototype soldering zone.
On the same pcb all the electronics is mounted, including power supply, control unit, and the sockets for bluetooth, 2 servos 2 LIPO batteries and a switch.



All the assembly is feeded by two 3,7 V cell batteries connected in serial that supply power directly to the servos. 5V are got from a 7805 regulator. Surely all the system could work at 4,5V from 3 alkaline batterias sized AA or AAA, but their life would be very short.

The control is performed by a mobile or any other other device capable of sending the characters "1", "2",..., to "0" to a virtual BT serial port. Its mandatory to pair this device with the HC-06 inside the robot before performing control.

The location and meaning of the keys is this:



The xxm2 picaxe microcontrollers seem not be able of managig servo and serial communication at the same time, the same if it is working in one only task or some tasks at the same time. So sometimes keys sent from the mobile are ignored or delayed. A timeout of 10 msg has been setup, if it is increased servos start working bad.

4800 bauds have been setup on both bluetooth adapter and program. It is not the default baud rate in BT adapter. It has been setup to improve serial communications but as it has not been improved too much, you can put this value back to 9600 and use the default values of HC-06..


'Programa para recibir comandos por bluetooth y controlar dos servos.
'Prueba del Picaxe 08M2 y módem bluetooth HC-06. 
'JCO-Robotics, Agosto 2014.

'servos en c.1 y c.2
'bluetooth en c.4 rx y c.3 tx. (En este programa no se usa tx)

#picaxe 08m2
setfreq m8

servopos c.1, 75
servopos c.2, 75

start:

select case b1

case "1"
servo c.1, off
servo c.2, 10

case "2"
servo c.1, 150
servo c.2, 10

case "3"
servo c.1, 150
servo c.2, off

case "4"
servo c.1, 10
servo c.2, 10

case "5"
servo c.1, off
servo c.2, off

case "6"
servo c.1, 150
servo c.2, 150

case "7"
servo c.1, off
servo c.2, 150

case "8"
servo c.1, 10
servo c.2, 150

case "9"
servo c.1, 10
servo c.2, off

EndSelect

serin [10, start],c.3,T4800_8, b1
'debug
goto start


No hay comentarios:

Publicar un comentario