Robot tanks

When I first decided to learn about robots, I wasn’t real sure where to start…all I knew about robots was that they used servos, and, I wasn’t even sure I understood what a servo motor was (I later learned that they usually have feedback of their arm position (usually using a potentiometer) and their arm rotational arm travel is restricted to 270 degrees or so)…

So, I decided maybe a good place to start would be miniature tanks…no servos (unless you mount something articulating on them), but they used motors that needed to be controlled by a microcontroller (MCU) and needed some means of movement control, such as infrared (IR) or radio, such as Bluetooth (BT)…

I looked around and decided to start with a company named DFRobot …they seemed to cater to newbies like me and have lots of support, help and tutorials…

I purchased one of their Devastator tanks, along with a Romeo BLE integrated MCU and motor-controller – it also includes an integrated BT radio I thought I would use for the remote control aspect…

DFRobot makes a joystick controller which can talk directly to the BLE (BT 4G) radio in the Romeo BLE board, but since I wanted to explore radio communication a bit and learn something about Arduinos, I decided to hack my own controller…I found some cheap Playstation (PS) joystick controllers on Amazon, got a few different Arduinos – I prototyped with one of the Uno’s – and got a couple HC-05 BT modules, one of which I connected to the Romeo (ignoring its BLE radio for the time being) on one side and to the Arduino which I tucked into a gutted PS joystick…

There are many tutorials for the Arduino, as well as the HC-05 modules…an example is here , so I won’t bother going into detail, but I do have a sample of two different approaches to joystick-controlling the tank motors that I can share if you drop me an email…one method uses a single joystick and both the X and Y axis:

Direction    Joystick    Left motor  Right motor
FORWARD      forward     forward     forward
BACKWARD     back        back        back
LEFT         left        back        forward
RIGHT        right       forward     back

whereas the other, or tankdrive, uses both joysticks on the controller, the left one for the left motor and right for right, but only the Y-axis of each is used – up, motor forward and back, motor back…interesting coding there…

The Arduinos use the Arduino IDE (interactive development environment) and a form of the C programming language…I had used C previously when developing the RockeTiltometer on a more robust IDE used to program that MCU, so was fairly familiar after de-rusting…again, there are many, many tutorials for Arduino so you should not have any trouble picking that up if you want start with the DFRobot examples for motor control…

I later added another tank so I could play with my grandson…I found a tank on Amazon that wound up being a better, more powerful tank than the Devastator…

I later added another tank so I could play with my grandson…I found a tank on Amazon that wound up being a better, more powerful tank than the Devastator…

I also learned a bit about bluetooth, serial ports and packet data transmissions. You can see my learning curve and find some of my code here. Tanks are fun!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s