Subject: The best real time explanation
From: paul lamar
Date: 1/9/2016, 5:58 PM
To: A10-Me-Earthlink



The best explanation of real time issues I have ever seen.
A laser printer and how it works is used as an example.
Also my explanation in 1979 or there abouts.
Addicted to learning. For me learning is entertainment.

Paul Lamar


For embedded systems there is the RTOS or Real Time Operating System. It
operates differently from our normal OSs and is used for time critical
applications. Lets start with an example that we are familiar with- our
EFI. Granted on the surface an EFI system is quite simple. Measure the
amount of air coming in, calculate the amount of fuel needed for a perfect
fuel/air mixture and then turn that into a PWM for the fuel injectors and
go again. If we want to add spark to the mix then you need a crank angle
sensor so that our little box knows how fast our engine is turning, where
the crank is, when to fire the plugs as well as our perfect fuel mixture.
Sounds easy enough. So for every revolution the computer needs to know
manifold pressure, temperature of the incoming air, temp of the engine and
RPM. From the CAS it reads as many as 32 teeth per revolution and the other
data presto it works. Until it doesn't.

All of our calculations are based on getting the needed info at the right
time. If it doesn't come at the right time, then what happens? The big fan
up front stops and the pilot starts to sweat.

This is where the RTOS comes in. It is already used in critical
applications like medical instruments, autopilots, EFIS systems, FADEC and
so many more. Its basic premise is that in order for the system to work we
MUST have certain info by a certain time. It wouldnt work very well for our
system to stop working while we wait for a CAS signal, or a temperature
input. The RTOS knows that we need this input by a certain time, but if it
doesn't come then a flag is raised, it uses a pre determined value for the
variable and we can limp home. When our cars go into closed loop the
computer is now just pulling from a table rather than making calculations.
Our fuel economy goes down, performance is reduced but we can get home.
When an autopilot is looking for an input from the GPS and it misses its
appointment, what does the autopilot do? It uses the last known good input,
throws a flag to let us know and reverts to maybe heading mode or GPS
heading, etc. and then you get to take over but you didn't crash. Why?
Because the time constraints were built into the system, it knew when the
mail was late and it let you know.

For an EFI system, the embedded RTOS is the only safe way to go. No boot
up, no wait time, just power on and it goes. Texas instruments has a small
dev board with dual lockstepped ARM processors that are designed to run the
RTOS. Not only do you get the benefits of the RTOS,  you get the benefit of
dual processors reading the same sensors, supposedly coming up with the
same solution and comparing notes to make sure they are right. And it costs
about $20.00. Yes you can use the provided IDE and yes you will program it
in C, but the benefit is that when we fly we get to come home even if there
is a problem along the way.

RTOS is proven, required in some FAA certified electronic systems, and best
of all its open source and free.
RTOS <http://www.freertos.org/about-RTOS.html

Kevin Alderman

Maximite BASIC is real time. So is DOS with QB as are most single board computers like the Ardrino and the Mikroe line. What is not is multitasking or multi-user
operating systems line Windows and non real time Linux. In cases like that they
have schedulers that decide what programs or threads  are worked on and when.
As a application programmer you normally have no control over that.
Also certain programs or or threads  have priority over other programs.
That too the application programmer has no control ovedr. Real time Linux
lets you change those parameters.

When writing a hardware control program for the Maximite or the arduino
the programmer has total control over what happens and when it happens
within the limits of the speed of the processor.

Paul Lamar

The Rotary Engine News Letter. Powered by Linux.
If you want off the list PLEASE let me know and I will
remove  you.  ACRE NL web site. http://www.rotaryeng.net
You Tube http://tinyurl.com/beqqxas
Copyright 1998-2016 All world wide rights reserved.