A couple of years ago, I wrote Scilab Recipe 1: Introduction to Scilab/Scicos. By the time people begin to find it on Google, some information has become outdated. For example, the file extension for an xcos model now changes from .xcos to .zcos. The Scilab user interface has also been improved noticeably. The basics and syntax for Scilab commands have not changed much though, so the article could still serve as an introduction to this open-source software.
Part III: Migration to Target Processor
This material continues from our previous discussion
- Part I: Discretization and Simulation
- Part II: Algorithm Formulation
If you have not done so, make sure you read them first to understand the whole development process.
Recall from last time, we are able to implement our HDM model as an algorithm written using Scilab script, and test that it yields similar response to Xcos simulation. The rest of the work is to rewrite the algorithm using a programming language that some cross compiler supports, since it has to be run on a target system. In our case, we will be using PIC24EP product line from Microchip. The advantages are its low cost and simplicity, yet with proper setting it could run at a high performance of 70 MIPS.
Part II: Algorithm Formulation
Previously in Part I: Discretization and Simulation, we discuss the process of obtaining a discrete-time transfer function that represents our HDM plant. At the end, we want an algorithm that can be executed on an embedded computer. Before that, some intermediate step is essential; i.e., the discrete-time transfer function must be put into some structure ready to be formulated to an algorithm. Using digital signal processing terminology, it is called a direct form, abbreviated DF.
Part I: Discretization and Simulation
One approach quite common in industrial control nowadays, when doing analysis and design with a real plant is expensive, is to implement the plant model on a computer, usually an embedded system. Some advantages of this so-called Hardware-In-the-Loop (HIL) approach, in addition to lowering development cost and time, are flexibility in adjusting the parameters, and the ability to perform extreme experiments which might damage the real plant.