### Arduino FreeRTOS Mutex Examples

In this section, we will explain using an example to demonstrate mutexes in Arduino using freeRTOSThere are two freeRTOS Mutex examples in this tutorial, the first example demands some hardware (LCD) While the second does not need any hardware, you can try out both if you have the resources.

In the last tutorial, we considered in detail: semaphores and mutexes and we also established the difference between binary semaphores and mutexes.
Just for a review:Recall that a mutex is a locking mechanism that implements the take and gives functionality in itself, unlike a binary semaphore. See this tutorial if you have not before continuing.
Example 1: Protecting the LCD Resource Using Mutex in freeRTOS
Program Description

In this program, we Demonstrated the use a 16x2 LCD display to implement a mutex.

The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. you can usually tell them by their 16-pin interface.

THE CIRCUIT

* LCD RS pin to digital…

### Non Linearity in Systems and their Models

When dealing with systems in nature, you are bound to encounter some form of nonlinearities which makes it difficult to apply normal linear theories taught in mathematics. In fact, every system in nature has some form of non-linearity in it, either imposed on it by the surrounding environment or is inherent in the system itself or introduced by the designer to improve the system characteristics.

In the study on non-linear systems there are basically three common tools used in its analysis, which are Lyapunov Theorem, Describing functions and Phase-plane techniques.

Today, we will be examining non-linear systems and subsequently, we will review the common mathematical tools useful in analyzing non-linear systems.

## What is a non-linear system

A non-linear system is any system, physical, mathematical or hypothetical that does not obey the laws of linearity.

The laws of linearity are basically the law of homogeneity and superposition according to Hasan Saeed.
If A => B, then kA => kB;

if A => B and C=> D, then A + B => C + D

A system that does not adhere to these laws is said to be non-linear. In non-linear systems, the output does not necessarily look like the input.

Thus usually, there is a change in the output waveform.

For this study, our test input signal is a sinusoidal waveform of constant amplitude (Asinwt)

## Most common nonlinearities in systems

For the scope of this work, I will be limiting discussions to the following forms of non-linearities.

2. Saturation nonlinearity

3. Relay nonlinearity

4. Backlash nonlinearity

Before I proceed to discuss the forms of non-linearities outlined above I will like to make instances of nonlinearities in nature.

Consider the equation "V =  I*R" popularly called Ohm's law. This formula is a linear one and will hold true as long as certain conditions are maintained, one of such conditions is temperature. As the temperature is increased up to a point, the formula changes such that what you have becomes an exponential function which factors in Boltzmann's constant into the equation. As such the system begins to behave in an unpredictable manner.

Subsequently, we will be looking into describing functions which is one of the tools used in non-linear systems analysis and how they are used.

Consider a vehicle at rest, though you may be applying a force on the throttle, the car will not move until a particular amount of energy is reached, thus within this region, there is a dead-zone. Typical examples of systems that exhibit this act is a real forward biased silicon diode, there is a 0.7v voltage drop required to overcome the band gap, so applying a voltage less than this threshold will make it impossible to get an output.

In dead zone non-linearity, we have a region where the output of the system is not a function of the input or able to see the input, the output of the system is zero until a value of the input is reached.

Deadzone nonlinearity does not occur alone in a system, as the magnitude of the input is increased it gets to a point where it becomes visible at the output.

### Relay Non-Linearity

This nonlinearity is common in switches and ideal relays. Practical relays exhibit dead-zone with relay non-linearity.

### Saturation Nonlinearity

This is the most common nonlinearity. The output is proportional to the input until a point is reached called the saturation point where the system is no longer receptive to any further input. This is commonly exhibited by amplifiers, transistors and diodes also in the reverse biased mode.

### Backlash nonlinearity

This is brought about by gear-action, the explanation is best illustrated than explained.

In systems, we may have different combinations of non-linearities such as:

• Relay with Saturation etc.

Subsequently, we will use these nonlinearities for control system analysis.