FloatSat Paper6 (2
FloatSat Paper6 (2
FloatSat Paper6 (2
IV. APPLICATIONS
In this section, we will describe some of the applications
tested on top of RODOS on FloatSat hardware. The results of
each are discussed along with its implementation.
A. INERTIAL DATA EXTRACTION AND ESTABLISHING
CONNECTIVITY.
The first step is to establish a basic configuration and set
up the wireless communication link between the FloatSat and
PC. In this regard, the LSM9DS1 Inertial Measurement Unit
(IMU) is utilized in FloatSat for measuring the object's
velocity, orientation, and gravitational force with 9 Degree of
Freedom, 3 degrees for each gyroscope, accelerometer, and
magnetometer. The IMU uses the I2C protocol to interact
with the controller device. Each axis in 9DOF has a 16-bit
data output. The sensitivity range for each sensor in IMU is
configurable and has an embedded temperature sensor inside
Fig 2. FloatSat Modules it. IMU Data includes 3-axis Gyroscope values, 3-axis
Accelerometer values, 3-axis Magnetometer values, and
III. SOFTWARE PLATFORM pitch, roll, and yaw values of the system. Initial calibration
for the gyroscope and accelerometer can be done by taking
The Software Architecture of floating Satellites is based the 1000 samples for each axis in a standstill position. These
on Real-Time On-Board Dependable Operating System samples are then averaged to generate bias values
(RODOS) [8]. Every thread inside RODOS runs parallel to corresponding to 0 deg/sec measurement. The angular
each other in Real-time. The current version of RODOS is velocity and linear acceleration can be calculated by using the
developed for the STM32F407G discovery board. However, calibrated bias values and the corresponding equations for
it can be tailored for other devices. The software components pitch, roll, and yaw. Next, the partial derivatives of pitch, roll
in RODOS adjust each other to provide dependable and yaw are calculated. Finally, the orientation angles of the
computing [9]. RODOS framework is illustrated in Fig. 3. system concerning the fixed coordinate system can be
RODOS control both the operating system (OS) and calculated using the Euler convention. The calibration
microelectromechanical system (MEM). On the top, there is process for the Magnetometer can be done by calculating the
the software middleware (MW), around MW the user minimum and maximum value for all three axes by rotating
implements its application program (AP). Each node provides the sensor in all directions.
a gateway to communicate with the external network and To establish wireless communication HC-06 Bluetooth
input/output (I/O) device. There are around 48 library header module is used for short-range wireless data communication
files, to govern the RODOS operating system. Application between the microcontroller and PC. The data rate is 2.1
Programmable Interface (API) accesses the data and interacts Mb/s. FTDI32-TTL module is used to configure the baud rate
with external hardware and software components. of the HC-06 module. This is done to connect Bluetooth
using the UART protocol with the RODOS library. Pair the
Bluetooth Module with the PC and link it with Hyper-
Terminal with the correct COM port to examine the data. The
algorithm for the purpose is as follows:
Make a write function to send the data on the UART
port inside Bluetooth Thread.
Make a Bluetooth thread to process the data
Initialize the peripheral parameters.
Loop inside Bluetooth thread runs every 1 second.
Data is printed on Hyper-terminal by writing the data
into a string.
After implementing the algorithm on eclipse IDE, we get 9-
DoF values, 3 for each gyroscope, magnetometer, and
accelerometer, and orientation angles pitch, roll, and yaw on
hyper-terminal as shown in fig. 4.
Fig 5. Publish Subscribed Network
a. Sensor Thread
The first thread is the “Sensors” thread that runs at a 5ms
time interval. This thread collects sensor information,
processes them, and then publishes the data stored in the
"sensor Data" structure into the "Sensor Data Topic" to be
received by other threads. All the values of sensors i.e.
angular velocity, linear acceleration, Magnetic Flux density,
Fig 4. IMU Data Extraction pitch, roll, yaw, temperature, and motor speed are computed
under this thread. Next, filters are used to minimize the error
of attitude estimation. Mahoney and Madgwick filters are
B. ATTITUDE CONTROL ALGORITHM implemented instead of simple complementary filters because
The Control system is a crucial part of any dynamic under complementary filters attitude error is ignored and the
system in which the output of the system tracks the desired case drifts over time resulting in wrong measurements. The
input and output is feedback to compare with the desired flow chart of the sensor thread is shown in Fig. 6 and its
input to reduce error. This closed-loop system is very working algorithm is as follows:
important against unmeasured disturbances to keep track of
input. The Attitude control algorithm in float-Sat dynamics is Sensor Thread class computes the IMU parameters.
completely based on the published subscribed protocol as Initialize peripherals i.e. SPI, ADC, and Encoder. This
shown in Fig. 5. In this system, some threads represent the is done to link peripherals with the RODOS library.
publisher sending the data on communication channels called If IMU is not properly connected, send the error
topics, and some threads represent subscribers to get the data message "Failed to communicate with IMU" and end
from the topics after getting registered to it. the thread.
If IMU data is ready to compute parameters. Calibrate
the Gyroscope, to remove the initial error.
Time-Loop is running every 5ms to collect the
(Attitude Heading Reference system) AHRS values.
The AHRS contains a different filter to find IMU data
with minimum error.
Calculate Motor speed and motor current.
All the sensor data is being published on the sensor
data topic to be received by subscribers.
Where,
“$” is the Message Start Character [1 byte].
“#” is the Message End Character [1byte].
“X” is the Message-ID Character [1 byte].
c. Telemetry Thread
The third thread is the “Telemetry” thread runs at a
1000ms time interval. Fig. 7 shows telemetry data including
Accelerometer Axis, Gyroscope Axis, Magnetometer Axis,
yaw, pitch, roll, motor speed, and motor current. This thread
publishes the sensor’s information to the ground station i.e.
Hyper-Terminal.
b. Telecommand Thread
The second thread is the “Telecommand” thread that runs
once data is received. This thread decodes the received
telecommand messages and publishes the data stored in the
telecommand data structure into the telecommand data topic Fig. 7. Telemetry On Hyper-Terminal
to be received by other threads. This is done only if the
message is valid. The message body of the telecommand
should have the following format “$Xdata#”
Fig. 9 describes the working of the Telemetry thread as direction signal goes to the H-Bridge motor driver and
follows: outputs the desired current. Then the encoder calculates the
The time loop is running and prints data on the actual speed and feeds it back to compute the error. This
terminal every 1 second. feedback loop runs until zero error is achieved and also
This thread receives sensor data and telecommand counteracts unmeasured disturbances.
data.
If this thread receives telecommand related to
telemetry, the data is printed on Hyper-terminal.
d. Modes Thread
The fourth thread is the “Modes” thread runs at a 10ms time
interval. This thread runs a different operation mode for the
FloatSat. There are two main modes of operation i.e.
Speed control mode
Velocity control mode
The PI controller is implemented to control the motor speed
and a complete description of the code is given in Fig. 10.
The reference speed is given by the user by sending a related
telecommand. The speed calculation from the encoder is the
actual speed. Reference speed is subtracted from the actual
speed to generate the error value. This error is computed in
the PI controller and a control signal is generated. This signal Fig. 10. Algorithm of Speed Mode
passes to the actuator signal generator to compute the
direction and PWM signals accordingly. The PWM and
After implementing this we get the result in which the
telecommand sends to achieve the motor speed of 1000 rpm
and the motor speed is set to our desired value as shown in
Fig. 11.