XOMiCar2 - OMiLAB Robotic Car Experiment 2

Keywords: Fuzzy Logic

Use Case

To enable autonomous movement of robots, knowledge about its environment is necessary in order to coordinate appropriate movements. Since dynamic environments often lead to imprecise readings of the robot’s surrounding, knowledge representation schemes are required, which allow to handle fuzzy inputs.


The aim of this experiment is to validate the use of fuzzy logic to make an agent autonomously balance itself on a balance board, with the help of readings from a rotation sensor.

Experiment

KE Concept Description 

For the knowledge representation scheme we use fuzzy logic. This enables us to deal with non-crisp and chaining readings, by mapping them to a particular range from a set of predefined ranges. A particular range is also referred to as fuzzy set. 

Since fuzzy sets may overlap and hence readings may belong to multiple sets, fuzzy logic furthermore provides the concept of the membership of a value. The membership tells us to which degree a value belongs to a certain set. This helps us to determine which set to consider for further computations.  

In our case we define multiple sets describing the current slope of the board, to which the input of the rotation sensor is mapped. The algebraic sign determines the direction of the robot’s rotation. If the robot’s front faces downwards the value returned by the sensor is negative, et vice versa. 

 

 

Similarly, multiple sets for the speed and direction of the robot are defined. The negative algebraic sign denotes driving backwards and zero corresponds to a standstill. The higher the absolute value of x, the higher the speed. 

 

 

This leads to the last part, namely the fuzzy rules. These define which movements to carry out based on the current situation of the board’s or robot’s slope. 

 

 

Validation Environment Description

 

For the experiment we use a MBot, which is provided by the OMILAB. The connection with the MBot is made via Bluetooth. For the interaction with the Mbot a Java based API, also provided by OMILAB, is used. It offers all the necessary operations to control the robot and get the required readings from its attached sensors. 

To obtain the required rotations of the MBot on the board, we attached a 3-Axis Accelerometer and Gyro Sensor to the robot. This sensor is able to measure the acceleration and the angular rate. For our purpose we only consider one dimension that measures the angular rate of the board, on which the Mbot is placed. So a perfectly balanced boards will cause the sensor to deliver values close to zero.  

Link to sensor (Last check 2017-02-18)

We built our own balancing board by using a plain board and a cardboard roll. 

 

Results

As provided we used the MBot API for the communication with the Car. As mentioned above we connected with the MBot via Bluetooth. 

For the Fuzzy Logic implementation we used a Library called jFuzzy Logic. This Library enabled us to specify all the different Sets. Another big pro is that it generates the sets as a graphic. The output is shown above at the Fuzzy Logic explanation. 

For the better handling we created an interface, where we can start and stop the MBot car. We created an interface to interact easily with the MBot. For the interaction add the .fcl file with the fuzzy sets and the COM port to which the MBot should connect. 

 

 

The interface was very helpful during the testing phase because we didn’t need to manually turn the car off, if we detected a mistake in our fuzzy logic. 

 

Conclusion 

The precise definition of the fuzzy sets was the hardest part of the project. We needed to figure out which thresholds ensure the sensitivity that we wanted to let the MBot be able to balance in the middle of the wave board. 

In our project we modeled two sets. The first one defines the gradient of the MBot which we retrieve from the gyroscope sensor. At the second set we focused on the speed or more precise on the direction of the MBot. Direction and speed are directly related, because the MBot changes its direction if the speed-value becomes negativ.