Statistics collected by Thymio

Approach

As part of a scientific survey, the robot Thymio II records anonymously various operating parameters, such as time spent in each behaviour or functions used in programming. This survey aims to understand how people use their robot and how they learn to program.
This data is stored in the robot's memory automatically and can only be retrieved by having a physical and voluntary access to the robot itself. Indeed we must introduce a special SD card to copy this data. In any case this data cannot be recovered with another card, through the cable or via Internet.
We will solicit volunteers sometimes, when we need to collect data.
If you are interested, or if you have any questions, please don't hesitate to contact us.

Example of collected data

####################### START DUMP ##########################
---- Page dump
Poweron time:         0     minutes
Asebastudio time:     0     minutes
Usb-only time:         0     minutes
Poweroff time:         0     days
Switch-on count:    0
Reprogram count:    0
Mode time:
    Menu        0    minutes
    Explorer    0    minutes
    Follow        0    minutes
    Acc        0    minutes
    Line        0    minutes
    Rc5        0    minutes
    Sound        0    minutes
    Virtual Machine    0    minutes
Flags: 0x000000 (none)
Record: #0
    Poweron time:         165     minutes
    Asebastudio time:     3     minutes
    Usb-only time:         0     minutes
    Poweroff time:         1     days
    Switch-on count:    4
    Reprogram count:    0
    Mode time:
        Menu        163    minutes
        Explorer    0    minutes
        Follow        0    minutes
        Acc        0    minutes
        Line        0    minutes
        Rc5        1    minutes
        Sound        1    minutes
        Virtual Machine    3    minutes
Flags: 0x808000 (7 15 )
Total: 1 valid record
Current active record:
    Poweron time:         0     minutes
    Asebastudio time:     0     minutes
    Usb-only time:         0     minutes
    Poweroff time:         0     days
    Switch-on count:    1
    Reprogram count:    0
    Mode time:
        Menu        0    minutes
        Explorer    0    minutes
        Follow        0    minutes
        Acc        0    minutes
        Line        0    minutes
        Rc5        0    minutes
        Sound        0    minutes
        Virtual Machine    0    minutes
Flags: 0x000000 (none)
####################### END DUMP  ##########################

Statistics details

The log data is stored in memory and on two pages of flash.
The part in memory is used to keep track of the various statistics during a day's usage.
It is not affected by power on/off (i.e. the memory data is not erased when
the robot is switched off). However a reset (reset button or call _system.reset())
will result in the loss of all that day's statistics.

A new recording is defined as follows:
At start-up, if the off time is > 0 days, or if the power-on time is > 24 hours
and the battery voltage is > 3.3V.

Each recording contains the following information:
The (0),(1),(…) refer to the detailed documentation for each field which follows below.

  • Total time robot is on in minutes (0)
  • Total time Asebastudio is connected to robot (1)
  • Total time USB is connected without Asebastudio (2)
  • Flags (3)
  • Number of times robot was switched on (4)
  • Number of times robot was reprogrammed by Asebastudio (5)
  • Time passed in the menu (6)
  • Time passed in friendly mode (7)
  • Time passed in explorer mode (8)
  • Time passed in fearful mode (9)
  • Time passed in curious mode (10)
  • Time passed in obedient mode (11)
  • Time passed in attentive mode (12)
  • Time passed in virtual machine mode (13)
  • Time switched off (14)

Total time robot is on in minutes (0)

Counting starts when the robot is initialised, time spent in bootloader mode
is not counted. Counting stops with power off.
The time is counted in minutes, rounded down, in 16 unsigned saturated bits (no overflow).
Precision: 50ppm (16Mhz crystal)

Total time Asebastudio is connected to robot (1)

Counted when:

  • The USB 5V supply is present and validated
  • USB is configured (detected, Windows driver is active)
  • The USB port series is open (DTE is active)

The time is counted in minutes, rounded down, in 16 unsigned saturated bits.
Precision: 50ppm (16Mhz crystal)

Total time USB is connected without Asebastudio (2)

  • The USB 5V is present and different to (1)

The time is counted in minutes, rounded down, in 16 unsigned saturated bits.
Precision: 50ppm (16Mhz crystal)

The flags (3)

The following flags are available, detailed documentation is below.

  • LOG_FLAG_INTERNAL (f.0)
  • LOG_FLAG_BATTERY (f.1)
  • LOG_FLAG_ASEBABUG (f.2)
  • LOG_FLAG_VMCODESD (f.3)
  • LOG_FLAG_PLAYBACKSD (f.4)
  • LOG_FLAG_FLASHVMCODE (f.5)
  • LOG_FLAG_RECORDSD (f.6)
  • LOG_FLAG_MOTORUSED (f.7)
  • LOG_FLAG_IRUSED (f.8)
  • LOG_FLAG_NTCUSED (f.9)
  • LOG_FLAG_SOUND (f.10)
  • LOG_FLAG_LEDIR (f.11)
  • LOG_FLAG_LEDRGB (f.12)
  • LOG_FLAG_LEDCIRCLE (f.13)
  • LOG_FLAG_ACCUSED (f.14)
  • LOG_FLAG_BUTTONUSED (f.15)
  • LOG_FLAG_SOUNDTRESH (f.16)
  • LOG_FLAG_RC5USED (f.17)
  • LOG_FLAG_LEDBUTTON (f.18)
  • LOG_FLAG_LEDOTHER (f.19)
  • LOG_FLAG_EVENTNTC (f.20)
  • LOG_FLAG_EVENTTIMER (f.21)
  • LOG_FLAG_MOTOROVERC (f.22)
  • LOG_FLAG_IRCOMM (f.23)

The flags are set to 1, each depending on a unique condition, they are never
reset to 0 except when a new day starts.

