next up previous
Next: Conclusion Up: No Title Previous: Second prototype

Third prototype

 

The key to obtaining the desired functionality turned out to be the differential gear. Inspired by the very clever Code Pilot Crash Buggy we use two differential gears to ensure that the motor still has something to drive when the mouth and the eyebrows have reached their extreme positions. This 'something' ended up being a silly cap quickly cut out from cardboard. As a result the motor first drives the mouth to its extreme (sad or happy) position, then the eyebrows, and finally the cap starts rotating in the most cheerful manner until the motor stops.

The advantage in this scheme is that (1), only one motor is used, and (2), no angle sensors are required. This is due to the fact that no harm is done if the motor is left on for too long - its force will just be directed to the cap. As a result the mouth and eyebrows can be timer controlled with no risk of the model performing an immature self destruct.

  figure53
Figure: Third prototype. Same principles for movement of eyebrows and mouth, only this time with just one motor, situated at the bottom. More pictures can be seen at the end of the report.

As a first application we placed the face, named 'Smiley', on the aforementioned Crash Buggy. The motor for Smiley was connected to the same output on the Pbrick as the motor for the buggy so that the following programme controlled both the buggy itself and Smiley:

Private Sub Buggy()
  MyBrick.SelectPrgm 1
  
  MyBrick.BeginOfTask 0
    MyBrick.SetSensorType IN1, 1
    MyBrick.SetSensorMode 1, 1, 0
    MyBrick.SetVar 1, SENVAL, IN1
    
    MyBrick.SetPower "motor0", CON, 7
    MyBrick.SetRwd "motor0"
    MyBrick.On "motor0"
    
    MyBrick.Loop CON, 0
        MyBrick.SetVar 1, SENVAL, IN1
        
        MyBrick.If VAR, 1, EQ, CON, 0
            MyBrick.SetRwd "motor0"
            MyBrick.PlayTone 222, 200
            MyBrick.Wait CON, 300
        MyBrick.EndIf
         
        MyBrick.SetFwd "motor0"
        MyBrick.PlaySystemSound 1
        MyBrick.Wait CON, 44
    MyBrick.EndLoop
  MyBrick.EndOfTask
    
End Sub

The buggy goes straight forward until its touch sensor changes its value from the usual 1 to 0 indicating that it has bumped into something. The Pbrick then reverses the direction of the motor resulting in a backwards/turning movement for 3 seconds before it goes back to the normal straight forward motion.

Now since Smiley's motor receives the same input as the motor in the buggy, it will show a happy, cap-rotating face as long as the buggy is moving steadily forward. When an obstacle is met, Smiley's motor direction is reversed along with the direction of the buggy motor resulting in a gradually changing facial expression from happiness to anger.

As a preliminary attempt to explore the possibilities of sound making that the Pbrick offers, we programmed the buggy to emit two different sounds when moving forwards and backwards, respectively. The idea was of course to support the impression of a 'state of mind' already given by Smiley by appropriate sounds, and this will be much more deeply investigated in the future.


next up previous
Next: Conclusion Up: No Title Previous: Second prototype

Jakob Fredslund
Tue Nov 17 17:26:48 MET 1998