Sei sulla pagina 1di 14

Code Generation for Micro-controller-Based

Embedded Control using Scilab/Scicos


Ayushman Barua
Supervised by: Dr. Abebe Geletu W. Selassie
Technische Universit
at Ilmenau
Fakult
at f
ur Informatik und Automatisierung
Department of Simulation and Optimal Processes (SOP)

Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Amazing Ball

Figure: Amazing Ball System

Amazing Ball is ready-to-use system for learning RT control


Allows users to explore various control techniques
Controlled by two servo-motors and a touchscreen
Microchip dsPIC33F micro-controller mounted on FLEX Boards
Open-source RTOS developed by Evidence
Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Scicos Lab

Figure: Scicos Lab

Scicos is a graphical dynamical system modeler and simulator


Users can create block diagrams to model and simulate
dynamical systems
Compiles models into executable code
Applications:
signal processing
systems control
queuing systems
Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Scicos-FLEX Code Generator

Figure: Scicos FLEX code generator

Scicos-FLEX allows the development of a digital control


automatic code generation
the process of code generation is as followed:

Design of a control system in Scicos


Simulation and tuning of the control system in Scicos
Single-click code generation for ERIKA Enterprise
Code generator for ERIKA Enterprise

Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

MPLAB ICD 3 In-Circuit Debugger System

Figure: MPLAB ICD 3 In-Circuit Debugger System

Microchips most cost effective high-speed hardware


debugger/programmer
It debugs and programs PIC Flash micro-controllers and dsPIC
Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

ScicosLab 11.1 environment

Figure: ScicosLab with scicoslab pack 11.1


Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Circular path block diagram

Figure: Scicos diagram for circular trajectory


Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

The values used


Amplitude
Frequency
Phase
Bias
Delay

4e 2
50e 3
0
0
0

Amplitude
Frequency
Phase
Bias
Delay

Table: Sine generating signal

4e 2
50e 3
90
0
0

Table: Cosine generating signal

Parametric Equation:
x = r cos(t)

(1)

y = r sin(t)

(2)

Amplitude = radius of the circle set as 4cm


Frequency = how fast the activation signal must be sent.
Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Code Generation Results

Figure: Code Generation Results


Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Lemniscates Curve Trajectory


The lemniscate of Bernoulli is a plane curve defined as:
Two foci F1 and F2
At a distance of 2a from each other
The locus of the points P so that
PF1 PF2 = a2

The curve has a shape similar to the numeral 8 and to the


symbol
The name is from lemniscus, which is Latin for pendant ribbon.
Parametric Equation:
a cos(t)
1 + sin2 (t)

(3)

a sin(t) cos(t)
1 + sin2 (t)

(4)

x=

y=

Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

curve block diagram

Figure: Scicos block diagram for curve


Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

References
S. Awtar, C. Bernard,N. Boklund, A. Master, D. Ueda, K. Craig
Mechatronic design of a ball-on-plate balancing system.
Department of Mechanical Engineering, Aeronautical Engineering
and Mechanics, Rensselaer Polytechnic Institute, Troy, NY 12180,
USA, 4 December 2001.
Huida Duan; Yantao Tian; Guangbin Wang
Trajectory tracking control of ball and plate system based on
auto-disturbance
rejection controller
Asian Control Conference, 2009. ASCC 2009. 7th , vol., no.,
pp.471,476, 27-29 Aug. 2009

Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

References contd..
Guoyang Cheng; Kemao Peng; Chen, B.M.; Lee, T.H.
Improving Transient Performance in Tracking General References
Using Composite Nonlinear Feedback Control and Its Application
to High-Speed XY -Table Positioning Mechanism,
Industrial Electronics, IEEE Transactions on , vol.54, no.2,
pp.1039,1051, April 2007
Amazing Ball
http://www.evidence.eu.com/products/amazing-ball.html
Erikadds, ErikaWiki: Amazing Ball Introduction
http://erika.tuxfamily.org/wiki/index.php?title=Amazing_
Ball_Introduction
https://en.wikipedia.org/wiki/Lemniscate_of_Bernoulli

Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Code Generation for Micro-controller-Based Embedded Control using Scilab/Scicos

TU Ilmenau

Potrebbero piacerti anche