next up previous
Next: Second prototype Up: No Title Previous: Feelings?

First prototype

Our first prototype uses two motors and two angle sensors to accomplish the expressiveness described above. The movement of the mouth is controlled with three joints; two passive on the sides and one 'active' in the middle. The active joint can be moved straight upwards and downwards and so drag the curve of the mouth to its extreme positions. The two motors used are the old LEGO motors that come with the Control Lab.

  figure12
Figure: The curve of the mouth is the result of the upwards/downwards movement of the middle joint.

This model works reasonably well. It is programmed on the Control Lab in LegoLogo with the following programme (translated from Danish):

to move_eyebrows :pos
  if :pos > 3 [make "pos 3]
  if :pos < -1 [make "pos -1]
  tto "eyebrows setpower 6 
  ifelse :pos > eyebrows_angle 
      [up on
       waituntil [eyebrows_angle >= :pos]
       off]
      [ifelse :pos < eyebrows_angle 
           [down on
            waituntil [eyebrows_angle <= :pos]
            off]  
           []]
end     

to move_mouth :pos
  if :pos > 11 [make "pos 11]
  if :pos < -5 [make "pos -5]
  tto "mouth setpower 7
  ifelse :pos > mundvinkel 
      [sad on
       waituntil [mundvinkel >= :pos]
       off]
      [ifelse :pos < mundvinkel 
           [happy on
            waituntil [mundvinkel <= :pos]
            off]  
           []]
end



to hate_light
  forever[
      make "p (((:light7 - (remainder :light7 4)) / 4) - 12)
      move_mouth :p
      if :p < 1 [resett1]
      wait 5
      ]
  forever[
      ifelse timer1 > 80 
          [move_eyebrows -1]
          [ifelse timer1 > 60 
               [move_eyebrows 0]
               [ifelse timer1 > 40 
                    [move_eyebrows 1]
                    [ifelse timer1 > 20 
                         [move_eyebrows 2]
                         [move_eyebrows 3]]]]                 
      ]
end

The programme consists of three procedures. One moves the eyebrows to a position defined by the actual parameter of the procedure call (based on information from an anglesensor, eyebrows_angle), one moves the mouth analogously, and one, controlling the two other procedures through information from a light sensor placed on top of the model, assigns the face a fear of light : the mouth curve depends directly on the amount of light received by the sensor, and when the mouth goes below a certain 'unhappy' point a timer goes on. The longer time the mouth is unhappy, the lower the eyebrows will go until the whole expression of the face is that of a very discontented or even angry person.

 figure23
Figure: As time passes since the last time the mouth was happy, the eyebrows gradually lower themselves to turn the expression from fearful (``I'm afraid of all this light.'') to angry and impatient (``Get me some shade now!)''

The choice of a light sensor to demonstrate the working of the model was arbitrary. It was a fast way of getting some kind of input from the surroundings that the face could respond to. One could easily come up with other perhaps more intriguing dependencies between the expression of the face and its surroundings. An example of this will follow in section gif.

  figure28
Figure: First prototype seen from behind. A roughly face-shaped piece of cardboard was placed on the front with only the mouth and eye brows protruding through it to hide the gears and motors controlling them.


next up previous
Next: Second prototype Up: No Title Previous: Feelings?

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