03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>and</strong> gmclib.h. This was done to simplify the number of files required <strong>for</strong> inclusion by<br />

application programs. Refer to the specific algorithm sections of this document <strong>for</strong> details<br />

on the software Application Programming Interface (API), definitions <strong>and</strong> functionality<br />

provided <strong>for</strong> the individual algorithms.<br />

2.5 Matlab Integration<br />

In addition to the <strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> M<strong>PXR40xx</strong><br />

library modules, the Bit Accurate Models (BAM) are delivered in the installation<br />

package. These models can be used in the Matlab Simulink Toolbox to model the<br />

behavior of each function in real implementation. Each model consists of these three<br />

files:<br />

1. _.BAM (e.g. GFLIB_Acos.BAM): Contains the Bit Accurate Model<br />

(BAM)) which can be included in the user Matlab Simulink model <strong>and</strong> refers to the<br />

S-function C file, <strong>and</strong> the S-function executable file.<br />

2. __SF.c (e.g. GFLIB_Acos_SF.c): The S-function C file that calls a<br />

simple legacy function during the simulation.<br />

3. __SF.mexw32 (e.g. GFLIB_Acos_SF.mexw32): Contains the<br />

compiled MATLAB S-function executable file created from the function C source<br />

file.<br />

All delivered functions are provided with Bit Accurate models in all applicable<br />

implementation versions. The user is thus responsible <strong>for</strong> selecting appropriate version of<br />

the Bit Accurate Model. To include the Bit Accurate Model in the user Simulink model,<br />

simply copy the BAM into the Simulink model. Note that the BAM parameters need to<br />

be properly set up. The structure of the Matlab files delivered with the <strong>Embedded</strong><br />

<strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> M<strong>PXR40xx</strong> is depicted in Figure 2-2.<br />

Figure 2-2. MCLib Matlab file structure<br />

Chapter 2 Introduction<br />

An example of Matlab Simulink model utilizing the <strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong><br />

<strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> M<strong>PXR40xx</strong> Bit Accurate Models is depicted in Figure 2-3. Note<br />

that this schema is <strong>for</strong> the illustration only.<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

Freescale Semiconductor, Inc. 115

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!