Main Site Documentation

Pacman robot


Here is my first robot project using a FEZ Domino. Based on the Dagu 2WD beginners robot chassis and a Sparkfun Ardumoto board. Details can be found on the (link removed).

Being an Arduino user for many years this is a great step ahead for me using FEZ and .NETMF. :slight_smile:


Cool! And you’re welcome, thanks for referring to the ardumoto patch ;D


Very nice! How do you like that Maxbotix EZ1?


@ fokie I have to thank you for the Ardumoto library and the patch.

@ chris The Maxbotix is a great sensor for a mid range from 15cm to 1m. It has 3 interfaces analog, digital and RS232 which is great if your board lacks on free pins.


Greg and I are thinking about using them for our RC car robots. We would be using the ultra ling range ones.


Don’t have any experience with the long range sensors. The EZ1 should work upto 6,45m (256inch) but this doesn’t work on a small robot. The beam gets to wide at greater distances than 1m, detecting false echoes from floor reflections.


We love robots…300 points :slight_smile:


Cool, thank you Gus 8)


A new Pacman video has been added, now showing the complete Dagu challenge stuff. Line following and obstacle avoiding.


A smart robot…cool


Cool, but I would like to see more obstacles, how does it perform?
I see you buy at watterott too. :smiley:


Nice. How does it know how big the obstacle is?


That’s why I’ve asked this question:

Because I would expect it to be some sort of programmed avoiding. As in:

Detect object;
Turn left;
Turn right;
Folow line;

I could be wrong of course :slight_smile:


The obstacle avoiding program should do something like that (theoretically):

Detect object with the front sensor
turn left until front sensor did’nt see an object anymore
Now the side sensor takes over and keeps a constant side distance to the object
When the line sensor sees a line, abort the process.

      public static void AvoidObstacle()
            float distance;
            int line;
            sbyte speed_l = 0;
            sbyte speed_r = 0;
            byte delay;

            while (true)
                // read front sensor
                distance = front.GetDistance_cm();
                if (distance < 20.0)    // object distance < 20cm?
                    Debug.Print("Front Distance: " + distance);
                    // motors stop
                    speed_l = 0;
                    speed_r = 0;
                    delay = 10;
                    motors.MoveRamp(speed_l, speed_r, delay);
                    // left turn
                    speed_l = 30;
                    speed_r = -30;
                    delay = 10;
                    motors.MoveRamp(speed_l, speed_r, delay);
                else    // no front object
                    // read line sensor
                    line = ReadLineSensors();
                    if (line != 0)    // line detected?
                        break;       // abort process
                    // read side sensor
                    distance = side.GetDistance_cm();
                    if (distance < 6.0)    // object distance < 6cm?
                        speed_l = 40;
                        speed_r = 30;
                    else     // object distance > 6cm
                        speed_l = 30;
                        speed_r = 40;
                    delay = 5;
                    Debug.Print("Side Distance: " + distance);
                    motors.MoveRamp(speed_l, speed_r, delay);

But in practice its more difficult. I must confess, that the video doesn’t show this behaviour. Because the right motor of the robot is slower than the left one, it doesn’t turn well in place. Instead the robot is making a step backwards and make a long curve around the object.

I need to change the motors or have to add an offset between the motor speed in software.


in fact, obstacle avoiding is a very difficult part of a robot. Because it would have to constantly check whether or not there is something in front of it.

Look at this example:

There is a box in front of it. It could either go left or right around it. Let’s say left is clear. But right is not. So it drives right, it sees even mores boxes. It should then decide to check out the left side. The left side is clear.

It should decide and remember what to do to make this as functional as possible.


You should try a Maxbotix EZ4 if you’re having beam spread problems.

@ Chris that brings up a point I didn’t consider - the EZL (long range) ones only have EZL0 and ELZ1 which have a fair amount of beam spread. Our bots may be too close to the ground even with a pillar for sensors to get accurate readings. Hmm. Testing required. And more money spent. :frowning:


No, I don’t have beam spread problems. The EZ1 is fine for me. I’ve found a bug in my program :-[, now it works like a charm.
New video is online:

Now the robot is doing what the programmer meant to do it. :smiley:


It looks like it’s drunk :smiley:
Lol, seriously I would add a servo for monitoring environment.


Lol, i was just thinking the same thing :smiley:


I didn’t noticed that, when I shoot the video. Maybe because I was trunk, too. ;D
That special walking style gives the robot some human touch. :smiley: