|
16-bits fixed-point PID implementations in C 1.0 File ID: 79120 |
---|
|
| 16-bits fixed-point PID implementations in C 1.0 License: Freeware File Size: 20.5 KB Downloads: 60
Submit Rating: |
|
|
|
16-bits fixed-point PID implementations in C 1.0 Description |
---|
Description: The effect of fixed-point arithmetic in 16-bits PID controller C routines on the closed-loop precision is shown in this Simulink model.
Two Simulink blocks that implement single and double precision 16-bits PID C routines are generated with the LCT. The C sources are supplied for user modifications if required.
Controllers work with 16-bits data and coefficients word lengths. Coefficients and data fixed-point numbers have respectively 12-bits and 10-bits fractionnal part.
For a reference step excitation, you will see that the permanent errors for the fixed-point pids do not equal zero. Without rounding (look inside model for rounding mode switching), the single precision pid exibits an error about 8 data lsb when the double precision one is just around 2 lsb. After changing the rounding mode to "nearest", the single precision implementation error falls to 3 lsb !
Look inside the code sources and you will see that the differences are i) the internal controller state is stored in double precision and ii) the downcasts (right shifts) are not done at the same point in the fixed-point computation. License: Freeware Related: switching, modelfor, exibits, Error, Double, about8, inside, rounding, permanent, excitation, errors, forthe, Equal, lsbafter, stored, state, downcastsright, shifts O/S:BSD, Linux, Solaris, Mac OS X File Size: 20.5 KB Downloads: 60
|
|
More Similar Code |
---|
This simulation illustrates the effects of the fixed-point computations on the closed-loop precision for a 16-bits PID controller. The rounding mode, the point where the truncations take place and the format width for the internal variable have a significant action on the closed-loop permanent error.
Three versions of the same PI(D=0) controller are implemented : i) double (floating point), ii) 16 bits...
A fixed point math header-library for C, under a liberal license.
Functions accompanying MATLAB News & Notes article "Fixed-point Signal Processing: Getting Started" by Darel A. Linebarger and Thomas A. Bryan, 2004. The functions include an FIR filter in M that can be run in fixed-point and...
LongDecimal provides a numeric type for fixed point arithmetic, similar to (but with more features) Java's BigDecimal, but different from Ruby's BigDecimal. Such a numeric type allows controlling how rounding is performed, for example for finance...
An essential step in embedded software development, floating- to fixed-point conversion can be tedious, labor-intensive, and error-prone. System engineers frequently design algorithms in floating-point math, usually double-precision. This format...
Demo files used in "Simulink Fixed-Point Tutorial R2008a (Japanese)".
There are challenges to face when programming in fixed-point code manually. Similarly, care is required in automatically generating fixed-point code. The developer must pay attention to design tradeoffs, namely: accuracy, efficiency, ROM, RAM,...
There are challenges to face when programming in fixed-point code manually. Similarly, care is required in automatically generating fixed-point code. The developer must pay attention to design tradeoffs, namely: accuracy, efficiency, ROM, RAM,...
API for User Written Fixed-Point and Floating-Point S-Functions. A supplement to Release 13 of Simulink and Fixed-Point Blockset.
Version 0.9.0 Beta 1 January 8, 2003
Feedback on this beta should be sent to
A beginner's guide to threading in C# is an easy to learn tutorial in which the author discusses about the principles of multi threading, which helps in executing multiple operations at a same time. The author offers details about how the multi... |
User Review for 16-bits fixed-point PID implementations in C |
|