MyRaspberryAndMe

Tinkering with Raspberry (and other things)


Pi-Hicle final – motor-control and autonomous driving

So this is going to be the final part of the “Pi-Hicle” series (here are Part 1, Part 2, Part 3, Part 4). There is some good news and some bad news… But first a video of the vehicle moving:

The good news is that the BigTrak is in fact runnning on its own, avoiding obstacles with its three IR sensors. The bad news is that I have discarded the Raspberry Pi for this project. The vehicle is controlled by an Arduino mini now and there won’t be a Raspberry Pi in it in the near future. Now why this?

  1. I fell in love with the BigTrak and I simply can’t make any more holes in it, let alone ripping the keyboard off
  2. My plan to decrease the speed gradually as obstacles are detected does not work. There is not enough torque to move the wheels when the speed goes below 60% (and that is still too fast indoors, at least at my home)
  3. With the vehicle moving that fast a video camera is obsolete, one wouldn’t get a clear picture of anything (and I don’t have pets to annoy…)

So I am going to share the last steps in making this project. This involves mounting the sensors and putting everything together and the simple, yet working, code for making the BigTrak drive. Continue reading


4 Comments

Pi-Hicle part 4 – Sensor Phalanx

I finally had the time to do some more work on my Raspberry Pi controlled Big Trak. So this is all about sensing the environment, well, avoiding obstacles, that is.

My idea is to have the vehicle measure the distance to any obstacles in front and to both sides. If it can’t move any further in forward direction, it will be turned in the direction (left or right) where there is the biggest distance to any obstacles. Very simple but that should be very effective. And it gives the impression of “real autonomy”, because the vehicle will turn in different directions to avoid a collision.

To get this done I ordered three Sharp GP2Y0A02YK0F distance sensors. They are well documented and used by many people out there, so I thought they should do for me, too. The sensors translate the distance into a voltage, so there is an analog value to be mapped to the distance. There is a data sheet with a nice graph showing the expected output voltage oder distance. According to the specifications the sensor has a range of 20 to 150 cm. That quickly proved to be a little too optimistic… Continue reading


2 Comments

Pi-Hicle part 3 – Big Trak autopsy and findings

This part is about the internals of the 2010 model “Big Trak”. I intend to use this toy as a base for my raspberry Pi powered vehicle. In part 1 of this series I covered the basic idea of my “Pi-Hicle” and recreated the Big Trak logic in Python. Part 2 was about displaying the programmed path on a display. Now I am lucky, because the “best girlfriend ever” gave me a real 2010 Big Trak for christmas. She even made a label, reading “Present for disassembly”. So I am doing nothing wrong here…

There are numerous resources out there about disassembling the Big Trak models, so I won’t cover this. Locate the screws and pay attention for those hidden under the grey rear bumper, then lift the top carefully and continue. David Cook from “The Robotroom” (www.robotroom.com) has extensive material about the original 198x Big Trak. For the new series of Big Traks you can find modding instructions with lots of pictures at srimech’s blog and some analysis of the circuits at the “Singleton Miller Wiki“. I am going to concentrate on my additional findings in this blog post. Nevertheless, here’s a quick overview where the screws are located. Blue arrows are “visible” screws, the red arrows point to where the additional screws are hidden under the bumper thingie:

chassis_bot

Continue reading


3 Comments

Pi-Hicle part 2 – Programming Movement And Display Path On Screen

In part one everything was about getting that legacy touch screen to work. Now it’s time to re-live my childhood. I am going to include the logic that will move my Pi-Hicle around.

In case you didn’t read the first part, here’s a short video demonstrating the GUI and screen output. The path can be programmed and will be displayed on screen with triangles showing the Pi-Hicle’s heading.

orientationThe original Big Trak was able to hold 16 instructions in its memory. Sixteen! With the Raspberry Pi as a brain this number is significantly higher, although not really needed. The programming was done with a touch pad where one could select the direction (forward, back, left, right), wait and fire. Every command was followed by one or two digits, telling the vehicle how many units of its own length to move. The numbers after the “left” and “right” instructions were used to program a turn if xx degrees. To make things easy for us children, the angle to move was scaled according to an analogue clock. 15 meant 90 degrees, 30 was 180 etc.

From the image it is clear that “Right-45” would have exactly the same effect as “Left-15”, although the vehicle would be rotating in the opposite direction. Continue reading


3 Comments

Pi-Hicle part 1 – Touch Screen support

So here’s the first real part of the “Pi-Hicle” series. As the final goal is to control my vehicle from a touch screen, getting that to work is the first task.

The touch screen I have lying around is a 4DSystems μLCD-32PT type. ulcd_backIt is controlled via a serial port and that means: 4 cables only.

Have a look at the dimensions. This thing is a 3.2″ LCD and the control board is not bigger than the screen. The processor on this display supports a lot of commands for graphics primitives, like drawing lines, circles etc. You can even select from 4 different font sizes.

It is equipped with a micro SD-card reader from which it can display graphics files and even play wav-sounds. My display is the “SGC” type, that means “Serial Graphics Client”. So the display only serves as a client, meaning that all calculations need to be done by the controlling program. For real-time updating of complex graphics or such things this may be a major drawback, but I won’t need that.

Controlling the display

As the display itself is more or less “dumb”, let alone being a “legacy product”, there are no libraries around which I could have used. Some time ago I found a CPP library for an Arduino but it seems that this library (supporting my old display) is no more. So I started from scratch with only the technical manual and the description of all supported functions and began coding.

My python class does not support the complete command set, I concentrated on the things I am going to need. And I do not need low-level support for reading/writing the SD-card slot. Continue reading


1 Comment

New Project: The “Pi-Hicle” – What is is about

Well, sooner or later it had to be. I am going to build a vehicle that is controlled from my Raspberry Pi. I know, there are tons of such projects out there, but this simply is a must. And I think I am doing things a little different…

This blog post is meant as a short “introduction” on why and what. The actual documentation of my efforts will go in blog posts with a “Pi-Hicle Part xx – some description” title.

bigtrakThe idea started the instant I saw a “Big Trak” toy vehicle in a shop. Back in around 1980-1982, I can’t remember exactly the year, this was the toy of dreams. I wanted one for christmas but then I met a new boy at school who was deeply in electronics (we were about 13-14 years old and he was repairing TVs and even built an 30-channel analogue mixer!). His bigger brother had an ZX-81 and we spent every afternoon programming that thing. So I opted for my own ZX-81 for christmas, the “Big Trak” was history.
Fast forward more than 30 years: The “Big Trak” is back in shops. I am still tinkering with electronics and, even better, I can buy my own christmas presents… Hooray!

So the plan is this: take a Raspberry Pi to control a vehicle. The keypad on the “Big Trak” will be exchanged for a touch-screen. The actual driving – and later environmental sensing – will be done by an Arduino. This way if I do something wrong, it’s just a new Arduino for 10 bucks, not a 40 bucks Raspberry Pi.

Continue reading