# Advice in the development of a control system

Hello Everyone

I am quite newbie in this ARM-Based embedded systems and i need some help in the development of a control system for a power electronic device.

I will try to describe the specifications and how a think this can be made:

2 - Then, some calculations with these values (multiplications, sums, divisions) the numbers are float point.

3 - Then, i need to write 12 GPIO pins.

The power electronic devices have the particularity that their actuators are switches (power transistors operated only ON and OFF, like a digital device), exists a discrete number of combinations for these switches. The idea is to evaluate which one of these is the best choice every 50 micro seconds.

I read voltages and currents (isolated sensors) then i need to calculate some cost function for a set of options (27) that are loaded in a look-up table and finally write de GPIO.

I am wondering if using a SPI device connected with a Microcontroller (PIC32) is a good option for read the sensors and trigger an interrupt in the ARM

The the ARM do the math and send the result to the switches.

Are there some problems with the Linux timing? and if affirmative, How can I fix it?

Thanking in advance, i will keeping a watchful eye in your replies

PD: Sorry for my english, this could be quite “Ununderstandable”

2 - Then, some calculations with these values (multiplications, sums,
divisions) the numbers are float point.

3 - Then, i need to write 12 GPIO pins.

The power electronic devices have the particularity that their actuators
are switches (power transistors operated only ON and OFF, like a digital
device), exists a discrete number of combinations for these switches. The
idea is to evaluate which one of these is the best choice every 50 micro
seconds.

If you need an evaluation every 50 micro seconds, don't use an OS.
Even if you could get an OS to schedule that fast (or use hard
interrupts effectively that fast), it'll be more work. Put all the
hard real time stuff (ie: 50us interrupts) in the micro controller and
have it do all the math and GPIO stuff.

If you want to use a BeagleBone, take a long hard look at the PRUSS
cores. If you're implementing this for a product, look for a dedicated
micro controller that can do the math you want to perform.

If you need to report the current status up to a system like Linux,
connect this dedicated micro controller to a Linux capable device over a
SPI bus or I2C and have it send status every once in a while (like once
every second). If using the PRUSS cores, use their interface to the
kernel to pass data.

I read voltages and currents (isolated sensors) then i need to calculate
some cost function for a set of options (27) that are loaded in a look-up
table and finally write de GPIO.

This doesn't sound like "hard math," why try to do it in Linux versus
on a dedicated micro controller?
With a 100MHz micro controller, you'd get 5000 instructions (assuming 1
instruction / cycle) to do this math. There's a TON of micro
controllers to choose from that could do this.

Are there some problems with the Linux timing? and if affirmative, How can
I fix it?

You most likely will run into problems with Linux timing if you want
consistent sub 1 ms response times (and 50us definitely is sub 1ms). It
can probably be done, but there's better and easier ways to solve this
problem that using Linux.

-Andrew