Number of times the robot was switched on (4)

Counts the number of times the robot was switched on. Incremented each time
that the 'PIC' (microcontroller) initialisation routine is executed.
8bit 'saturated' counter (no overflow).

Number of times the robot was reprogrammed from Asebastudio (5)

Incremented each time that the virtual machine (VM) receives the 'execute' command.
8bit 'saturated' counter.

Time passed in the menu, in friendly mode, in explorer mode, in fearful mode, in curious mode, in obedient mode, in attentive mode (6)-(12)

Time in minutes passed in each mode. The time is a snapshot, taken each minute, of
the mode currently in use. That is to say, if at the instant the snapshot is taken,
the robot is in fearful mode, the whole minute will be attributed to that mode, even if
it was in another mode for the remaining 59 seconds.
Precision: 50ppm (16MHz crystal)
8bit 'saturated' counter.

Time passed in virtual machine mode (13)

Time in minutes spent in VM mode, i.e. the VM is in control of the robot, even it
is not doing anything.
8bit 'saturated' counter, rounded down, 16Mhz crystal (50ppm).

Time switched off (14)

Time spent in "off" mode. In days, rounded down (23 hours 59 minutes 59.5 seconds = 0).
8bit 'saturated' counter. The precision is quite poor, being on an internal 32 KHz RC
(microchip gives 20% error).

Flag documentation

The flags based on the bytecode of the VM are updated each time the user loads
code to the VM and executes it with Asebastudio, or each time code is loaded
either from the SD or the internal flash memory of the micro-controller.
Flags based on access to Aseba variables are only updated if for direct access
from the bytecode. The flags are not updated if native functions modify the
variables (math.*) of if the user modifies the variables manually (directly from Asebastudio).
The code is analysed "statically", i.e. the flags are updated solely by analysing
if the bytecode uses a variable, contains an "event" handler or if it calls a
native function.
If the following code is loaded:

call math.stat(prox.horizontal, min,max,mean)
if temperature == -10000 then
        motor.left.target = 100
endif

The NTC and motor flags will be set to 1 although the VM never executes the
line motor.left.target, because it is impossible for the temperature
to reach -1000°C.
The IR flag will never be set to 1 because it is a native function which
accesses the prox.horizontal variable.

f.0: Flag always set to 0, used internally to indicate whether the flash
plug position is used or not.

f.1: Flag set to 1 if there has been a "brown-out reset". This means
that the PIC voltage has dropped below 2.5V (typically if the battery has
failed). Thus the "off" time is incorrect.

f.2: Flag set to 1 if Aseba sent a "VM node specific error". This
means that there has been a programming error by the Aseba user.
Typically:

  • Division by 0
  • Access outside the limits of an array
  • Incorrect use of a native function

f.3: Flag set to 1 if valid code has been loaded from the SD.

f.4: Flag set to 1 if a sound has been read from the SD (user or system).

f.5: Flag set to 1 if the user has performed the "Write into flash" of Aseba Studio.

f.6: Flag set to 1 if the user has successfully used the sound.record function.
An SD card must be plugged into the robot.

f.7: Flag set to 1 if the motor event is present in the bytecode of the VM or
if the motor.left.target/motor.right.target variables are written to.

f.8: Flag set to 1 if a prox event is present in the bytecode of the VM or if
the following variables are read from:

  • prox.horizontal
  • prox.ground.ambiant
  • prox.ground.reflected
  • prox.ground.delta

f.9: Flag set to 1 if the temperature variable is read from.

f.10: Flag set to 1 if the following native functions are present in the code:

  • sound.play
  • sound.replay
  • sound.system
  • sound.freq

f.11: Flag set to 1 if the following native functions are present in the code:

  • leds.prox.h
  • leds.prox.v

f.12: Flag set to 1 if the following native functions are present in the code:

  • leds.top
  • leds.bottom.left
  • leds.bottom.right

f.13: Flag set to 1 if the native function leds.circle is present in the code.

f.14: Flag set to 1 if the acc or tap events are present in the code
or if the acc variable is read from.

f.15: Flag set to 1 if the following events are present in the code:

  • button.*
  • buttons

or if the button.* variables are read from.

f.16: Flag set to 1 if the mic event is used, if the
mic.intensity or mic.threshold variables are read from.

f.17: Flag set to 1 if the rc5 event is used, if the following variables
are read from:

  • rc5.address
  • rc5.command

f.18: Flag set to 1 if the native function leds.buttons is used.

f.19: Flag set to 1 if the following native functions are present in the code:

  • leds.temperature
  • leds.sound
  • leds.rc

f.20: Flag set to 1 if the temperature event is used.

f.21: Flag set to 1 if the timer0 or timer1 events are used.

f.22: Flag set to 1 if one of the motor makes an overcurrent.

f.23: Flag set to 1 if the IR communication between robot is used

71 days per page can be recorded in the flash memory.
Each page contains a header which summarizes the page contents.
The data is as follows:

  • Version, 16 bits. Currently fixed at 2. Used to ensure binary compatibility between

different firmware levels.

  • Number of times the robot was switched on, in 16 bits.
  • Total time in minutes the robot was switched on, in 32 bits.
  • USB time in 32 bits.
  • Aseba time in 32 bits.
  • All the other times recorded each day, but in 16 bits.
  • The flags OR'd together
  • Flash page number in 8 bits.

Log recovery:
If when the robot starts operation it finds an SD card containing a file "_LOGDUMP.#@!",
it will append to this file 3072 bytes containing the raw log data (the two pages).
This operation resets the logs to zero. If you recover the logs it would be great
if you send us this file, so that we can integrate it into our analyses. Thank you!

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License