LEGO Maniac

08/05/2019

This is my third robot. I made him for fun. He is a LEGO advertising agent called LEGO Maniac. He walks forwards, backards, and turns right and left and plays music.

 Maniac is my first robot with autonomous behavior. He stands in one spot watching for people using Infra-red proximity detection (IRPD) and a light sensor built into his baseball cap. If people come by, he plays a measure or so of the "LEGO Mania" jingle used in TV commercials in the US. The song is used to get people to notice is Mindstorms sign.

 If no one travels by him for a while, he gets bored and walks around for a bit to a new place, plays his song, and waits while he looks for people. 

As he is wandering, he uses IRPD to avoid running into obstructions. 

I wrote my own IRPD algorithm that is self calibrating and is tolerant of variable readings from the light sensor. It rarely gives false readings, and rarely misses obstructions. 

Manic is a biped that has big feet to offset his two motors he wears as a backpack. One motor makes his feet go forwards and backards, and the other makes him shift weight from foot to foot. 

The feet motor turns a 24tgear, which drives chain, which drives a 40t gear. This drives two worm gears that each drive a 40t gear. The 40t gears are parallel to the ground at the tops of the feet. These gears make the feet go forward and backards. Two touch sensors are hooked in parallel to a sensor input to detect when the feet have traveled far enough. 

The weight shifting motor drives an 8t gear, which drives a 24t gear hooked to an 8t gear, which drives a 24t gear. The 24t gear drives a chain that pulls the robot to the right or left. A rotation sensor is used to determine when to stop the weight shift motor.

 The ambulate task controls the leg drive and weight shifting to achieve walking and turning. The irpd task detects things near him. The main task implements autonomous and remote control behaviors. 

The code is compiled using NQC. The song was generated using RCXCC's piano.