text:
Our vaccination packs contain all the items you need to administer your vaccinations safely and efficiently. Our vaccinations kits are disposable.
The following items are included in the flu kit:
1x CPR facemask in case
1x Consultation in progress - Sign
1x Yellow sharpsbin - 0.6L
The following items vary in pack size in the flu kits
Cotton wool balls - large
Pulp foodtainer
Yellow bag 45x29cm with adhesive strip
(available in packs of 25,50 and 100)


text:
Bna.com has a Worldwide ranking of Down and ranking in . Using IP address 220.127.116.11 in and found Other Websites on this Server
Errors Analysis Now
Bna bloomberg
Bnai yeshurun
Bna airport
Bna login
Bna tax
Bnai yeshurun teaneck
Bna airport code
Bnaitweb login
Bna fixed assets
Bna software
Bnap personalearning
Bna portfolios
Bna airport parking
Bna tax login
Bna parking
Bna express park
Bnar mls
Bna to rome
Bna bank
Bloombergbna.com » Bloomberg BNA Home Page - Bloomberg BNA
Bloombergbna.comBloomberg the Company & Its Products Bloomberg Anywhere Remote Login Bloomberg Anywhere Login Bloomberg Terminal Demo Request Bloomberg Connecting decision makers to a dynamic network of information, people and ideas, Bloomberg quickly and accurately delivers business and financial information, news and insight around the world.
Actived: Monday Jun 17, 2019
Tax.bna.com » Sign In | Bloomberg BNA
Tax.bna.comLogin to your Bloomberg Tax account here. Bloomberg Tax provides you with the tools and resources you need to develop effective tax strategies, ensure compliance, and practice with confidence. Built on the foundation of our renowned??Tax Management Portfoliosspool off;, we provide in-depth analysis from leading practitioner-experts, timesaving practice tools, news, commentary, and primary sources.
Actived: Friday Jun 14, 2019
Essential.bna.com » Sign In | Bloomberg BNA
Essential.bna.comUsing single sign-on? Enter a username and click Sign In. No password required.
Actived: Saturday Jun 15, 2019
Bloombergtaxtech.com » Income Tax Planner | Bloomberg Tax
Bloombergtaxtech.comIncome Tax Planner is top-rated income tax planning and project software used by tax, legal and financial planner professionals that calculates alternative minimum tax, estimated taxes, state and nonresident state income taxes and more for professional income tax planning and projections that help clients reduce income tax liability.
Actived: Thursday Jun 13, 2019
Profile.bna.com » BNA Login Page
Profile.bna.comBNA Login Page BNA Login Page : Username: Password:
Actived: Tuesday Jun 11, 2019
Mbna.co.uk » Online Card Services | MBNA
Mbna.co.ukAccess your MBNA credit card account information at any time to track transactions and payments, get monthly statements and much more.
Bnabank.com » Homepage | BNA Bank (New Albany, MS)
Bnabank.comBNA Bank is a certified Community Development Financial Institution. We have more home loan options than any other. Guaranteed! Learn More. Professional Business Solutions. Our experienced commercial lenders understand the sophisticated needs of today's businesses. ... Login Personal Banking ...
Usbank.com » Consumer Banking | Personal Banking | U.S. Bank
Usbank.comBank smarter with U.S. Bank and browse personal and consumer banking services including checking and savings accounts, mortgages, home equity loans, and more.
Service.mbna.ca » Bootstrap TD Login - MBNA
Service.mbna.caBootstrap TD Login - MBNA
Pro.bloombergtax.com » Bloomberg Tax & Accounting | Home
Pro.bloombergtax.comBloomberg Tax is a great research tool that is easy to navigate with targeted search results. It is my go-to tax engine for everyday use. Bloomberg Tax is a superior service at a competitive price that is crafted for tax professionals on the go.
Bnz.co.nz » BNZ Login
Bnz.co.nzYou are using an outdated browser. Please upgrade your browser to improve your experience and security.upgrade your browser to improve your experience and security.

subset: commoncrawl


text:
Separate names with a comma.
Thanks klaus486. That's what I thought but just wanted to make sure.
Fellas, I did a quick search but couldn't find anything on this. Does anyone know if the Fender Deluxe Active Jazz have normal passive pickups...
Payment sent on white
PM on the white


