© 1996-2019







VI.8 Robot Control System

Robot Control System: Intro [Slide 223]

Wikipedia

A tele-operated robot is a tracked device with vehicle schematic as shown in the following figure.

  • The actual vehicle is driven by two motors, left and right. Both of these motors can move forwards and in reverse. The vehicle is steered by moving one motor faster than the other.
  • From a control point of view, commands are issued to the motors via a operator joystick which issues integers values in the range 0127 for forward motion (127 max. speed) and 0 128 for reverse motion. It is possible to drive only one motor at a time, in such a case the robot will turn. The speed of the motors is directly proportional to the value written to them.
  • The robot is equipped with 8 infra red sensors. These return an integer value in the range 0255 depending on whether an obstacle is present or not. 0 indicates no obstacle, 255 indicates obstacle very near. We normally operate with a threshold of around 100, above which we take notice of the sensor readings, i.e., an obstacle is of interest. At this point reactive control takes over from the manual control by moving the vehicle away from the obstacle until the 100 threshold is not set. The sensor positions are as follows: N, NE, E, SE, S, SW, W and NW, covering the body of the robot and shown in the figure.
  • The specification of the robot control system consists of 3 parts: Motor control, Infra-red control and Operator control.

Robot Control System: ITL [Slide 227]

  • Motor control: If the sensor detects an object then the control system takes over control otherwise if the operator requests a new movement then action this.

    Let Lic and Ric denote respectively the left and right motor commands issued by the infra-red control. Let Iractive denote the presence/absence of an object. Let Loc and Roc denote the left and right motor command issued by the operator and let Opactive denote an active operator request.

    Let move(l,r) denote the sending of left l and right r motor commands to the two motors.

  • Motor control:

    MCS
    ((Iractive move(Lic,Ric))
    (Opactive move(Loc,Roc))
    (¬Iractive ¬Opactive))

    What happens when both Iractive and Opactive are true? Both move (Lic,Ric)) and move(Loc,Roc) commands are issued.

  • Need to resolve which command has priority. If Infra-red has priority we have:

    MCS
    ((Iractive move(Lic,Ric))
    (Opactive ¬Iractive move(Loc,Roc))
    (¬Iractive ¬Opactive))

    We have strengthened the guard of the Operator with the negation of the Infra-red guard.

  • Infra-red control: read the sensors and for each sensor that is greater than the threshold of 100 adjust the motor commands accordingly. For example if the north sensor detects an object we should move in the south direction as an avoidance strategy.

    Let Ircounts(i) denote the sensor i (N: i=0, NE: i=1, E: i=2, SE: i=3, S: i=4, SW: i=5, W: i=6, NW: i=7). Let mvl(i) and mvr (i) denote respectively the left and right steering commands corresponding to sensor i.

    0
    1
    2
    3
    4
    5
    6
    7









    mvl
    b
    s
    b
    s
    f
    f
    f
    b









    mvr
    b
    b
    f
    f
    f
    s
    b
    s









    ICS
    (Iractive = ( iIrcounts(i) > 100)
    Lic = ( i : Ircounts(i) > 100 : mvl(i))
    Ric = ( i : Ircounts(i) > 100 : mvr(i))
    )
  • Operator control: if the operator requests some changes then process them.

    Let Loc and Roc denote respectively the left and right steering commands received from the operator. Let Lloc and Lroc denote respectively the last left and last right steering commands received from the operator.

    OCS
    Lloc,Lroc (
    Lloc = 0 Lroc = 0
    (Opactive = (LocLloc RocLroc)
    Lloc = Loc Lroc = Roc
    )
    )
  • Does this really model an operator joystick?
  • Operator control: The operator is active if at least one of the issued steering commands is not zero.

    OCS (Opactive = (Loc0 Roc0))

Robot Control System: Tempura [Slide 232]

/ 
  tempura code for robot control system 
  OCS : operator control system 
  ICS : infrared control system 
  MCS : motor control system 
 / 
 
define move(X,Y) = { 
  format("sending left %t  right %t \n", X, Y) 
}. 
 
define s = 0. 
define f = 20. 
define b = -20. 
define mvl = [b,s,b,s,f,f,f,b]. 
define mvr = [b,b,f,f,f,s,b,s]. 
 
/ run / define robot() = { 
  exists  Loc, Roc, Lic, Ric, Opactive, Iractive, Ircounts  : 
    { list(Ircounts,8) and stable(struct(Ircounts)) and
 define OCS() = { 
   while true do { 
     len(1) and 
     input Loc and input Roc and 
     Opactive = {if (Loc ~= 0) or (Roc ~= 0) then 1 else 0} 
   } 
 } and 
 
define sum(X) = { 
  {if Ircounts[0]>100 then X[0] else 0} + 
  {if Ircounts[1]>100 then X[1] else 0} + 
  {if Ircounts[2]>100 then X[2] else 0} + 
  {if Ircounts[3]>100 then X[3] else 0} + 
  {if Ircounts[4]>100 then X[4] else 0} + 
  {if Ircounts[5]>100 then X[5] else 0} + 
  {if Ircounts[6]>100 then X[6] else 0} + 
  {if Ircounts[7]>100 then X[7] else 0} 
 } and
define ICS() = { 
  while true do { 
    len(1) and input Ircounts and 
    Iractive = {if (exists i < 8 : Ircounts[i]>100) then 1 else 0} 
    and Lic = sum(mvl) and Ric = sum(mvr) 
  } 
 } and 
 
define MCS() = { 
   while true do { 
    len(1) and 
    if Opactive=1 and Iractive=0 then { 
      format("operator move \n") and move(Loc,Roc) } 
    else { 
      if Iractive=1 then { 
        format("infrared move \n") and move(Lic,Ric) } 
      } 
  } 
 } and
 MCS() and ICS() and OCS() 
 } 
}.







2019-05-10
Contact | Home | ITL home | Course | Proofs | Algebra | FL