Building a home robot: Part 4 - moving the head up and down

(see all parts of "building a home robot")

Because the monitor and raspberry pi are placed in the front of the head most of weight is there. So the motors for up/down  movement have to be powerful enough to handle this.

I decided to use two stepper motors with built in gearboxes. They also are the axis for the head movement. I mounted them back to back into a 3d printed box ,so they are moving in contrariwise directions.

Putting together neck and front head:

Assembling including cables, Raspberry Pi and electronics:

The two stepper motors have much power - but still not enough to lift the head. To fix this problem I placed a counterbalance made from lead in the back of the head.

The first test with provisional counterbalance:

After some hours of testing another problem occurred. The mechanic connection between the two motors and the 3d printed part was very small.

Only 4mm PLA to connect  to the whole head wight and movement:

And the PLA material was not strong enough to handle this for a long time – so the freedom of movement increased.

To solve this I used two small parts of aluminum with holes matching to the axis of both stepper motors.

Building a home robot: Part 3 - the chassis

(see all parts of "building a home robot")

If you want to build an autonomous robot there are at least two things to solve: Battery power and automatic charging.
Nobody wants to build a robot which needs to be charged by hand.  But building and programming a chassis that can find its docking station and charge automatic is complex and/or expensive.

So it is great that there is an existing consumer product you can use: The roomba vacuum robot from iRobot. You can get a used one for round about 150 €. If its vacuum or brush unit is broken it may cost less - and you don’t need these units.

The Roomba also supports an official and well documented serial port to control it and read its sensors.

So for my robot project I used an old iRobot Roomba.It was originally white color – but after some years of usage and sunlight some sort of ugly yellow instead.

To refurbish it I sanded it, painted it in my favorite color and bought a new battery.


In my case I wanted to use MakerBeans to build the main body of the home robot. So I mounted a small base of MakerBeans to the iRobot chassis. 

To find Roombas serial port you have to remove the robots cover. Next to the serial port there are some screws you can use to attach your own robot parts to the chassis:

 

 

Building a home robot: Part 2 - Neck design and movement

(see all parts of "building a home robot")

My first approach to move the neck and head was to use servos. Because the rotation has to move a large weight to rotate the head left/right, I bought a servo driven ball-bearing base.

The first try was a servo driven ball-bearing base.



Mechanical everything worked fine – the base had : enough power solve the movement.
But it was very loud. It made the typical plastic server “scrieeeee” sound and the base amplified the sound by acoustic resonance.
It all sounded like a big cheap RC toy from the 80s :-/ Nothing you want to hear from a futuristic robot with a cute and modern body design.

The next idea was to create laser cut gears on my own and mount them on a big ball-bearing:

As engine I wanted to use a stepper motor

Everything seems fine – even a first manual test moving the motor and gears by hand.
But the first electronic driven test was a little bit annoying: It was much more quiet and strong than the RC servo but still loud.

The next idea to solve this was to use a fan belt to connect the gears to prevent the plastic-on-plastic sound. But for this the complete construction would have to be changed.

So I tried another idea: Creating the motor gear  with 3d printing from rubber instead of laser cut acryl:

This worked very fine and now the gears are working very silent.

The endstop to home the rotation:

Building a home robot: Part 1 - introduction and head

(see all parts of "building a home robot")

Since I was a child and saw the tomy omnibot I was fascinated about robot companions. In the following years I took some tries to get or build one – for example the Sony Aibo in 2001 or my Cobra Robot.

Some weeks ago I started my first serious project of a self driving, self charging home robot - including things like face detection and voice output.

My girlfriend was not sure if it would be a little bit scary to live together with a home robot. So I decided to create a first prank design for the robot head especially for her ;-)


(A scary prank design created from old animatronics parts)

The real head will be much more cute and abstract, using a small monitor instead of physical eyeballs.

As the robot “brain” I choose a Raspberry PI 3 because it is small, fast and with low power consumption.  Other reasons were: cheap and native camera, hardware connections via the PIO port and the available official touchscreen monitor.

To create most of the body parts I want to use my 3D printer.

In the past I often used 3d editor programs like Autodesk 3D Studio or Cinema 4D – but never real CAD programs. After some research for a low cost but useful CAD program I found OpenSCAD.

This free open source tool and its unusual approach to create objects by writing program code suits perfect to my needs.

Only 3 hours later I had finished my first CAD model of a head prototype and started the 3d printer. (I plan to upload all the STL files to thingiverse.com to share them with other makers who want to built their own home robots)

The first prototype of the robot front head:

The following 4 improved prototypes:

An early prototype showing the complete head shape:

The final front part without raspberry pi...

...and with raspberry pi and the touchscreen monitor:


The next step will be the neck design and the motors for moving the head and the neck.

Continue reading: Part 2 - Neck design and movement

Using coroutines to create tutorials in Unity 3D

When reading the first time about unitys co-routine concept I thought by myself: How can this be useful?

In the meantime I found out that co-routines are one of the most interesting features of unity 3d.

For my actual game project I use them for several purposes; the most useful is to control interactive level tutorials.

The game contains an advisor avatar:

It guides the player through the level and automatically appears when a milestone is reached and the next hint is needed.

Co-routines are the perfect tool to manage this kind of tutorial.

  1. Create a co-routine and run it when the level starts.
  2. If a initial introduction is needed, this should be the first command inside the co-routine.
  3. Create a WHILE loop which waits till the next milestone event happens and contains a “yield return null;”.
  4. What a milestone is depends on the kind of game you are working on. For my actual game project these are “opening a dialogue”, “selecting a specific object” or “reaching a special place in the level”.
  5. When the condition of the milestone becomes TRUE, the WHILE loop will exit. In my game the next command after the WHILE loop invokes the advisor popup to explain the next step.
  6. Then the next WHILE loop to wait for the next milestone follows – and so on. 

Here is an example how such a tutorial code could look like:

    protected IEnumerator HintPlayback(int moneyToAdd, int itemsToBuy)
    {
        yield return new WaitForSeconds(4);

        ShowMessage("Please look at the pending tasks.");

        while (!this.tasks.AreOpen) yield return null;

        ShowMessage(string.Format("Please add some money - at least {0}$.", moneyToAdd));

        while (!this.money < moneyToAdd) yield return null;

        ShowMessage(string.Format("Perfect. Now please buy at least {0} items.", itemsToBuy));

        while (!this.items.count < itemsToBuy) yield return null;

        ShowMessage("You have completed the tutorial.");

        yield break;
    }

 

You can also skip one ore more hints if milestones are skipped: just check for both conditions (for milestone 1 and 2)  in the WHILE loop of milestone 1.