text:
Lund University
Department of Automatic Control
Box 118
SE-221 00 Lund Sweden
Document name
Date of issue
June 2011
Document Number
Modeling, Control and Automatic Code Generation for a Two-Wheeled Self-Balancing Vehicle Using
Modelica. (Modellering , reglering och kodgenerering fr ett tvhjulig sjlvbalanserande fordon med
The main goal of this project was to use the Modelica features on embedded systems, real-time
systems and basic mechanical modeling for the control of a two-wheeled self-balancing personal
vehicle. The Elektor Wheelie, a Segway-like vehicle, was selected as the process to control.
Modelica is an object-oriented language aimed at modeling of complex systems. The work in the
thesis used the Modelica-based modeling and simulation tool Dymola. The Elektor Wheelie has
an 8-bit programmable microcontroller (Atmega32) which was used as control unit. This
microcontroller has no hardware support for floating point arithmetic operations and emulation
via software has a high cost in processor time. Therefore fixed-point representation of real
values was used as it only requires integer operations.
In order to obtain a linear representation which was useful in the control design a simple
mechanical model of the vehicle was created using Dymola. The control strategy was a linear
quadratic regulator (LQR) based on a state space representation of the vehicle. Two methods to
estimate the platform tilt angle were tested: a complementary filter and a Kalman filter. The
Kalman filter had a better performance estimating the platform tilt angle and removing the
gyroscope drift from the angular velocity signal. The state estimators as well as the controller
task were generated automatically using Dymola; the same tasks were programmed manually
using fixed-point arithmetic in order to evaluate the feasibility of the Dymola automatically
generated code. At this stage, it was shown that automatically generated fixed-point code had
similar results compared to manual coding after slight modifications were made. Finally, a
simple communication application was created which allowed real-time plotting of state
variables and remote controlling of the vehicle, using elements of Modelica EmbeddedSystems
Number of pages
Security classification
Recipients notes
The authors of this Masters thesis would like to thank the staff of the Automatic
Control Department at LTH, especially Rolf Braun and Stefan Skoog for the
technical support they gave during the course of the project. We would like to
give special thanks to Karl-Erik rzn and Anders Robertsson for the interest
Thanks to all the personnel at Dassault Systmes AB Lund for having us
as part of your company during the course of this project. We would like to thank
Hilding Elmqvist for the enthusiasm he showed for the project and Ulf Nordstrm
for the technical support regarding the Modelica libraries. We give a special thank
to our supervisor Dan Henriksson for the guidance and advice he gave us during
all the stages of the project.
Finally we would like to thank the students at the Automatic Control
Masters Thesis Room during the spring semester 2011 for making the room such
a nice and interesting place to work at.
Acknowledgments ............................................................................... 3
Index of Figures ................................................................................... 6
Index of Tables .................................................................................... 8
1. Introduction ................................................................................. 10
Motivation ............................................................................................... 10
Problem Definition .................................................................................. 10
Goal ......................................................................................................... 10
Outline ..................................................................................................... 11
Individual Contributions ......................................................................... 11
Modelica .................................................................................................. 12
Dymola .................................................................................................... 13
Modelica Libraries .................................................................................. 13
Segway .................................................................................................... 17
Elektor Wheelie ....................................................................................... 18
4. Methodology ................................................................................ 28
Index of Figures
Figure 2.1 Double pendulum model example from Modelica Multibody
library ..................................................................................................................... 14
Figure 2.2 Double pendulum 3D model animation ...................................... 14
Figure 2.3 General appearance of the Segway PT [14]. ............................... 17
Figure 2.4 General appearance of the Elektor Wheelie [16]. ....................... 18
Figure 3.1 Structure with state feedback and state observer [21]. ............... 23
Figure 3.2 Bits and weights distribution in a Qm.n format variable .............. 25
Figure 3.3 Basic block diagram of the complementary filter. ...................... 27
Figure 4.1 Mechanical model of the vehicles body. ................................... 29
Figure 4.2 Connection diagram of the final model in Dymola .................... 31
Figure 4.3 State feedback controller simulation setup. ................................ 32
Figure 4.4 Flow chart of the angular velocity estimator with angle difference
correction. .............................................................................................................. 34
Figure 4.5 Block diagram of the implemented Complementary Filter ........ 37
Figure 4.6 Block diagram of the implemented Kalman Filter to estimate the
tilt angle of the platform and the drift of the gyroscope. ....................................... 40
Figure 4.7 Communication between tasks interfaces. .................................. 43
Figure 4.8 Communication between the control unit and the external
hardware................................................................................................................. 44
Figure 4.9 Embedded system model simulation setup ................................. 48
Figure 4.10 CommunicateReal block configuration window ....................... 49
Figure 4.11 Setup for the state feedback controller code generation ........... 53
Figure 4.12 Modified control structure in order to follow references on the
inclination angle of the platform ............................................................................ 54
Figure 4.13 Controller and reference switching Statechart. ......................... 55
Figure 4.14 Communication program setup in Dymola ............................... 56
Figure 4.15 Information block for Bluetooth communication ..................... 57
Figure 4.16 Data handling in the control unit. ............................................. 58
Figure 5.1 Two-wheeled self-balancing vehicle 3D model visualization in
Dymola................................................................................................................... 59
Figure 5.2 Behavior of the platform angle when the user leans forward and
the vehicle does not have a controller .................................................................... 60
Figure 5.3 PWM value input and angular velocity used during the motors
identification. ......................................................................................................... 61
Figure 5.4 Response of the actual motor and generated models to a given
input signal. ............................................................................................................ 61
Figure 5.5 Open loop generated model pole-zero map ................................ 63
Figure 5.6 Open loop reduced model pole-zero map ................................... 64
Figure 5.7 Open loop sampled model pole-zero map .................................. 65
Figure 5.8 Closed loop sampled model pole-zero map ................................ 65
Figure 5.9 Output response when the platform has 0.1rad initial angle ....... 66
Figure 5.10 Output behavior during forward ride ........................................ 67
Figure 5.11 Exponentially weighted moving average filter response for
different N values................................................................................................... 68
Figure 5.12 Complementary Filter performance. a) Accelerometer angle.
b)Gyro angular velocity. c) Complementary filter estimated angle. ..................... 69
Index of Tables
Table 4.1 Periodic tasks implementation on the Atmega32 ......................... 42
Table 4.2 Set_pwm function. a)Steer correction. b) Set motors velocities .. 45
Table 4.3 Code for fixed-point multiplication.............................................. 46
Table 4.4 Fixed-point format selection for main variables .......................... 47
Table 4.5 Configuration of communication port for set_pwm interface ...... 50
Table 4.6 Configuration of communication port for get_StateWheelVel
interface ................................................................................................................. 50
Table 4.7 Range attributes and annotations for main variables. .................. 51
Table 4.8 Modelica block for the state feedback controller ......................... 52
Table 4.9 Keyboard block function .............................................................. 57
Table 5.1 States of the linear model ............................................................. 62
Table 5.2 Type definitions in automatically generated code ........................ 71
Table 5.3 Controller variables declaration in automatically generated code71
Table 5.4 Equations file structure, input interfaces, calculations, output
interfaces, variables updating ................................................................................ 72
Table 5.5 Controller equation in the automatically generated code ............. 73
Table 8.1Wheel estimator Modelica block ................................................... 87
Table 8.2 LQR feedback gain Modelica Block ............................................ 89
Table 8.3 Platform estimator with complementary filter Modelica block ... 90
Table 8.4 Platform estimator with Kalman filter Modelica block ............... 91
Table 8.5 Modelica communication block and mapping function for
set_pwm interface .................................................................................................. 92
Table 8.6 Modelica communication block and mapping function for
get_StateWheelVel interface ................................................................................. 93
Table 8.7 Modelica communication block and mapping function for
get_ADCLeftEncoder interface ............................................................................. 93
Table 8.8 Modelica communication block and mapping function for
get_ADCRightEncoder interface ........................................................................... 94
Table 8.9 Modelica communication block and mapping function for
get_RightWheelDir interface ................................................................................. 94
Table 8.10 Modelica communication block and mapping function for
get_LeftWheelDir interface ................................................................................... 95
Table 8.11 Modelica communication block and mapping function for
set_StateWheelVel interface .................................................................................. 95
Table 8.12 Modelica communication block and mapping function for
get_ADCAdxl interface ......................................................................................... 96
Table 8.13 Modelica communication block and mapping function for
get_ADCGyro interface ......................................................................................... 96
Table 8.14 Modelica communication block and mapping function for
get_StateTilt interface ............................................................................................ 97
Table 8.15 Modelica communication block and mapping function for
set_StateTilt interface ............................................................................................ 97
Table 8.16 Modelica communication block and mapping function for
get_StatePlatformVel interface .............................................................................. 98
Table 8.17 Modelica communication block and mapping function for
set_StatePlatformVel interface .............................................................................. 98
1. Introduction
Simulation of complex systems has become an essential tool in the design and
modeling of large-scale physical processes. This requires the use of dedicated
computational tools. Modelica-based tools, such as Dymola, allow the generation
of accurate models of complex systems in an efficient way. The creation of
dedicated Modelica libraries such as ModelicaEmbeddedSystems has made the
development of models in specific areas possible.
The target system of this project was a two-wheeled self-balancing vehicle
with a dedicated computer which handled the stabilizing controller. This system
has embedded characteristics which make it a suitable device for the evaluation of
the Modelica EmbededSystems library features.
Problem Definition
This project aimed to evaluate the modeling language Modelica and the Modelicabased tool Dymola for complete model-to-code controller development for a fullscale programmable two-wheeled self-balancing vehicle (Elektor Wheelie).
The first phase of the project consisted in the modeling and system
identification of the target process. The model must represent all the dynamics of
the vehicle without the control system. The next step was related to the control
design and its simulation; the designed controller should keep the vehicle at
upright position.
The vehicle was equipped with an accelerometer, a gyroscope, and two
encoders, which were used to measure the platform angle, platform angular
velocity and wheel angular velocity. The sensors signals needed to be translated
into physical quantities for future estimations.
One of the most common strategies for angle estimation of an inertial
system consists of the combination of the accelerometer and gyroscope
measurements. In this project two methods to obtain a precise estimation of the
platform angle were implemented: a complementary filter and a Kalman filter.
The vehicle was equipped with an Atmega32 microcontroller which does
not support floating point arithmetic operations, therefore fixed-point
representation of real variables was needed. The fixed-point programming goal in
this project was focused on the automatic code generation using Dymola.
The communication between the vehicle and Dymola simulation
environment was the last project phase.
The main goal of this project was to test the Modelica programming language in
the design of embedded control systems.
The project was primarily focused on the use of Modelica and Dymola
tools for the design of a control system and a bidirectional communication
program for a two-wheeled self-balancing vehicle (Elektor Wheelie).
Another goal of the project was to compare the performance of
automatically generated fixed-point code against manually generated code.
This report gives a detailed explanation of the different steps followed to achieve
the goal of the project. The Introduction chapter gives an overview of the
problem as well as an explanation of its goals. In the Tools and Hardware
chapter a description of the computer software is given, the description of the
physical and hardware characteristics of the target system is also mentioned.
A simple overview of the theoretical background in control, embedded
systems and fixed-point arithmetic is given in the Theoretical Background
chapter; then, the modeling, control and programming implementation procedures
are explained in the Methodology chapter.
The experimental results and their respective analysis are presented next and
finally the conclusions of the thesis as well as future work recommendations are
given in the final two chapters of the report.
Individual Contributions
The workload of this master thesis was equally distributed between the two
authors. Andrs Zambrano Garca was designated to be in charge of the system
modeling and the controller design. Carlos Pedreira Carabel was in charge of the
fixed-point code generation and the general implementation aspects in the
microcontroller. The communication program was assumed as a joint task since it
required taking into account software, hardware and modeling aspects.
Naturally, constant communication and cooperation between the authors
were necessary in order to guarantee the success of the project.
Modelica Libraries
Multibody Library
A multibody mechanical system can be defined as a system consisting of a
number of bodies or mechanical substructures that interact with each other [5].
The multibody library is a free Modelica package which provides threedimensional mechanical components for use in modeling of mechanical systems
such as robots, vehicles, mechanical parts, etc. [6]. An important feature of this
library is that all components have information for animations such as default
sizes and colors.
The goal of this library is to simplify the modeling and dynamic analysis of
mechanical systems or mechanical subsystems that are part of a larger system.
Given an idealized model of a mechanical system and external forces that
influence it, the Dymola simulation can calculate the position and orientation of
each body as a function of time. This model allows analysis of the movements of
bodies (mechanical parts), resulting from the application of forces and torques, as
well as the influence of other environmental changes [5].
Figure 2.1 shows an example of a double pendulum model designed by
interconnection of components found in the Multibody library and Figure 2.2
shows its 3D visualization.
Figure 2.1 Double pendulum model example from Modelica Multibody library
that are interconnected with certain movement restrictions. The rotation of bodies
in relation to the inertial coordinate system is also considered and is represented
by vectors of angular velocity and angular acceleration.
Other main features of the MultiBody library are [5]:
x It has about 60 major components, such as joints, forces, bodies, sensors
and visualizers, which are ready to be used. Force laws in one dimension
can be defined with components from other libraries like the Rotational and
Translational libraries, which can be connected to the components of the
MultiBody library.
x It has about 75 functions to operate on the orientation of objects, for
example, to transform vector quantities or to compute the orientation of an
object rotating in a plane.
x A world model, which must be present in every model in the higher level.
This model defines the gravity configuration, and also displays the
coordinate system to be used as a reference in the model and the default
settings for the animation.
x All components contain animation properties, allowing to perform a visual
check of the constructed model.
x Automatic handling of kinematic loops, i.e. the components can be
connected in almost any arbitrary way.
x Automatic selection of states for the joints and bodies. Dymola uses the
generalized coordinates of the joints as states if possible; if not possible the
states are selected from the coordinates of the bodies.
LinearSystems2 Library
The LinearSystems2 library is a Modelica package that provides different
representations of linear, time-invariant differential and difference equation
systems. It has the basic structures and functions for linear control systems in
accordance with the following mathematical representations: state space, transfer
function, poles and zeros and discrete state space [6].
Some sub-libraries for working with different mathematical representations
within the LinearSystems2 Library are [7]:
x Analysis: contains functions for computing eigenvalues, poles, zeros and
controllability properties.
x Design: contains functions for designing control systems.
x Plot: contains functions to calculate and plot poles and zeros, frequency
response, step response, etc.
x Conversion: contains functions to convert from one type of mathematical
representation to another, for example, from state space to transfer function.
x Transformation: provides functions to perform a similarity transformation
(i.e. matrices linear transformation under different bases), for example, to
the form of controllability.
x Import: contains functions to import data from a model (for linearization)
or from a file.
EmbeddedSystems Library:
The EmbeddedSystems library contains components for modeling embedded
systems and configuration of integrated systems [6]. The main objective of this
library is to perform the separation of a model in tasks and subtasks and to
associate device drivers with input and output signals to their respective parts.
The library implements the following notation to configure embedded
models [8]:
x Target: Identifies the machine that will handle the embedded system and
defines the type of target, for example, the type of processor.
x Task: identify a set of equations that are sorted and synchronously solved as
an entity in Modelica. There are no equations relating variables of different
tasks, because the communication to and from a task is executed through
calls to external Modelica functions. Different tasks are performed
asynchronously with the possibility of synchronization with external
function calls used for communication and possibly to run on different
x Subtask: Identify a set of equations within a task being executed in the
same way within the sub-task in terms of sampling and integration
methods, i.e. if a sub-task has continuous equations, they will be solved
with the same method of integration. Moreover, different sub-tasks can use
different methods of integration. If a subtask is sampled, it is activated in
the sampling instants and the equations of the subtask are integrated from
the instant of time of the last sample until the current sample, using the
method of integration defined. Integrators are used in real time subtasks
that run in real time systems, such as fixed step solvers. The equations of
several subtasks in a single task are automatically synchronized by sorting
the equations.
The separation of a model in different partitions is done through the use of
communication blocks. The communication blocks are the central part of the
EmbeddedSystems library, as they provide a graphical user interface. The type of
communication defines the communication that will take place between the input
and output of a communication block. The types of communication can be [8]:
x Direct Communication: This communication type is used for testing and
obtaining significant default values of the model and/or to test how a
controller behaves when noise or signals with some delay are introduced.
x Communication between two subtasks: This type specifies that the input
and output signals are produced in different subtasks. The input subtask is
periodically sampled at a defined rate.
x Communication between two tasks: This communication type defines the
input and output signals from different tasks at the same target machine.
Sets how the communication between tasks occurs, for example, using
shared memory.
x Communication to a port: This communication type states that the input
signal is sent to an I/O (input/output) device or to a bus. In this case the
communication block has no output signal. All properties of the I/O device
can be configured with the rest of the options as well as the properties of
the equations of the subtasks or tasks that generate the signal that must be
sent to the device.
balanced with the help of dual computers running an appropriate program, two tilt
sensors and five gyroscopes. The servo motors drive the wheels to rotate them
forward or backward as necessary to maintain balance or propulsion [15].
The Segway also has a mechanism to limit the speed called governor. When
the vehicle reaches the maximum speed allowed by the program, the device starts
to intentionally lean back. This allows the platform to move forward, and that the
handlebar is tilted back toward the pilot, in order to reduce speed. If not for the
governor, passengers could lean a lot more than the engine could compensate for.
The Segway also reduces the speed or stops immediately if the handlebar of the
device collides with any obstacle [14].
Elektor Wheelie
ATMEL ATmega32
The Elektor Wheelie has an ATmega32 as its main processor. This is an 8 bit
processor manufactured by ATMEL. The processor's name was derived from the
following abbreviations: AT refers to the company ATMEL Corporation, Mega
means that it belongs to the category of MegaAVR microcontrollers and 32
indicates the size of the controller memory, which in this case is 32KB [19].
The most notable features of the ATmega32 which were used during the
development of this project are:
x I/O Ports: It has four I/O ports of 8 bits (PORTA, PORTB, PORTC and
x ADC Interface: The microcontroller is equipped with eight ADC (analog
to digital converters) channels with a resolution of 10 bits. These channels
were used to get readings from the sensors.
x Counter/Timers: The microcontroller has two 8-bit counters and one 16-bit
counter. One timer was used to generate the periodic controller tasks,
another one was used to generate the PWM signals in order to drive the
x USART: Universal Synchronous and Asynchronous Receiver and
Transmitter, is used for serial communication (transmission of data bit by
bit) with an external device. Used during the communication interface
3. Theoretical Background
A two-wheeled self-balancing vehicle is a platform attached to a two-wheel set
controlled independently by DC motors. The vehicles chassis attached to the
wheels makes the system behave as an inverted pendulum; additionally, the mass
of the user causes the center of mass of the whole system to vary, which has an
impact on the used control technique [12].
The two-wheeled inverted pendulum has been widely studied because of its
highly non-linear behavior and its open-loop instability; these characteristics make
it a typical problem in control engineering and a good process to test different
control systems. The main goal for this process is to move the wheels into a
specific position while keeping the center of mass of the system at upright
position [13].
Although there are numerous mathematical models to represent the twowheeled inverted pendulum, their study goes beyond the aim of this work in
which a representative model of the real process was obtained with help of a
computational tool (Dymola).
There are multiple approaches to system analysis in the control engineering field.
However, one which is considered modern is the state space analysis; this is
because it is the basis of optimal control and overcomes the applicability
limitations of the transfer function analysis [20]. As the two-wheeled selfbalancing vehicle is a complex system with multiple outputs, this representation is
the most suitable for its analysis.
Given a MIMO (multiple inputs, multiple outputs) system, with inputs u1(t),
u2(t),, um(t), outputs y1(t), y2(t),, yr(t), and state variables x1(t), x2(t),, xn(t);
the input, u(t),output, y(t) and state, x(t), vectors are defined as:
The representation of the given system in state space form consists of a set
of first order equations [21], thus, for a LTI (linear time-invariant) system, the
corresponding state space representation is defined as:
where Anxn is the system matrix, Bnxm is the input matrix, Crxn is the output
matrix and Drxm is the feed through matrix. The matrices contain time-invariant
coefficients which depend on the systems physical characteristics or parameters.
where r(t) is the reference signal the system is supposed to follow and Kmxn
is the time-invariant feedback gain matrix.
The state-feedback control law can be applied to the system as long as all its
states can be measured, otherwise a reconstruction of the states is necessary; a
state observer is able to do this work. It can be shown that the following system
provides a reconstruction of the original systems states when it does not have a
feed forward term [21]:
are the reconstructed state vector and the reconstructed
output vector, respectively, and L is the observer matrix gain. Thus, the feedback
of the reconstructed states can be represented as shown in Figure 3.1.
Figure 3.1 Structure with state feedback and state observer [21].
Optimal Control
Kalman Filter
In cases where it is impossible to obtain measurements of the states without error,
it is reasonable to use an optimal state estimator. The Kalman filter provides a
mathematical model capable of suppressing the measurement noises in an optimal
way [21].
Assuming that the system is affected by white Gaussian states and
measurement noise v1(t) and v2(t), with intensities R1 and R2 and with cross
spectra R12, the equations can be written as:
Fixed-Point Arithmetic
Since most of the microprocessors available on the market do not have hardware
capable of supporting floating-point calculations, it is often needed to resort to
emulation software in order to solve such calculations. However, these solutions
generally reduce the execution rate of the algorithms. The implementation of
fixed-point arithmetic operations is a valid option because it uses the integerdedicated hardware available on small microprocessors [24].
Qm.n Format
At processor level, variables have a specific bit size (commonly 8, 16 or 32 bits).
The fixed-point representation X of a real number x, is to assign a certain amount
of those bits to represent the integer part of the number and another amount to the
fractional part. In order to write a real number as a fixed-point number the Qm.n
format is used, where m is the number of bits in X assigned to represent the integer
part of x and n is the number of bits used to represent its fractional part.
Additionally, an extra bit is required to denote the sign when the variable can take
positive and negative values [25]. It is then easy to convert between the real
number x and its respective X (bit size N=m+n+1) as follows:
It is important to note that there is a possible risk of overflow in the sum and
the intermediate result of multiplication, this phenomenon should be considered
when programming fixed-point operations. Similarly, it is notable that the
divisions by the base two powers can be taken as binary shifts to the right, which
is convenient because such operations tend to take little processor time.
Signal Smoothing
Signal smoothing algorithms have the purpose to eliminate small peaks caused by
perturbations, having as result a smoother signal. The importance of these
algorithms is that they are an effective way to generate suitable signals for further
analysis and processing. In general there are many signal smoothing algorithms;
here are two of the most common, which were used during the development of
this project.
It can be shown that the moving average filter does not have a desirable
behavior in the frequency domain, making it less efficient when it acts like a low
pass filter; however, it is an efficient filter in removing random noise while
keeping sharp changes of the input signal, making it an optimal filter in signal
smoothing [26].
Exponentially Weighted Moving Average Filter
The exponentially weighted moving average filter is a moving average filter with
an exponential-decreasing weighting on the input values; this way, more recent
values of the input signal have a stronger influence on the output signal. The
equation for this filter is:
Complementary Filter
The complementary filter is used to obtain the estimation of a signal out of two
redundant information sources [28], which have their origin from different
measurements from different transducers (i.e. sensors or detectors). The
complementary filter obtains estimation by filtering the signals through
complementary networks, which means that if one of the signals is disturbed by
high frequency noise, then it is appropriate to choose a low pass filter and
consequently obtaining a high pass filter for the other signal.
The basic complementary filter is shown in Figure 3.3 where and are
noisy measurements of some signal and is the estimate of produced by the
filter. Assuming that has mostly high frequency noise andy has low frequency
noise, then acts as low pass filter to filter out the high frequency noise in.
Therefore is the complement, i.e., a high pass filter which filters out
the low frequency noise in[ 29]. No detailed description of the noise processes
are considered in complementary filtering [30].
4. Methodology
In the following sections the methodology and experimental procedures carried
out for modeling and control of the self-balancing vehicle (Elektor Wheelie) are
explained in detail.
System Modeling
DC Motors Modeling
In the self-balancing vehicle, each wheel is driven by a DC motor. In order to
design a proper control system, it was necessary for the final model to behave as
similar as possible to the real motors; this is why it was important to take some
time in order to make a proper identification of the motors.
During the identification of the motors, Matlabs System Identification
Toolbox was used to generate a linear model of the DC motors. The identification
strategy used was grey box model identification based on a state space
representation found in [31]:
Model Linearization
In order to design a stabilizing controller for the self-balancing vehicle, a
linearization of the Dymola model was made around the upright position ( ,
with non-tilted user). Dymolas linearization tool automatically chooses the state
variables of the mechanical model in order to generate a state space model.
During a first phase a state space representation of the vehicle was generated
using Dymola; then this representation was reduced with Matlabs modred.
The reduced model was selected to have as states the angular velocity of the
platform, its angular velocity and the angular velocity of the wheels ( ),
assuming the vehicle moves in straight direction, i.e. both motors have the same
input. The outputs were chosen to be the same as the states because they are
measurements available by sensor readings (accelerometer, gyro and encoders).
The reduced model was transformed into discrete form using the c2d command in
Matlab with a sampling rate Ts=0.01s which was considered to be enough in
order to control the system.
For both the Dymola generated model and the reduced model, observability
and controlability analysis were performed using the Analysis command of the
LinearSystems2 library, also the behavior of both representations was compared
in order to establish the validity of the reduced model.
Control Strategy
A LQR control strategy was used to control the vehicle, and Modelica Linear
Systems2 lqr comand was used to get the feedback matrix K. For the selection of
matrices Q and R the relative importance of the states and control signal errors
were considered. The deviations of were highly penalized, since keeping a
straight position of the platform is the most important job for the controller. The
chosen matrices Q and R were:
Once the matrix K was obtained, the controller was simulated in Dymola.
Figure 4.3 shows the block interconnection setup for the closed-loop system
simulation. Notice that in order to simulate the model, a world component was
used to set the reference system and the direction of the gravity force; additionally
the sampler blocks were needed since the K matrix was calculated based on a
sampled model. The performance of the controller was tested by simulating
diverse behaviors of the user tilt angle.
On the real vehicle, output signals are acquired using four sensors: two angular
position sensors for the velocity of the wheels, an accelerometer for the platforms
tilt angle and a gyroscope for its angular velocity. The sensors are connected to
the control unit through its ADC ports. Naturally, the values registered by the
microprocessor correspond to voltage values which must be processed according
to the unique characteristics of each sensor in order to be interpreted as physical
Wheel Velocity
Two angular position sensors (MLX90316) are attached to the wheels of the
vehicle, these sensors allowed the measurement of the angular position of the
wheel between 00 and 3600. The output of each sensor corresponds to a voltage
value which is proportional to the angle position of the wheel. This value is in the
range [0.1Vref, 0.9Vref] where Vref is the feed voltage on the sensor.
One of the goals of this work was the fixed-point coding, for reasons
explained below, it was determined to use an angular scale in the range
for angular position. This range is convenient because of its symmetry and the
lower modulus compared to the degree scale which lets more variable space to
represent the fractional part of the values. Besides, all the variables coming as a
result of sensor processing were changed into radian units to ensure consistency.
Because of the selection of a symmetric interval, an offset constant has to be
considered. This way the angle of the wheel in a specific moment was
calculated as:
Figure 4.4 Flow chart of the angular velocity estimator with angle difference
As the controller was designed to have a single angular velocity state, a
single estimator was needed. However, it was decided to calculate the angular
velocity for the two wheels and then to calculate the wheel velocity state as:
Where and are the angular velocities of the left and right wheel
respectively. This approximation is useful when the vehicle is not moving straight
and the angular velocity of the wheels are different for each wheel.
Platform Tilt Angle and Angular Velocity
The vehicle has a sensor board with an accelerometer and a gyroscope, used to
measure the tilt angle and angular velocity of the platform, respectively. The
output signal of the accelerometer consists of a voltage equivalent to an
acceleration value which is expressed in Gravity units . That voltage is
converted in a register of 10 bits through one of the ports of the analog to digital
converter (ADC) of the microcontroller ATmega32. The following expression
permits to calculate the value of the input voltage :
With the acceleration value it is possible to calculate the tilt angle of the
platform by using trigonometry. The measured output signal corresponds to the
axis of the accelerometer. Knowing the Gravity value ( ) and the axis
component, is enough in order to estimate the tilt angle of the platform in relation
to ground surface. The expression that permits calculating the tilt angle of the
platform is:
This means,
In this case, the most important angles to be measured are the ones around
the vertical position relative to the platforms surface. If the platform reaches an
angle higher than 30 degrees, the controller will not be able to return the platform
to its upright position, therefore, the small angle approximation can be used when
the platform is tilted forward or backward at an angle (without horizontal
acceleration) [33]:
where, , in radians.
The expression (31) is valid while .
In order to obtain the platforms tilt angle from the angular velocity
calculated with Equation (32), first it is necessary to convert units from degrees
per second to radians per second, just to be consistent with the units in the system.
Secondly, the result of the conversion is integrated in time and in that way the
platform tilt angle is obtained. An important requirement to calculate the angle
from the angular velocity is that the sample time must remain constant in order to
have a correct calculation.
Estimation of Platform Tilt Angle Combining the Accelerometer and
the Gyroscope
In the next sections two approaches which permit the estimation of the platform
tilt angle from the combination of the output signals of the accelerometer and
gyroscope are presented.
Complementary Filter:
This type of filter is frequently implemented to obtain a precise value of the
platforms tilt using the data from the accelerometer and gyroscope. In the
following section, it is assumed that the acquired measurements from the sensors
have been previously converted to the appropriate units by use of the scale factors
as explained previously.
The accelerometer is a very sensitive sensor and works well in stationary
state, i.e., in situations where the horizontal acceleration generated by the
platforms movement is affected by high frequency noise. Therefore, the
accelerometer signal ( in Figure 4.5) must pass through a low pass filter,
whose purpose is to pass the changes that occur over long periods of time and
filter changes that occur over short time intervals.
that occur over long intervals of time and filters the ones that are essentially
stationary over the course time.
After filtering the respective output signals from the accelerometer and
gyroscope, these are added together to obtain the final value of the inclination
angle (Figure 4.5) of the platform.
The filter coefficient (Equation (34)) is calculated using the time constant
() and the sampling period (). Usually the time constant is less than one
second, so it can ensure small variations in the estimated angle. However, it is
important to consider that the smaller the time constant the greater the noise in the
system due to the horizontal acceleration of the platform.
The expression used to estimate the tilt angle using complementary filter has
the following structure [33]:
The filters coefficient is the coefficient of the high-pass filter. The chosen
value for the time constant indicates the time limit which needs to pass from
giving more relevance to the gyroscopes measurement to giving importance to
the accelerometers measurement. Therefore, for time intervals of less than 0.05
seconds, the integration of the gyroscope takes higher precedence and the noise
due to horizontal acceleration is filtered. For longer periods of time constant, more
weight is given to the accelerometers measurement.
When the filters coefficient and the sampling period are inserted in
equation (35), the final complementary filter is obtained:
One of the characteristics of the gyroscope which must be dealt with is that
it has a deviation in its measurements (drift) while the time passes, i.e. in addition
to the offset, therefore, it should be taken into account that the voltage increases as
time passes. This results in erroneous measurements of the angular velocity and
thus the inclination angle.
The effect of the drift in the measurements of the gyroscope is fixed by the
complementary filter, because as previously explained, the signal of the gyroscope
has higher relevance during time intervals shorter than the time constant. Thus, in
greater time intervals the signal of the accelerometer has more relevance for the
estimation of the angle.
However, in the case of this project, even if the complementary filter was a
good way to estimate the tilt angle of the platform, which corresponds to one of
the states of the system to be controlled, it was also required to estimate the
angular velocity of the platform. While the complementary filter method is able to
correct the drift due to the gyroscope in the calculation of the tilt angle, the drift
stays present in the estimation of the angular velocity as will be shown later in the
results of the experiments.
Kalman Filter
This filter is used to estimate the tilt angle and the drift of the platforms angular
velocity. Below is a description of the sensor signals through equations.
obtain a Kalman filter to estimate the desired states. The gain matrix was
calculated using the Matlab command lqe given a state space system, the noise
covariance of the process () and the noise covariance of the measurements ().
The noise covariances were chosen empirically, i.e., after several trials with
various values taking into account that it should rely more on the gyroscope signal
than on the accelerometers signal, since equation (41) does not describe all the
dynamics of the accelerometer. It is also known that the influence of the
gyroscopes drift is small because it has slow change (ramp behavior) over time.
The selected covariance matrices were:
Corresponds to the cross-correlation
The first element of the covariance indicates how the gyroscopes noise
affects the system and the second element indicates how quickly the drift varies.
The covariance expresses the size of the accelerometers noise, which is the
largest value and it means that is expected that this sensor presents a greater noise
in the measurements. Then the representation of the Kalman filter was discretized
using the Matlab command c2d.
Figure 4.6 shows the block diagram of the controller unit with the
implemented Kalman filter estimator. In order to test the performance of the
Kalman filter as an inclination estimator, it was programmed and tested offline
over real data. Once its behavior was proved to be right it was included in the
control uint.
Figure 4.6 Block diagram of the implemented Kalman Filter to estimate the tilt
angle of the platform and the drift of the gyroscope.
Taking into account the characteristics of the self-balancing vehicle, it was natural
to view the microcontroller as an embedded system with the single function of
providing the stabilizing control. The main goals for the programming of the
control unit (Atmega32) were the generation of periodic tasks corresponding to
control and estimation tasks as well as the handling of fixed-point representation
of floating point variables.
The program was structured as a task dispatcher with three different
periodic tasks, the controller itself, the wheel estimator (velocity calculator) and
the platform estimator (complementary filter or Kalman filter). In order to create a
periodic dispatcher one of the timer interrupts in the Atmega32 was used. The 8bit timer (timer 2) was set into top interrupt mode at 15625Hz. By changing the
timer counter register TCNT2 it was possible to obtain faster timer interrupts than
It was decided to set the controller execution period to Ts=0.01s which is
the sample time set during the design of the controller. The estimators were set to
run with Ts=0.005s. The reason that the estimators are running at a higher
frequency is that some estimators need certain number of iterations in order to get
a reliable estimation, so it is convenient to have them running at a higher
frequency. The maximum wheel velocity corresponds to an 11Hz frequency, the
frequency of the estimator is much higher so it would not cause sampling
problems. The wheel and platform estimators were set to have the same frequency
but they are treated as separate tasks, which is useful for future applications if
different estimators want to be tested.
The interrupt routine is shown in Table 4.1a. The interrupt period was set
to Ti=0.005s, this number is convenient as it is possible to get the periods of all
the three tasks by using the minimum amount of interrupts. Note that computing
tasks are not performed inside the interrupt handler, instead Boolean flags were
used to indicate when it is time to perform a certain task, then the computations
are performed in the main routine if the corresponding task is ready to be
performed (Table 4.1b).
Table 4.1 Periodic tasks implementation on the Atmega32
a) Timer interrupt routine
//auxiliary period variables
if(counter_wheel_estimator==1){ //Wheel estimator Ts = 0.005 s
if(counter_platform_estimator==1){ // Platform Estimator Ts = 0.005 s
if(counter_controller==2){ // Controller Ts = 0.01 s
TCNT2=0xB1; //set timer counter, interrupts every 0.005s
b) Dispatcher in main function
//controller calculations
// wheel estimators calculations
// platform estimator calculations
Platform Estimator Ts=0.005s
Global variables
Controller Ts=0.01s
The second set of interfaces is formed by those which connect the control
unit with the motors and sensors in the vehicle (see Figure 4.8). In order to get the
reading from the sensors, four functions are required, corresponding to a simple
getADC function call for each sensor. Function set_pwm(char pwm) is basically
the interface between the control unit and the motors.
Left encoder
Right encoder
Left motor
Right motor
Figure 4.8 Communication between the control unit and the external hardware
It is important to detail set_pwm function separately because it has two
main purposes which are vital for the driving of the vehicle. First, it is the function
which allows the application of the control signal to the motors and second, it
handles the steering instructions. The purpose of the function is to receive a
signed value (control signal) and set the PWM duty cycle which drives the motors
according to the control signal and the steer direction.
In order to turn, the set_pwm function takes information from the steering
wheel and adds or subtracts a fixed quantity (10) to each wheel PWM reference
value depending on the direction of the turn. When the platform angle is around
the upright position the control signal tends to be small and more power is needed
in order to turn, consequently a special exception is made when the control signal
is small so the turn quantity is changed to 30 (see Table 4.2 a).
In order to drive the motors the timer 1 in the Atmega32 was set to work in
PWM phase correct mode, the value written in registers OCR1A and OCR1B
determines the duty cycle of the input square wave signal of the left and right
motors, the smaller the written value the higher the duty cycle and therefore the
higher the speed. It is important to notice that the OCR1A and OCR1B do not
admit negative values. The effect of a negative control signal (backward
movement) is achieved through setting the H-bridge input bit which inverts the
PWM coming from the control unit.
//turn right
if(pwm>=0){ //when forward
if(pwm<0){ //when backwards
Fixed-Point Programming
Once the interfaces and the main program structure were programmed it was
possible to program the three changeable sections of code (two estimators and the
controller) by knowing the function calls of the interfaces. The aim of the
programming task during this project was to automatically generate fixed-point
code for the three changeable sections using Dymola. In order to have a
comparison point the same code was also programmed manually using fixed-point
arithmetic. During the development of this project, two different estimators were
tested in order to obtain the tilt angle of the platform; making a total of two
automatically generated codes and two manually generated codes. The interfaces
did not need to be reprogrammed in every case as they just write or read global
variables and do not make any calculations.
Manual Fixed-Point Programming
The first step in the fixed-point programming process was to define the
code for the basic multiplication (see Table 4.3) In order to represent the different
variables and constants in the program, signed 16-bits variables (type short) were
used. The fixed-point implementation uses regular integer operations, therefore
when multiplying two numbers it results in a higher number which might be
higher than the maximum value that a 16-bit variable can contain. In every
multiplication an intermediate result is generated. This result was stored in a 32
bit variable (type long) in order to avoid loss of data caused by overflow. No
divisions were coded since the Atmega32 does not have division support and it
has to be emulated. The controller itself and the estimators used did not have any
division of two variables, just divisions by constants which were realized as
multiplication by the inverse of the constant.
Table 4.3 Code for fixed-point multiplication
Multiplication routine (a x b=c)
short a; // format Qma.na, 16 bits
short b; // format Qmb.nb 16 bits
short c; // format Qmc.nc 32 bits
long temp;
if (temp<-32768) c=-32768;
else if (temp>32767) c=32767;
else c=temp;
The second step while coding in fixed-point is to determine the proper Qm.n
format for each variable and constant. For this, a rule was set for all variables: the
format was chosen so the minimum amount of integer bits are used to represent
the maximum value a variable can adopt, the rest of the bits are assigned to the
fractional part of the variable. The minimum and maximum values for each
measured variable were measured in extreme conditions in order to make sure the
variable size could handle movements even outside the typical use range. A
special consideration was taken with the control signal since it is a PWM value
(dimensionless) which can adopt values between 0-255 in integer form (safely
Q format
Fixed-point range
Wheel angular
[-70,70] rad/s
[-128,127.9960] rad/.s
3.906x10-3 rad/s
Platform angle
[-1,1] rad
[-2,1.999] rad
5.103x10-5 rad
Platform angular
[-3.5,3.5] rad/s
[-4,3.999] rad/s
1.220x10-4 rad/s
Control signal u
Once all the interfaces were redesigned in Dymola, the controller and
estimators were coded in Modelica. In order to use the automatic fixed-point code
generation it was necessary to give additional information about the range of
certain variables as well as the desired fixed-point resolution. This was possible
by modifying the range attributes of variables and using annotations. By
modifying the min and max attributes of the variable it was possible to set the
number of bits representing the integer part of the variable and through the
fixedpoint annotation it was possible to set the number of bits used to represent its
fractional part (Table 4.7).
Table 4.7 Range attributes and annotations for main variables.
Q format
Wheel angular
[-70,70] rad/s
Platform angle
[-1,1] rad
Platform angular
[-3.5,3.5] rad/s
Control signal u
As the main program in the control unit had three programmable tasks, the
code for each one was generated separately. In order to do this a simulation setup
was set for each block; Figure 4.11 shows the setup for the state feedback
controller. The communicateReal blocks had the purpose of defining the interfaces
for the tasks. In the state feedback controller four communication interfaces were
needed: three from port communication type blocks corresponding to
get_StatePlatfotmVel, get_StateTil and get_StateWheelVel and one to port
corresponding to set_pwm interface. As the corresponding Modelica mapping
functions were designed to make a call to the actual interfaces in the control unit,
it was expected to get a simple function call in the generated code for every
communicateReal block in the simulation setup. The task to be automatically
generated was set to be executed at an external fixed-point target type (the actual
vehicle). This way Dymola generated fixed-point code which could be pasted into
the main structure of the control unit. A final consideration had to be made in
order to achieve the code generation: the simulation would not run unless the
simulated model had a first order differential equation in it. As the tasks did not
have any differential equation, the equation der(x)=-x was included in all the
models for code generation, this had no effect in the regular calculations of the
Figure 4.11 Setup for the state feedback controller code generation
Once a block was simulated, Dymola generated a C file containing all the
variable and constant declarations in fixed-point representation (declarations.c
file) and another one containing the match calculations in fixed-point (equations.c
file). Similar setups were implemented for each one of the three tasks in the
control unit. The generated codes were analyzed searching for any fault, modified
when necessary and then tested in the actual vehicle through test rides in order to
evaluate the performance of the controller.
Real-Time Communication
The physical design of the vehicle makes its center of mass to be slightly
inclined forward with respect to the platforms vertical position when no rider is
driving it. This resulted in a permanent trend of the vehicle to lean forwards and
consequently an acceleration of the wheels causing the vehicle to move forward
permanently. As it was desired that the vehicle was stable, even when no rider
was on it, a way to avoid the effect of the tilted center of mass had to be created.
Figure 4.12 shows the implemented alternative. The code was modified in order to
include a reference for the platform angle; this implementation solved two
problems at the same time, the permanent leaning of the platform was eliminated
by setting a negative angle reference which corresponded to the angle of the
platform when the center of mass of the chassis was in a vertical position, and the
remote control of forward movements was achieved by setting an angle reference
value slightly higher than the reference when still.
Left Key
Right Key
Read incoming block
Get remote control direction
Mechanical Model
Figure 5.2 Behavior of the platform angle when the user leans forward and the
vehicle does not have a controller
Motor Identification
During a first approach it was considered to obtain a model for each motor.
However, some previous experiments showed that both motors had very similar
responses so it was simpler and accurate enough to use a single model for both
Figure 5.3 PWM value input and angular velocity used during the motors
Figure 5.4 Response of the actual motor and generated models to a given input
Linear Model
The motor model was connected to the mechanical model in Dymola. Using the
linearize command the obtained state space model of the vehicle was:
The input is the PWM signal, the outputs are the platform angle, the wheels
velocity and the platform angular velocity. The states were automatically selected
by Dymola and are shown in Table 5.1.
Table 5.1 States of the linear model
Physical variable
x axis position of the vehicle
y axis position of the vehicle
Angle of the wheel axis from the x axis
Left wheel angle
Right wheel angle
Left wheel velocity
Right wheel velocity
Platform angle
Platform angular velocity
User angle
User angular velocity
Motor angle
Motor angular velocity
[ 3.1]
This reduced representation is not stable because it has one pole in the right
semi-plane (Figure 5.6), but it is controllable (and stabilizable) and observable
(and detectable). This representation is more convenient because a controller and
observers could be used. The dominant poles of the system remain the same so the
behavior was expected to be similar.
Controller Simulations
Figure 5.9 Output response when the platform has 0.1rad initial angle
The second test simulated the behavior during a regular ride; the user stays
tilted to the front for the first four seconds of simulation and then straightens. The
angle of the user causes an increase in the platform angle and a positive velocity
of the wheels while the user is tilted. When the user straightens the system
recuperates until the vehicle stops (Figure 5.10). This is the expected behavior for
a forward movement of the vehicle when the user is driving it.
The wheel velocity calculator was programmed in the control unit and tested
using a square wave input. The measurements were highly affected by noise
having up to 5rad/s variations when the wheel velocity was constant. It was
necessary to filter the signal in order to get a smoother input for the controller.
The wheel velocity signal was passed through three exponentially weighted
moving average filters with different values of N. Figure 5.11 shows the
performance of the programmed filters. The filters introduce a delay on the signal,
so the selection of the parameter N was a compromise between smoothness of the
response and its velocity. The chosen filter has N=10 and provides a smooth
response with a 0.2s delay.
Figure 5.11 Exponentially weighted moving average filter response for different N
Platform Estimators
Complementary Filter
The complementary filter was programmed in the control unit. The test was to tilt
and move the platform of the vehicle and register the inputs and outputs of the
complementary filter. Figure 5.12a shows the measurements of the accelerometer.
During the last seconds of the test the platform was horizontally accelerated
producing noise in the accelerometer. The gyroscope signal (Figure 5.12b) is
affected by the time variant offset (drift). At the beginning of the test its value in
steady state is zero, and a hundred seconds later this value has increased to
The programmed complementary filter output is presented together with a
simulated output in Figure 5.12c. In both cases the complementary filter removes
the high frequency noise in the accelerometer signal and the effect of the gyro
drift in the output angle.
Kalman Filter:
Kalman estimator state space in continuous time:
The sampled system was programmed in the control unit and tested in a
similar experiment as the one carried out for the complementary filter. Figure
5.13a and Figure 5.13b show the accelerometer angle and gyro angular velocity.
The most important feature of the Kalman filter is the gyro drift estimation. In
order to test this feature, the data was taken several minutes after the moment the
filter started to act giving time enough for the drift to reach 2rad/s.
The outputs are presented in pairs, the actual output from the control signal
and a simulated output given real inputs. Figure 5.13c shows the estimated drift
signal, the signal mimics the offset in the gyro signal. Figure 5.13d shows the
estimated platform angle, the effects of the accelerometer noise and gyro drift are
removed in the same way as the complementary filter.
The simulated outputs take about 5s to converge to the actual values of the
estimated signals, this happened because the filter had zero initial conditions. In
the actual filter the convergence time is smaller because the drift tends to be a near
zero value, taking less time for the output to converge.
The estimated drift value is subtracted from the value of the angular velocity
of the platform in order to get a proper measurement of the state, the Kalman filter
is an improved solution compared to the complementary filter since it provides
estimated outputs from both states (angle and angular velocity).
The controller and estimators codes were automatically generated by Dymola. The
C codes were analyzed and modified in order to fit the programming requirements
of the compiler and microcontroller.
Two files were generated for each estimator and two files for the controller code;
the first file contains the variable declarations and the second file contains the
equations. The declarations file is divided in two blocks, first a definition of the
type variables is made and then the declarations are presented. The type
definitions must be changed depending on the compiler used, in this case the
int_16 and int_32 types had to be modified as shown in Table 5.2, the int_64 type
was removed as such a large variable was not needed in the program. The second
block of the declarations file contains the declared variables with a detailed
comment which contains the real value of the variable and the Q representation
used, this makes easier the evaluation and reading of the code; automatically
generated declarations for the controller coefficients are shown in Table 5.3.
Table 5.2 Type definitions in automatically generated code
a) Type definitions for fixed-point data types generated by Dymola
#ifndef DYMOLA_FP_TYPES
#define DYMOLA_FP_TYPES
char bool_8;
char int_8;
short int int_16;
int int_32;
typedef long long int int_64;
b) Type definitions for fixed-point data types modified
/* Type definitions for fixedpoint data types */
#ifndef DYMOLA_FP_TYPES
#define DYMOLA_FP_TYPES
char bool_8;
char int_8;
short int_16;
long int_32;
The equations file is typically divided in four blocks, first the input
interfaces are called, then the calculations are performed, next the output
interfaces are called and finally the variables are updated. The interfaces calls are
mapped to the CommunicateReal block configuration depending on if a from port
or to port communication type is selected. Table 5.4 shows the file structure in the
controller case, first the three states are accessed via the get_State interfaces, then
the control signal is calculated, the control signal is applied to the motors via
set_pwm interface and finally a filter variable is updated.
Table 5.4 Equations file structure, input interfaces, calculations, output interfaces,
variables updating
Dymola equations file structure
/* wheel_velocity.y =
Segway.ExternalC.Wheels.get_StateWheelVel(time); */
wheelx_0velocity_y_FP = (get_StateWheelVel());
/* platform_angle.y =
Segway.ExternalC.Platform.get_StateTilt(time); */
platformx_0angle_y_FP = (get_StateTilt());
/* platform_velocity.y =
platformx_0velocity_y_FP = (get_StatePlatformVel());
/* Control_signal.toPort.dummy =
Segway.ExternalC.Motor.set_pwm(integer(Control_signal.u), time);*/
/* Update pre variables */
PREcontroller_Sum_FP = controller_Sum_FP;
It was important to check the generated code for failures in the fixed-point
implementation. Two recurrent changes had to be made in all generated codes.
It is typical to get divisions by powers of two when fixed-point arithmetic is
performed. In the particular case of Atmega32, divisions are not included in the
instruction set, therefore they need to be emulated; in order to avoid that, all the
divisions in the generated code were replaced with right shifts (this should be also
handled by the compiler). Dymola does not consider overflow in the intermediate
results of the multiplication so it was necessary to add 32-bit variable casting for
multiplications and right shifts. A modified code example is shown in Table 5.5.
Dymola does not consider overflow of the variables either. This is not a
problem if the user has full knowledge of the system and had made an appropriate
selection of the range attributes and fixed-point annotations for each variable; but
if that is not the case, the generated code would not handle overflows causing an
erroneous and potentially dangerous behavior of the vehicle if the actual signals or
variables exceed the range set by the user.
Ride Experiments
A total of four different codes were tested: one manually generated fixed-point
code using a complementary filter as platform estimator, one using a Kalman filter
and one automatically generated replica of each.
The codes were tested establishing a simple routine followed by the driver. The
experiment was carried out over a period of 60 seconds, in which the rider had to
remain still for 10 seconds, then drive forward for 10 more seconds, stop and
remain still the next 10 seconds, drive backwards for another 10 seconds and
finally stop.
Figure 5.14 and Figure 5.15 show the complementary filter results. The peak
wheel velocity at the time interval between and is lower
in the case of the automatically generated code, , compared to
during the manually generated code test. This could be considered at first as a
fault in the program, but the actual explanation is that the user does not
necessarily lean at the same angle every time.
The actual performance can be evaluated observing the signal at the instants
when the rider leans to slow down or stops the vehicle (around 17s and 40s). At
these points the wheel velocity drops to zero (the vehicle stops) caused by the
decrease (or increase if the rider is moving backwards) of the control signal.
In the case of the platform angular velocity it is possible to note that it
oscillates around the zero value while the platform is not experimenting abrupt
angle changes, but it reaches peak values during the sudden brakes since the
control signal has sharp changes.
effect in both the platform angle and the platform velocity, therefore the ride
experience is similar at all times making the learning process easier.
When a comparison is made between the generated codes results and the
manual code results, no differences were found, either at signal analysis or at the
ride experience analysis.
The results were satisfactory from an experimental point of view, the
estimators and controller achieve the control objective and it was verified that the
automatic code generation by Dymola manages to be as accurate as the manual
fixed-point coding.
Figure 5.19 Gain matrix K bumpless transfer from remote control mode to rider
onboard mode. a) K1 bumpless transfer; b) K2 bumpless transfer; c) K3 bumpless
7. References
[1] Modelica Association (2010). A Unified Object-Oriented Language for
Physical Systems Modeling Language Specification Version 3.2 March 24, 2010.
https://www.modelica.org/documents/ModelicaSpec32.pdf. Accessed on January
24th, 2011.
[2] Dassault Systmes AB (2010). Dymola (Dynamic Modeling Laboratory).
User Manual-Volume 1. Lund, Sweden, pp. (11-133).
[3] Modelica Association (2011). Modelica Tools. Linkping, Sweden.
Available online: https://www.modelica.org/tools. Accessed on January 24th,
[4] Dassault Systmes (2011). Dymola. France. Available online:
http://www.3ds.com/products/catia/portfolio/dymola. Accessed on January 28th,
[5] Peter Fritzson (2003). Principles of Object-Oriented Modeling and
Simulation with Modelica 2.1. Linkping, Sweden, pp. (587-614)
[6] Dassault Systmes AB (2010). Dymola Version 7.4. Lund, Sweden.
Available online: http://www.3ds.com/products/catia/portfolio/dymola. Accessed
on January 28th, 2011.
[7] Marcus Baur et al. Modelica Libraries for Linear control Systems. Modelica
seventh conference, Como, Italy (Sep 20-22, 2009), pp. (593-602).
[8] Hilding Elmqvist et al. Modelica for Embedded Systems. Modelica seventh
conference, Como, Italia (Sep 20-22, 2009), pp. (354-363).
[9] Johan kesson et al. Dymola and Modelica_EmbeddedSystems in TeachingExperiences from a Project Course. Modelica seventh conference, Como, Italia
(Sep 20-22, 2009), pp. (603-611).
[10] Vahid, F. y Givargis, T. (2002) Embeded Systems Design: A Unified
Hardware/Software Introduction. Wiley, USA. First Edition, pp.(1-4)
[11] Stankovi, J. Real-Time and Embedded Systems ACM Computer Surveys,
Vol. 28, No.1, Mar. 1996, pp 205-208.
[12] Goher, M. y Tokhi, M. Modeling and Control of a two Wheeled Machine: a
Genetic Algorithm-Based Optimization Approach. Cyber Journals:
Multidisciplinary Journals in Science and Technology, Journal selected Areas in
Robotics and Control (JSRC). December 2010.
[18] Chris Krohne. Elektor Wheelie The electronics behind a rather special kind
of vehicle. Elektor Magazine 7-8/2009, pp. (66-71).
[19] EngineersGarage (2011). AVR Microcontroller. Available online:
January 25th, 2011.
[20] Kuo, B. (1996) Sistemas de Control Automtico, Prentice Hall, Mexico.
Seventh edition, pp. (226-228).
[21] Hendricks, E. et al (2008) Linear Systems Control, Deterministics and
Stochastic Methods, Springer, Berlin, Germany, pp. (9-25).
[22] Glad, T. y Ljung, L. (2000) Control Theory, Multivariable and Nonlinear
Methods, Taylor & Francis, England, pp. (233-276).
[23] Ogata, K. (2002) Modern Control Engineering, Prentice Hall, USA. Fourth
edition, pp. (897-904).
[24] Oberstar, E. (2007) Fixed-point Representation & Fractional Math,
20Fractional%20Math.pdf. Accessed on February 13th, 2011.
[25] rzn, K. (2009) Real-Time Control Systems, Department of Automatic
Control Lund University, Sweden, pp. (206-210).
[26] Smith, S. (1999) The Scientist and Engineers Guide to Digital Signal
Processing, California Technical Publishing, USA. Second Edition, pp. (277284).
[27] Seborg, D., et al. (2004) Process Dynamics and Control. Wiley, USA.
Second Edition, pp. (316-319).
[28] Bernard Favre-Bulle (2005). Robot Motion Trajectory-Measurement with
Linear Inertial Sensors. Cutting Edge Robotics, Germany, pp. (127-128).
[29] Gaydou David et al (2011). Filtro complementario para estimacin de
actitud aplicado al controlador embebido de un cuatrirrotor. Centro de
Investigacin en Informtica para la Ingeniera, Universidad Tecnolgica
Nacional, Facultad Regional Crdoba, Argentina, pp. (3-5).
[30] Walter T. Higgins, Jr. (1975). A Comparison of Complementary and
Kalman Filtering. IEEE Transactions on aerospace and electronic systems.
Arizona State University, USA, pp. (321-322).
[31] Ljung, L. (1987) System Identification: Theory for the User, Prentice Hall,
USA. First Edition, pp. (226-228).
[32] Lpez, M. (2007) Identificacin de Sistemas. Aplicacin al Modelado de un
Motor de Contnua, Universidad de Alcal, Departamento de Electrnica.
sicuatrirrotor.googlecode.com/svn/trunk/Documentacion/Identif.pdf. Consulted on
February 15th, 2011.
[33] Shane Colton (2007). The Balance Filter: A Simple Solution for Integrating
Accelerometer and Gyroscope Measurements for a Balancing Platform. MIT
University, USA. Available online: http://web.mit.edu/scolton/www/filter.pdf.
Accessed on January 30th, 2011.
8. Appendix
A. Elektor Wheelie Appearance
Table 8.15 Modelica communication block and mapping function for set_StateTilt
a) To port block
block set_StateTilt
extends Modelica_EmbeddedSystems.Interfaces.BaseReal.PartialWriteRealToPort(minValue=1, maxValue=1);
Real dummy(min= 0, max = 10);
dummy = Segway.ExternalC.Platform.set_StateTilt(integer(u),time);
end set_StateTilt;
b) set_StateTilt mapping function
function set_StateTilt
input Integer tilt "platform angle";
input Real Time;
output Real dummy;
external "C" set_StateTilt(tilt);
end set_StateTilt;
platformx_0angle_y_FP = (get_StateTilt());
/* platform_velocity.y = Segway.ExternalC.Platform.get_StatePlatformVel(time);
platformx_0velocity_y_FP = (get_StatePlatformVel());
/* controller.Control1 = controller.K1*wheel_velocity.y+controller.K2*
platform_angle.y+controller.K3*platform_velocity.y; */
controller_Control1_FP = ((((((long)controller_K1_FP * ((long)wheelx_0velocity_y_FP << 1))
>> 1) + ((((long)controller_K2_FP << 2) * ((long)platformx_0angle_y_FP << 1)) >> 4)) + (((
(long)controller_K3_FP << 1) * (long)platformx_0velocity_y_FP) >> 3))) >> 18;
/* controller.Sum = controller.K1maf*pre(controller.Sum)+controller.Control1; */
controller_Sum_FP = ((((long)controller_K1maf_FP * ((long)PREcontroller_Sum_FP << 1)) + (
(long)controller_Control1_FP << 16))) >> 16;
/* controller.Maf = controller.Sum*controller.K2maf; */
controller_Maf_FP = ((((long)controller_Sum_FP << 2) * ((long)controller_K2maf_FP << 1))) >>
/* Control_signal.u = controller.Maf; */
Controlx_0signal_u_FP = controller_Maf_FP;
/* Control_signal.toPort.dummy = Segway.ExternalC.Motor.set_pwm(integer(
Control_signal.u), time); */
/* Update pre variables */
PREcontroller_Sum_FP = controller_Sum_FP;
Table 8.21 Automatically generated code for platform estimator task with
complementary filter
a) Declarations
/* output Modelica.Blocks.Interfaces.RealOutput ADCAdxl.y(min = 0.0, max =
1023.0) annotation(fixedpoint(bits = 0.0)); */
int_16 ADCAdxl_y_FP = 0;
/* output Modelica.Blocks.Interfaces.RealOutput ADCGyro.y(min = 0.0, max =
1023.0) annotation(fixedpoint(bits = 0.0)); */
int_16 ADCGyro_y_FP = 0;
/* discrete Real platform_Angle_Velocity.gyro_angvel(min = -4.0, max = 3.0)
annotation(fixedpoint(bits = 13.0)); */
int_16 platformx_0Anglex_0Velocity_gyrox_0angvel_FP = 0; /* Q[3, 13] */
/* discrete Real platform_Angle_Velocity.sum_gyro(min = -64.0, max = 63.0)
annotation(fixedpoint(bits = 9.0)); */
int_16 platformx_0Anglex_0Velocity_sumx_0gyro_FP = 0; /* Q[7, 9] */
/* discrete Real platform_Angle_Velocity.gyro_angvel_maf(min = -4.0, max = 3.0)
annotation(fixedpoint(bits = 13.0)); */
int_16 platformx_0Anglex_0Velocity_gyrox_0angvelx_0maf_FP = 0; /* Q[3, 13] */
/* input Modelica.Blocks.Interfaces.RealInput StatePlatformVel.u(min = -4.0,
max = 4.0) annotation(fixedpoint(bits = 13.0)); */
int_16 StatePlatformVel_u_FP = 0; /* Q[3, 13] Derived: max = 3.0 */
/* discrete Real platform_Angle_Velocity.adxl_angle(min = -1.0, max = 1.0)
annotation(fixedpoint(bits = 14.0)); */
int_16 platformx_0Anglex_0Velocity_adxlx_0angle_FP = 0; /* Q[1, 14] */
/* discrete Real platform_Angle_Velocity.gyro_angle(min = -1.0, max = 1.0)
annotation(fixedpoint(bits = 14.0)); */
int_16 platformx_0Anglex_0Velocity_gyrox_0angle_FP = 0; /* Q[1, 14] */
/* discrete Real platform_Angle_Velocity.tilt(min = -1.0, max = 1.0)
annotation(fixedpoint(bits = 14.0)); */
int_16 platformx_0Anglex_0Velocity_tilt_FP = 0; /* Q[1, 14] */
/* input Modelica.Blocks.Interfaces.RealInput StatePlatformTilt.u(min = -2.0,
max = 2.0) annotation(fixedpoint(bits = 14.0)); */
int_16 StatePlatformTilt_u_FP = 0; /* Q[1, 14] Derived: min = -1.0, max = 1.0 */
/* parameter Integer ADCAdxl.fromPort.n = 3 */
int_8 ADCAdxl_fromPort_n_FP = 3;
/* Q[3, 0] Derived: min = -6.0, max = 6.0 */
/* parameter Integer ADCGyro.fromPort.n = 5 */
int_8 ADCGyro_fromPort_n_FP = 5;
/* Q[4, 0] Derived: min = -10.0, max = 10.0 */
/* parameter Real platform_Angle_Velocity.K1cf(min = 0.0, max = 0.1) = 0.02
annotation(fixedpoint(bits = 15.0)); */
int_16 platformx_0Anglex_0Velocity_K1cf_FP = 655;
/* parameter Real platform_Angle_Velocity.K1maf(min = 0.0, max = 1.0) = 0.9
annotation(fixedpoint(bits = 15.0)); */
int_16 platformx_0Anglex_0Velocity_K1maf_FP = 29491; /* Q[1, 15] */
/* parameter Real platform_Angle_Velocity.K2cf(min = 0.0, max = 1.0) = 0.98
annotation(fixedpoint(bits = 15.0)); */
Table 8.22 Automatically generated code for platform estimator task with Kalman
a) Declarations
/* output Modelica.Blocks.Interfaces.RealOutput ADCAdxl.y(min = 0.0, max = 1023.0)
annotation(fixedpoint(bits = 0.0)); */
int_16 ADCAdxl_y_FP = 0;
/* output Modelica.Blocks.Interfaces.RealOutput ADCGyro.y(min = 0.0, max = 1023.0)
annotation(fixedpoint(bits = 0.0)); */
int_16 ADCGyro_y_FP = 0;
/* discrete Real plat_Ang_Vel_KF.gyro_angvel(min = -4.0, max = 3.0)
annotation(fixedpoint(bits = 13.0)); */
int_16 platx_0Angx_0Velx_0KF_gyrox_0angvel_FP = 0;
/* discrete Real plat_Ang_Vel_KF.sum_gyro(min = -64.0, max = 63.0)
annotation(fixedpoint(bits = 9.0)); */
int_16 platx_0Angx_0Velx_0KF_sumx_0gyro_FP = 0;
/* discrete Real plat_Ang_Vel_KF.gyro_angvel_maf(min = -4.0, max = 3.0)
annotation(fixedpoint(bits = 13.0)); */
int_16 platx_0Angx_0Velx_0KF_gyrox_0angvelx_0maf_FP = 0;
/* discrete Real plat_Ang_Vel_KF.adxl_angle(min = -1.0, max = 1.0)
annotation(fixedpoint(bits = 14.0)); */
int_16 platx_0Angx_0Velx_0KF_adxlx_0angle_FP = 0;
/* discrete Real plat_Ang_Vel_KF.drift(min = -4.0, max = 3.0) annotation(fixedpoint
(bits = 13.0)); */
int_16 platx_0Angx_0Velx_0KF_drift_FP = 0;
/* discrete Real plat_Ang_Vel_KF.gyro_angvel_new(min = -4.0, max = 3.0)
annotation(fixedpoint(bits = 13.0)); */
int_16 platx_0Angx_0Velx_0KF_gyrox_0angvelx_0new_FP = 0;
/* input Modelica.Blocks.Interfaces.RealInput StatePlatformVel.u(min = -4.0,
max = 4.0) annotation(fixedpoint(bits = 13.0)); */
int_16 StatePlatformVel_u_FP = 0; /* Q[3, 13] Derived: max = 3.0 */
/* discrete Real plat_Ang_Vel_KF.tilt(min = -1.0, max = 1.0) annotation(fixedpoint(
bits = 14.0)); */
int_16 platx_0Angx_0Velx_0KF_tilt_FP = 0;
/* input Modelica.Blocks.Interfaces.RealInput StatePlatformTilt.u(min = -2.0,
max = 2.0) annotation(fixedpoint(bits = 14.0)); */
int_16 StatePlatformTilt_u_FP = 0; /* Q[1, 14] Derived: min = -1.0, max = 1.0 */
/* parameter Integer ADCAdxl.fromPort.n = 3 */
int_8 ADCAdxl_fromPort_n_FP = 3;
/* Q[3, 0] Derived: min = -6.0, max = 6.0 */
/* parameter Integer ADCGyro.fromPort.n = 5 */
int_8 ADCGyro_fromPort_n_FP = 5;
/* Q[4, 0] Derived: min = -10.0, max = 10.0 */
/* parameter Real plat_Ang_Vel_KF.K1maf(min = 0.0, max = 1.0) = 0.9
annotation(fixedpoint(bits = 15.0)); */
int_16 platx_0Angx_0Velx_0KF_K1maf_FP = 29491;
/* parameter Real plat_Ang_Vel_KF.K2maf(min = 0.0, max = 0.2) = 0.1
annotation(fixedpoint(bits = 15.0)); */
/* wheelVel2_1.RightDiff = wheelVel2_1.RightAng-pre(wheelVel2_1.RightAng); */
wheelVel2x_01_RightDiff_FP = ((long)wheelVel2x_01_RightAng_FP (long)PREwheelVel2x_01_RightAng_FP);
/* wheelVel2_1.RightDiff2 = (if wheelVel2_1.RightDiff < 0 and RightWheelDir.y < 1
then (if wheelVel2_1.RightDiff < -0.087 then wheelVel2_1.RightDiff+
6.28318530717959 else 0) else (if wheelVel2_1.RightDiff > 0 and
RightWheelDir.y > 0 then (if wheelVel2_1.RightDiff > 0.087 then
wheelVel2_1.RightDiff-6.28318530717959 else 0) else wheelVel2_1.RightDiff));
wheelVel2x_01_RightDiff2_FP = (((((wheelVel2x_01_RightDiff_FP < (0 << 12)) && (
RightWheelDir_y_FP < 1))) ? (((wheelVel2x_01_RightDiff_FP < (-23 << 4)) ? (
wheelVel2x_01_RightDiff_FP + (1608 << 4)) : (0 << 12))) : (((((
wheelVel2x_01_RightDiff_FP > (0 << 12)) && (RightWheelDir_y_FP > 0))) ? (((
wheelVel2x_01_RightDiff_FP > (22 << 4)) ? (wheelVel2x_01_RightDiff_FP - (1608
<< 4)) : (0 << 12))) : wheelVel2x_01_RightDiff_FP))));
/* wheelVel2_1.RightVel = wheelVel2_1.RightDiff2*200; */
wheelVel2x_01_RightVel_FP = (((long)wheelVel2x_01_RightDiff2_FP * 200)) >> 4;
/* wheelVel2_1.RightVel2 = (if wheelVel2_1.RightVel < -127 or wheelVel2_1.RightVel
> 127 then 0 else wheelVel2_1.RightVel); */
wheelVel2x_01_RightVel2_FP = (((((wheelVel2x_01_RightVel_FP < (-127 << 8)) || (
wheelVel2x_01_RightVel_FP > (127 << 8)))) ? (0 << 8) : wheelVel2x_01_RightVel_FP));
/* wheelVel2_1.RightSum = 0.9*pre(wheelVel2_1.RightSum)+wheelVel2_1.RightVel2;
wheelVel2x_01_RightSum_FP = (((230 * (long)PREwheelVel2x_01_RightSum_FP) + (
(long)wheelVel2x_01_RightVel2_FP << 5))) >> 8;
/* wheelVel2_1.RightMaf = wheelVel2_1.RightSum*0.1; */
wheelVel2x_01_RightMaf_FP = (((long)wheelVel2x_01_RightSum_FP * 25)) >> 5;
/* wheelVel2_1.LeftAng = 0.00717258596709998*(ADCLeftEncoder.y-546); */
wheelVel2x_01_LeftAng_FP = ((1 * ((long)ADCLeftEncoder_y_FP - 546))) << 4;
/* wheelVel2_1.LeftDiff = wheelVel2_1.LeftAng-pre(wheelVel2_1.LeftAng); */
wheelVel2x_01_LeftDiff_FP = ((long)wheelVel2x_01_LeftAng_FP (long)PREwheelVel2x_01_LeftAng_FP);
/* wheelVel2_1.LeftDiff2 = (if wheelVel2_1.LeftDiff < 0 and LeftWheelDir.y < 1
then (if wheelVel2_1.LeftDiff < -0.087 then wheelVel2_1.LeftDiff+
6.28318530717959 else 0) else (if wheelVel2_1.LeftDiff > 0 and LeftWheelDir.y
> 0 then (if wheelVel2_1.LeftDiff > 0.087 then wheelVel2_1.LeftDiff6.28318530717959 else 0) else wheelVel2_1.LeftDiff)); */
wheelVel2x_01_LeftDiff2_FP = (((((wheelVel2x_01_LeftDiff_FP < (0 << 12)) && (
LeftWheelDir_y_FP < 1))) ? (((wheelVel2x_01_LeftDiff_FP < (-23 << 4)) ? (
wheelVel2x_01_LeftDiff_FP + (1608 << 4)) : (0 << 12))) : (((((wheelVel2x_01_LeftDiff_FP
> (0 << 12)) && (LeftWheelDir_y_FP > 0))) ? (((wheelVel2x_01_LeftDiff_FP > (22
<< 4)) ? (wheelVel2x_01_LeftDiff_FP - (1608 << 4)) : (0 << 12))) :
/* wheelVel2_1.LeftVel = wheelVel2_1.LeftDiff2*200; */
wheelVel2x_01_LeftVel_FP = (((long)wheelVel2x_01_LeftDiff2_FP * 200)) >> 4;
/* wheelVel2_1.LeftVel2 = (if wheelVel2_1.LeftVel < -127 or wheelVel2_1.LeftVel
> 127 then 0 else wheelVel2_1.LeftVel); */
wheelVel2x_01_LeftVel2_FP = (((((wheelVel2x_01_LeftVel_FP < (-127 << 8)) || (
wheelVel2x_01_LeftVel_FP > (127 << 8)))) ? (0 << 8) : wheelVel2x_01_LeftVel_FP));
/* wheelVel2_1.LeftSum = 0.9*pre(wheelVel2_1.LeftSum)+wheelVel2_1.LeftVel2; */
wheelVel2x_01_LeftSum_FP = (((230 * (long)PREwheelVel2x_01_LeftSum_FP) + (
(long)wheelVel2x_01_LeftVel2_FP << 5))) >> 8;
/* wheelVel2_1.LeftMaf = wheelVel2_1.LeftSum*0.1; */
wheelVel2x_01_LeftMaf_FP = (((long)wheelVel2x_01_LeftSum_FP * 25)) >> 5;
/* StateWheelVel.u = 0.5*(wheelVel2_1.RightMaf+wheelVel2_1.LeftMaf); */
StateWheelVel_u_FP = ((128 * ((long)wheelVel2x_01_RightMaf_FP +
>> 8;
/* StateWheelVel.toPort.dummy = Segway.ExternalC.Wheels.set_StateWheelVel(
integer(StateWheelVel.u), time); */
/* Update pre variables */
PREwheelVel2x_01_RightAng_FP = wheelVel2x_01_RightAng_FP;
PREwheelVel2x_01_RightSum_FP = wheelVel2x_01_RightSum_FP;
PREwheelVel2x_01_LeftAng_FP = wheelVel2x_01_LeftAng_FP;
PREwheelVel2x_01_LeftSum_FP = wheelVel2x_01_LeftSum_FP;


text:
i find its a great way to find new music. and has a huge list of artists from all over the world. and i find music can be useful in dealing with stress and stuff.
Im Gameover3 on there if anyone wants to add me. I am always looking for new bands to listen too. and hope there are other users on here ^__^
*Edit* http://www.last.fm/home figured i should have inculded a way to get it. and its an online radio. thats free, but has a subscription service. and you can add songs with a Scrobbler. and then it will recommend more artists based on what you already listen to.
Last.Fm Users
1 post • Page 1 of 1
This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.
1 post • Page 1 of 1
Return to "Music and Television (non trans)"
Jump to
- JOINING (Some sections of this forums can only be viewed by registered members inc Chat and Blogs)
- Transgender Zone
- How to Join this Forum
- News
- Latest News
- Forum Information
- Agony and Advice
- Guest Comment and Agony - All posts need approval after posting please check back later
- Agony (registered users only)
- Live Support!
- Agony Archive
- Guest Area - No registration Necessary - All posts need Mod approval
- Guest Area - No registration Necessary - All posts need Mod approval
- About - Please Read before posting
- Guest Agony and Advice Section
- General Topics
- Social Forum
- General Boards
- General
- General
- Independent UK Gender Identity Clinic User Groups
- Please read before posting
- Charing Cross Gender Identity Clinic
- Charing Cross GIC Stakeholders Group
- Other Clinics
- Media and Entertainment Zone
- Transgender Media and Television
- HollyOaks Transgender Forum
- UK Monthly Transgender Television Log
- Big Brother Forum
- Media Archives
- Podcasting
- Tzone Podcasts
- Literature, Music, Dramatic Arts and Exhibitions
- Medicines, Cosmetic Surgery, Health, Wellbeing, Fitness
- Female Fashion, Beauty and Male Grooming
- Fashion, beauty, grooming hints and tips
- Facial Feminisation Surgey - Female Feminization Surgery (FFS)
- Health and Fitness
- Medicine and Prescriptions
- De-Transition
- So you want to change back?
- Research
- Research Requests and Discussion
- Support Groups
- Rules and Information - Please read
- Beaumont Society
- Sanctuary Stoke
- Tzone Skype Friends - TZonevsg - All welcome
- Visit Our Virtual Support Group Site!
- Information and FAQ
- Discussion
- Show Notes
- VLOG - Video Log - Watch Now!
- Your Group could be here - apply now!
- Social
- Social Forums
- Social Chit Chat
- Friends and Family, Partners and Significant Others
- Friends and Family Forum
- Hobbies and Interests
- Hobbies and Interests
- Home and Garden (inc pets,DIY,cooking, Cars and Vehicles etc)
- Humour and Jokes
- Music and Television (non trans)
- Outdoors (inc pursuits, sports and exercise)
- Poetry
- Technology and Gadgets (inc computer support and net advice)
- Tzoneteam Bios
- Biographies
- More Information
- Kent Trans Forum
- Avon Trans Women - Bristol Transgender Support
- Classifieds
- Classifieds Private Advertisments For Forum Members
- Freebies - Free Stuff!
- For Sale
- Promotions and Discount Codes
- Newsletter
Who is online
Users browsing this forum: No registered users and 3 guests
Privacy Policy | Terms | Advertise |
Link to Us| Contact Us Copyright © 1997-2018,
Transgenderzone.com and Transgender Zone logo.
Powered by phpBB® Forum Software © phpBB Limited
SE Square by PhpBB3 BBCodes
Link to Us| Contact Us Copyright © 1997-2018,
Transgenderzone.com and Transgender Zone logo.
Powered by phpBB® Forum Software © phpBB Limited
SE Square by PhpBB3 BBCodes


text:
Lentil Salad Recipe
Whip up this salad in a flash for a warm, crunchy and herb-infused dish
If you're missing a thing or two, tick the items you need to add to your shopping list.
What to do
Combine dressing ingredients.
1. Pour 1/2 of dressing onto lentils and mix well. Pour lentil mixture over lettuce and pour remaining dressing on top.
2. Eat immediately – the lettuce should be crunchy and the lentils warm.
Related Articles
Leek and broccoli tart recipe
A beautiful, vegetable tart made with olive oil pastry.Read more
Pomegranate slam it smoothie recipe
Pomegranate, an ideal ingredient for a smoothieRead more
Thai peanut noodle salad recipe
Creamy satay flavour and a fresh mix of veggies and noodles.Read more
Chickpea, cucumber and dill salad recipe
Healthy chickpea salad recipeRead more
Satay tofu rice paper rolls recipe
Fresh and crunchy, perfect for a warm night.Read more
Banana breakfast smoothie three ways recipe
Choose your flavour with these delicious smoothies.Read more
Kale, feta and pumpkin pie recipe
Simple kale, feta and pumpkin pie recipeRead more
Raw cacao and cashew chocolate mousse cake recipe
A sugar-free chocolate treat to enjoyRead more


text:
BAP034 Part I of Activities for the Newcomer Classroom with Kenzie Twitchell
MP3•Episode home•Series home•Public Feed
Manage episode 224348457 series 1936596
ByDiscovered by Player FM and our community — copyright is owned by the publisher, not Player FM, and audio streamed directly from their servers.
In this episode Carol takes Kenzie Twitchell through the steps of Language Experience Approach and why it's powerful for ELs.
59 episodes available. A new episode about every 12 days averaging 54 mins duration .


text:
It's summer and we've got lots of great news to start the season! WESTCHESTER COUNTY, NY — June 22, 2019 — Our new Board President Mariquita Blumberg will officially assume her role starting July 1. Westchester County Executive George Latimer congratulated Mariquita on her appointment at our annual meeting on June 4th. "WJCS is one of the largest human service …
Comfort and Pray for Israel's President Reuben Rivlin
By JONATHAN FELDSTEIN
Most people at least recognize the name of Israel's Prime Minister, Benjamin Netanyahu. But few outside Israel know the name of Israel's President, or that Israel even has one. In Israel, the Prime Minister is the head of the government and the president is the head of State. Israel's current, and tenth, President is Reuven (Ruby) Rivlin. He was elected …
By JONATHAN FELDSTEIN
John Bailey, White Plains CitizeNetReporter Publisher/Editor, Michael Edelman, Esq., Political Analyst, Victoria Gearity, Ossining Mayor, Jacqueline Bush, Licensed Clinical Social Worker, and Hezi Aris, Yonkers Tribune Editor-at-Large on Westchester On the Level – Monday, June 3, 2019 @10am EST
Guests and listeners may share their perspective and / or inquiry using the following call-in number: (347) 205-9201. Listen to the broadcast "live" or "on demand" – http://tobtr.com/s/11355533 The broadcast is initiated every Monday to Friday from 10am-12Noon EST. An archive is created by 12:15p EST Topics of discussion are defined herein. WESTCHESTER COUNTY, NY — John Bailey, …
Hon. NYS Assemblyman Nader Sayegh Honoring Richmond Community Services – Sunday, June 2, 2019 From 11am-12:30pm
HONORING RICHMOND COMMUNITY SERVICES 919 NORTH BROADWAY* YONKERS, NY 10701 For Exemplary Service to the yonkers community SUNDAY, JUNE 2nd, 2019 VIP CHAMPAGNE RECEPTION HONORING ED & PAM DINGEE 11:00 – 12:30 PM CELEBRATING OUR DIFFERING ABILITIES agency of the month JUNE 2019 FOR MORE INFORMATION EMAIL firstname.lastname@example.com OR CONTACT ASSEMBLYMAN SAYEGH'S OFFICE * 914 779-8805
A Special Prom for a Special Group of Students
Local Businesses Transform CPW's BRIDGE School at Rye Brook into an Enchanted Forest RYE BROOK, NY—May 29, 2019 — On Wednesday, May 29, 2019, the BRIDGE School at Rye Brook, a division of Cerebral Palsy of Westchester (CPW), hosted its third annual end of the year Prom and Celebratory Luncheon in honor of seven graduating students. The entire school gathered …
The World Responds to Help Children Devastated by Fires in Israel
By JONATHAN FELDSTEIN
Israel needs your prayers, and help. Almost overnight, wildfires broke out, scorching acres, burning dozens of houses including entirely destroying a whole community. Over 3500 people have been evacuated as Israel braces for more. So far. Israel is considering declaring a national emergency due to fear of the spreading of existing and igniting of new fires. Temperatures are expected to …
By JONATHAN FELDSTEIN
Fore! Abilis Announces 1st Annual Sound Therapy Golf Scramble
June 12th Golf Outing to Benefit Individuals with Special Needs GREENWICH, CT — May 20, 2019 — Abilis, a non-profit organization that provides services and supports for more than 700 individuals with special needs and their families, will hold its first annual Sound Therapy Golf Scramble event on Wednesday, June 12, 2019, at the Griffith E. Harris Golf Club in …
Bronxville's Alluring Beauty
By Mayor MARY MARVIN, Esq.
BRONXVILLE, NY — April 30, 2019 — After a winter of concentrating on the new underground infrastructure, the Trustees and I are now focusing on our visible environs. How particularly beautiful they are thanks to the collaborations with our Bronxville Beautification Committee and the Boulder Ledge Garden Club. Con Edison also came through with the new boxwoods on Midland Avenue …
By Mayor MARY MARVIN, Esq.
"News & Notes"
By MARK JEFFERS
BEDFORD, NY, KATONAH, NY , and RIDGEFIELD, CT — April 29, 2019 —Welcome to "News & Notes," where we look at the happenings here in Westchester County… The Triple Crown is huge in horse racing, and in my house as well… my triple crown happens now, with my wife's birthday, Mother's day and our wedding anniversary all happening within two …
By MARK JEFFERS
Kips Bay Boys & Girls Club Choose Upper East Side Town House For 47th Annual Kips Bay Decorator Show House
NEW YORK, NY — April 15, 2019 —The internationally recognized Kips Bay Decorator Show House, hosted by premier youth organization Kips Bay Boys & Girls Club, lands on the Upper East Side and claims 36-38 East 74th Street as its 2019 location. "Every year, we work hard to find an exceptional house that will act as the ideal setting for …
- Page 1 of 2
- 1
- 2


text:
Product description
Luxury, light-weighted tie front cotton dressing gown perfect for spring and summer. Choose from three plain colours to mix and match your night wear.
you may also like
Wanmar Company Warm Luxury Hooded Dressing Gown Housecoat Cotton Soft Bathrobe Robe For Women B071V8ZC35
£57.31 £27.13
Save: 53% off
£80.31 £30.79
Save: 62% off
Multiple Sets Satin Floral Bridal Bridesmaids Robes Dressing Gowns Kimonos White Pink Blue B076GQDVNJ
£161.66 £73.16
Save: 55% off
£88.43 £36.85
Save: 58% off
£92.68 £33.08
Save: 64% off