e-puck2
1 Hardware
1.1 Overview
The following figures show the main components offered by the e-puck2 robot and where they are physically placed:
1.2 Specifications
The e-puck2 robot maintains full compatibility with its predecessor e-puck (e-puck HWRev 1.3 is considered in the following table):
Feature | e-puck1.3 | e-puck2 | Compatibility | Additional |
Size, weight | 70 mm diameter, 55 mm height, 150 g | Same form factor: 70 mm diameter, 45 mm, 130 g | ![]() |
No e-jumper required |
Battery, autonomy | LiIPo rechargeable battery (external charger), 1800 mAh. About 3 hours autonomy. Recharging time about 2-3h. |
Same battery; USB charging, recharging time about 2.5h. | ![]() |
USB charging |
Processor | 16-bit dsPIC30F6014A @ 60MHz (15 MIPS), DSP core for signal processing | 32-bit STM32F407 @ 168 MHz (210 DMIPS), DSP and FPU, DMA | ![]() |
~10 times faster |
Memory | RAM: 8 KB; Flash: 144 KB | RAM: 192 KB; Flash: 1024 KB | ![]() |
RAM: 24x more capable Flash:~7x more capable |
Motors | 2 stepper motors with a 50:1 reduction gear; 20 steps per revolution; about 0.13 mm resolution | Same motors | ![]() |
|
Wheels | Wheels diamater = 41 mm Distance between wheels = 53 mm |
Same wheels | ![]() |
|
Speed | Max: 1000 steps/s (about 12.9 cm/s) | Max: 1200 steps/s (about 15.4 cm/s) | ![]() |
20% faster |
Mechanical structure | Transparent plastic body supporting PCBs, battery and motors | Same mechanics | ![]() |
|
Distance sensor | 8 infra-red sensors measuring ambient light and proximity of objects up to 6 cm | Same infra-red sensors Front real distance sensor, Time of fight (ToF), up to 2 meter. |
![]() |
ToF sensor |
IMU | 3D accelerometer and 3D gyro | 3D accelerometer, 3D gyro, 3D magnetometer | ![]() |
3D magnetometer |
Camera | VGA color camera; typical use: 52x39 or 480x1 | Same camera; typical use: 160x120 | ![]() |
Bigger images handling |
Audio | 3 omni-directional microphones for sound localization speaker capable of playing WAV or tone sounds |
4 omni-directional microhpones (digital) for sound localization speaker capable of playing WAV or tone sounds |
![]() |
+1 front microphone |
LEDs | 8 red LEDs around the robot, green body light, 1 strong red LED in front | 4 red LEDs and 4 RGB LEDs around the robot, green light, 1 strong red LED in front | ![]() |
4x RGB LEDs |
Communication | RS232 and Bluetooth 2.0 for connection and programming | USB Full-speed, Bluetooth 2.0, BLE, WiFi | ![]() |
WiFi, BLE |
Storage | Not available | Micro SD slot | ![]() |
Micro SD |
Remote Control | Infra-red receiver for standard remote control commands | Same receiver | ![]() |
|
Switch / selector | 16 position rotating switch | Same selector | ![]() |
|
Extensions | Ground sensors, range and bearing, RGB panel, Gumstix extension, omnivision, your own | All extension supported | ![]() |
|
Programming | Free C compiler and IDE, Webots simulator, external debugger | Free C compiler and IDE, Webots simulator, onboard debugger (GDB) | ![]() |
Onboard debugger |
This is the overall communication schema:
1.3 Documentation
- Main microcontroller: STM32F407, datasheet, reference-manual
- Programmer/debugger: STM32F413, datasheet, reference-manual
- Radio module: Espressif ESP32, datasheet, reference-manual
- Camera: PixelPlus PO8030D CMOS image sensor, datasheet, no IR cut filter
- Microphones: STM-MP45DT02, datasheet
- Optical sensors: Vishay Semiconductors Reflective Optical Sensor, datasheet
- ToF distance sensor: STM-VL53L0X, datasheet, user-manual
- IMU: InvenSense MPU-9250, product-specification, register-map
- Motors: details
- Speaker: Diameter 13mm, power 500mW, 8 Ohm, DS-1389 or PSR12N08AK or similar
- IR receiver: TSOP36230
1.4 Migrating from e-puck1.x to e-puck2
The e-puck2 robot maintains full compatibility with its predecessor e-puck, but there are some improvements that you should be aware of.
First of all the e-jumper, that is the small board that is attached on top of the e-puck1.x, isn't anymore needed in the e-puck2. The components available on the e-jumper are integrated directly in the robot board. On top of the e-puck2 you'll see a quite big free connector, this is used to attach the extensions board designed for the e-puck1.x that are fully compatible with the e-puck2; you must not connect the e-jumper in this connector.
Secondly you don't need anymore to unplug and plugin the battery for charging, but instead you can charge the battery directly by connecting the USB cable. If you want you can still charge the battery with the e-puck1.x external charger, in case you have more than one battery.
Moreover you don't need anymore a special serial cable (with probably an RS232 to USB adapter) to be able to communicate with the robot, but you can use the USB cable. Once connected to the computer a serial port will be available that you can use to easily exchange data with the robot.
1.5 Extensions
All the extensions (ground sensors, range and bearing, RGB panel, gumstix and omnvision) are supported by the e-puck2 robot, this means that if you have some extensions for the e-puck1.x you can still use them also with e-puck2.
For more information about using the gumstix extension with e-puck2 robot refer to http://www.gctronic.com/doc/index.php?title=Overo_Extension#e-puck2.
2 Getting Started
2.1 Meaning of the LEDs
The e-puck2 has three groups of LEDs that are not controllable by the user.
- Charger : RED if charging, GREEN if charge complete and RED and GREEN if an error occurs
- USB : Turned ON if the e-puck2 detects a USB connection with a computer
- STATUS : Turned ON if the robot is ON and OFF is the robot is OFF. When ON, gives an indication of the level of the battery. Also blinks GREEN if the program is running during a debug session.
Battery level indications (STATUS RGB LED):
- GREEN if the system's tension is greater than 3.5V
- ORANGE if the system's tension is between 3.5V and 3.4V
- RED if the system's tension is between 3.4V and 3.3V
- RED blinking if the system's tension is below 3.3V
The robot is automatically turned OFF if the system's tension gets below 3.2V during 10 seconds.
2.1 Finding the USB serial ports used
Two ports are created by the e-puck2's programmer when the USB cable is connected to the robot (even if the robot is turned off):
- e-puck2 GDB Server. The port used to program and debug the e-puck2 with Eclipse_e-puck2 (GDB).
- e-puck2 Serial Monitor. A serial monitor. #see dedicated chapter(not yet ready)
A third port could be available depending on the code inside the e-puck2's microcontroller. With the standard firmware a port named e-puck2 STM32F407 is created.
2.1.1 Windows
- Open the Device Manager
- Under Ports (COM & LPT) you can see the virtual ports connected to your computer.
- Do a Right-click -> properties on the COM port you want to identify.
- Go under the details tab and select Bus reported device description in the properties list.
- The name of the port should be written in the text box below.
- Once you found the desired device, you can simply look at its port number (COMX).
2.1.2 Linux
- 1. Open a terminal window (ctrl+alt+t) and enter the following command.
ls /dev/ttyACM*
- 2. Look for ttyACM0 and ttyACM1 in the generated list, which are respectively e-puck2 GDB Server and e-puck2 Serial Monitor.
Note : Virtual serial port numbering on Linux is made by the connections order, thus it can be different if another device using virtual serial ports is already connected to your computer.
2.1.3 Mac
- 1. Open a terminal window and enter the following command.
ls /dev/cu.usbmodem*
- 2. Look for two cu.usbmodemXXXX, where XXXX is the number attributed by your computer. You should find two names, more or less following in the numbering, which are respectively e-puck2 GDB Server and e-puck2 Serial Monitor.
Note : Virtual serial port numbering on Mac depends on the physical USB port used and the device. If you want to keep the same names, you must connect to the same USB port each time.
3 Software
4 Advanced usage
4.1 Configuring the Programmer's settings
The on-board programmer of the e-puck2 is based on the Blackmagic probe open source project firmware.
Some functionalities has been added on top of the original project to be able to control some functions of the robot, for example the power on or power off.
To access to the available commands of the programmer, it is needed to connect to the programmer with a GDB console.
To do so, you have to type the following command in a terminal window with the com port used by the 'e-puck2 GDB Server port of your e-puck2 :
arm-none-eabi-gdb target extended-remote your_gdb_com_port
Once connected to the programmer with GDB, you can type
monitor help
or
mon help
to print the available commands of the programmer.
One command in particular is useful, which is mon select_mode. It is used to select in which mode the e-puck2 Serial Monitor com port will work.
mode 1 = the serial monitor is connected to the UART port of the main processor
mode 2 = the serial monitor is connected to the UART of the ESP32
mode 3 = the serial monitor works as a Aseba CAN to USB translator
The choice made for the mode is the only setting that is stored in a flash zone of the programmer, which means the choice is remembered, even if the robot is completely turned off.
Note : in mode 1 and 3, GDB can be used over the bluetooth connection of the e-puck2. But is is much slower than with USB and it doesn't work with Windows due to GDB limitations on this OS.
By being connected with GDB, you can also use the standard GDB command to program and debug the main processor of the e-puck2.
4.2 Using the DFU
To put the e-puck2 into DFU, it is needed to turn it on while keeping pressed the "407 boot" button located under the electronic card on the left side of the robot.
The robot will appear as "STM32 BOOTLOADER" in the USB devices.
Once in DFU, you can program it with dfu-util using the following command :
dfu-util -d 0483:df11 -a 0 -s 0x08000000 -D your_firmware.bin
See the manual page of dfu-util for further information on how to use it.
Note: For windows, it is needed to install a libusbK driver for the DFU device.
You can use the Zadig program located in the Eclipse_e-puck2\Tools\ (if you installed Eclipse_e-puck2 package) to install it.
Follow the same procedure as explained above under the Installation drivers section using libusbK driver instead of USB Serial (CDC).
Note 2: It is also possible to put the programmer in DFU by contacting two pinholes together while inserting the USB cable (no need to turn on the robot).
It is used to update the firmware of the programmer.
The two pin holes are located near the USB connector of the e-puck2, see the photo below.
4.3 WiFi communication protocol
The communication is based on TCP; the robot create a TCP server and wait for a connection.
Each packet is identified by an ID (1 byte). The following IDs are used to send data from the robot to the computer:
- 0x00 = reserved
- 0x01 = QQVGA color image packet (only the first segment includes this id); packet size (without id) = 38400 bytes; image format = RGB565
- 0x02 = sensors packet; packet size (without id) = 104 bytes; the format of the returned values are based on the asercom protocol and are compatible with e-puck1.x:
- Acc: raw axes values, between -1500 and 1500, resolution is +-2g
- Acceleration: acceleration magnitude
, between 0.0 and about 2600.0 (~3.46 g)
- Orientation: between 0.0 and 360.0 degrees
0.0 deg 90.0 deg 180 deg 270 deg
- Inclination: between 0.0 and 90.0 degrees (when tilted in any direction)
0.0 deg 90.0 deg - Gyro: raw axes values, between -32768 and 32767, range is +-250dps
- Magnetometer: raw axes values, between -32760 and 32760, range is +-4912 uT (magnetic flux density expressed in micro Tesla)
- Temp: temperature given in Celsius degrees
- IR proximity: between 0 (no objects detected) and 4095 (object near the sensor)
- IR ambient: between 0 (strong light) and 4095 (dark)
- ToF distance: distance given in millimeters
- Mic volume: between 0 and 4095
- Motors steps: 1000 steps per wheel revolution
- Battery:
- uSD state: 1 if the micro sd is present and can be read/write, 0 otherwise
- TV remote data: RC5 protocol
- Selector position: between 0 and 15
- Ground proximity: between 0 (no surface at all or not reflective surface e.g. black) and 1023 (very reflective surface e.g. white)
- Ground ambient: between 0 (strong light) and 1023 (dark)
- Button state: 1 button pressed, 0 button released
- Inclination: between 0.0 and 90.0 degrees (when tilted in any direction)
- 0x03 = empty packet (only id is sent); this is used as an acknowledgment for the commands packet when no sensors and no image is requested
The following IDs are used to send data from the computer to the robot:
- 0x80 = commands packet; packet size (without id) = 20 bytes:
- request:
- bit0: 0=stop image stream; 1=start image stream
- bit1: 0=stop sensors stream; 1=start sensors stream
- settings:
- bit0: 1=calibrate IR proximity sensors
- bit1: 0=disable onboard obstacle avoidance; 1=enable onboard obstacle avoidance (not implemented yet)
- bit2: 0=set motors speed; 1=set motors steps (position)
- left and right: when bit2 of
settings
field is0
, then this is the desired motors speed (-1000..1000); when1
then this is the value that will be set as motors position (steps) - LEDs: 0=off; 1=on; 2=toggle
- bit0: 0=LED1 off; 1=LED1 on
- bit1: 0=LED3 off; 1=LED3 on
- bit2: 0=LED5 off; 1=LED5 on
- bit3: 0=LED7 off; 1=LED7 on
- bit4: 0=body LED off; 1=body LED on
- bit5: 0=front LED off; 1=front LED on
- RGB LEDs: for each LED, it is specified in sequence the value of red, green and blue (0...100)
- sound id: 0x01=MARIO, 0x02=UNDERWOLRD, 0x04=STARWARS, 0x08=4KHz, 0x10=10KHz, 0x20=stop sound
- request:
For example to receive the camera image (stream) the following steps need to be followed:
1) connect to the robot through TCP
2) send the command packet:
0x80 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
3) read the ID (1 byte) and the QQVGA color image pakcet (38400 bytes)
4) go to step 3