UG0612: Speed ID IQ PI Controller – User Guide

Speed ID IQ PI Controller
UG0612 User Guide
Table of Contents
Introduction ....................................................................................................................3
Anti-Windup and Initialization ........................................................................................................................ 4
Time Sharing of PI Controller ........................................................................................................................ 4
Hardware Implementation .............................................................................................5
Inputs and Outputs ........................................................................................................................................ 6
Configuration Parameters .............................................................................................................................. 7
Timing Diagram ............................................................................................................................................. 8
Resource Utilization ....................................................................................................................................... 8
List of Changes ..............................................................................................................9
Product Support........................................................................................................... 10
Customer Service ........................................................................................................................................ 10
Customer Technical Support Center ........................................................................................................... 10
Technical Support ........................................................................................................................................ 10
Website ........................................................................................................................................................ 10
Contacting the Customer Technical Support Center ................................................................................... 10
ITAR Technical Support .............................................................................................................................. 11
2
UG0612: Speed ID IQ PI Controller –User Guide
Introduction
PI controller is the widely used closed loop controller for controlling a first order system. The basic functionality of a PI
controller is to make the feedback measurement track the reference input. It does so by controlling its output till the
error between the reference and feedback signals becomes zero.
There are two components that contribute to the output, the proportional term and the integral term, as shown in
Figure 1. The proportional term is only dependent on the instantaneous value of the error signal, whereas the integral
term is dependent on present and previous values of an error.
Reference
error
Output
Kp
Feedback
1
S
Ki
Figure 1 · PI Controller in Continuous Domain
PI controller in the continuous time domain is expressed as:
t
y(t) = Kp ∗ e(t) + Ki ∗ οΏ½ e(t)dt
0
EQ1
Where e (t) = reference (t) – feedback (t) is the error between reference and feedback
y (t) = PI controller output
To implement the PI controller in the digital domain, it has to be discretized. The discretized form of the PI controller
based on zero order hold method is, as shown in Figure 2.
Reference
error
Output
Kp
Feedback
Ki
Ts
1
Z
Figure 2 · PI Controller based on Zero Order Hold Method
Where P (n) = Proportional term output
𝑃𝑃(𝑛𝑛) = 𝐾𝐾𝐾𝐾 ∗ 𝑒𝑒(𝑛𝑛)
𝐼𝐼(𝑛𝑛) = 𝐾𝐾𝐾𝐾 ∗ 𝑇𝑇𝑇𝑇 ∗ 𝑒𝑒(𝑛𝑛) + 𝐼𝐼(𝑛𝑛 − 1)
π‘Œπ‘Œ(𝑛𝑛) = 𝑃𝑃(𝑛𝑛) + 𝐼𝐼(𝑛𝑛)
EQ2
I (n) = Integral term output
I (n-1) = Previous (buffered) value of Integral output
Ts = Sampling time in discrete domain
UG0612: Speed ID IQ PI Controller –User Guide
3
Introduction
Anti-Windup and Initialization
The PI controller has maximum and minimum limits for its output, so as to keep it within practical values. If a non-zero
error signal persists for a long time, the integral component of the controller keeps increasing and may reach a value
limited by its bit width. This phenomenon is called Integrator windup and has to be avoided to have a proper dynamic
response. The PI controller IP has an automatic anti-windup function, which limits Integrator as soon as the PI
controller reaches saturation.
In certain applications like motor control, it is important to initialize the PI controller to a proper value before enabling
it. Initializing the PI to a good value avoids jerky operation. The IP block has a enable input to enable or disable the PI
controller. If disabled, the output is equal to the unit input and when enabled, the output is the PI computed value.
Time Sharing of PI Controller
In field oriented control (FOC) algorithm, there are three PI controllers for Speed, d-axis current Id, q-axis current Iq.
The input of one PI controller depends on the output of the other PI controller and hence they are executed
sequentially. At any instant, there is only one instance of the PI controller in operation. Hence, instead of using three
individual PI controllers, single PI controller is time shared for Speed, Id and Iq for optimum usage of resources.
The Speed_Id_Iq_PI module allows sharing of the PI controller through the start and done signals for each of Speed,
Id and Iq. The tuning parameters Kp, Ki and minimum and maximum limits of each instance of controller can be
configured independently through corresponding inputs.
4
UG0612: Speed ID IQ PI Controller – User Guide
Hardware Implementation
Figure 3 shows the block diagram of the Speed ID IQ PI Controller.
reset_i
sys_clk_i
speed_en_i
clear_buffer_i
idq_en_i
speed_pi_start_i
id_pi_start_i
iq_pi_start_i
speed_init_i
iq_init_i
id_init_i
speed_pi_done_o
speed_pi_ref_input_i
Id_pi_done_o
speed_pi_act_input_i
speed_pi_kp_i
speed_pi_ki_i
speed_id_iq_pi
Iq_pi_done_o
speed_pi_output_y_o
speed_pi_ymax_i
Id_pi_output_y_o
speed_pi_ymin_i
Iq_pi_output_y_o
id_pi_ref_input_i
id_pi_act_input_i
id_pi_kp_i
id_pi_ki_i
idq_pi_ymax_i
idq_pi_ymin_i
iq_pi_ref_input_i
iq_pi_act_input_i
iq_pi_kp_i
iq_pi_ki_i
Figure 3 · System-Level Block Diagram of Speed ID IQ PI Controller
Note: The Speed ID IQ PI controller executes a PI controller algorithm for three quantities – d-axis current, q-axis
current, and motor speed. The block is designed to minimize the hardware resource utilization. The block allows the
PI controller algorithm to be run for one parameter at a time.
UG0612: Speed ID IQ PI Controller –User Guide
5
Hardware Implementation
Inputs and Outputs
Table 1 shows the input and output ports of the Speed ID IQ PI Controller.
Table 1 · Input and Output Ports of the Speed ID IQ PI Controller
Signal Name
Description
reset_i
Active low synchronous reset signal.
sys_clk_i
System clock.
speed_en_i
Enable signal for speed PI.
When set to 1, normal PI controller operation occurs.
When set to 0 (zero), PI controller output is fixed to the value available at the
speed_init_i input.
clear_buffer_i
Clears internal buffers when the motor stops.
idq_en_i
Enable signal for Id and Iq PI:
When set to 1, normal PI controller operation occurs
When set to 0 (zero), PI controller output is fixed to the value available at the id_init_i
and iq_init_i inputs respectively.
speed_pi_start_i
Start signal for speed PI.
idpi_start_i
Start signal for Id PI.
iqpi_start_i
Start signal for Iq PI.
speed_init_i
Initialization value for speed PI.
iq_init_i
Initialization value for iq PI.
id_init_i
Initialization value for id PI.
speed_pi_ref_input_i
Speed PI reference input.
speed_pi_act_input_i
Speed PI feedback measurement input.
speed_pi_kp_i
Proportional gain (Kp) for Speed PI.
speed_pi_ki_i
Integral gain (Ki) for Speed PI.
speed_pi_ymax_i
Saturation limit (upper threshold) of speed PI controller.
speed_pi_ymin_i
Saturation limit (lower threshold) of speed PI controller.
id_pi_ref_input_i
Id PI Reference input.
id_pi_act_input_i
Id PI feedback measurement input.
id_pi_kp_i
Proportional gain (Kp) for Id PI.
id_pi_ki_i
Integral gain (Ki) for Id PI.
idq_pi_ymax_i
Saturation limit (upper threshold) of current PI controller.
idq_pi_ymin_i
Saturation limit (lower threshold) of current PI controller.
iq_pi_ref_input_i
Iq PI Reference input.
iq_pi_act_input_i
Iq PI feedback measurement input.
6
UG0612: Speed ID IQ PI Controller – User Guide
Configuration Parameters
Signal Name
Description
iq_pi_kp_i
Proportional gain (Kp) for Iq PI.
iq_pi_ki_i
Integral gain (Ki) for Iq PI.
idq_pi_ymax_i
Saturation limit (upper threshold) of current PI controller.
idq_pi_ymin_i
Saturation limit (lower threshold) of current PI controller.
speed_pi_done
Indicates Speed PI computation is complete. High for one system clock cycle.
id_pi_done
Indicates Id PI computation is complete. High for one system clock cycle.
iq_pi_done
Indicates Iq PI computation is complete. High for one system clock cycle.
speed_pi_output_y_o
Speed PI computation output.
id_pi_output_y_o
Id PI computation output.
iq_pi_output_y_o
Iq PI computation output.
Configuration Parameters
Table 2 shows the configuration parameters used in the hardware implementation of the Speed ID IQ PI Controller.
These parameters are generic and can be varied based on the application requirement.
Table 2 · Configuration Parameters of the Speed ID IQ PI Controller
Name
Description
g_STD_IO_WIDTH
Defines the bit length of data ports.
g_NO_MCYCLE_PATH
The number of clock delays required before the multiplication product ready signal is
asserted.
UG0612: Speed ID IQ PI Controller –User Guide
7
Hardware Implementation
Timing Diagram
Figure 4 shows the timing diagram of the PI Controller. The following signals correspond to one set of input and
output ports of the Speed ID IQ PI controller.
sys_clk_i
start_i
kp_i
Kp_value
ki_i
Ki_value
ref_input_i
ref_in_1
ref_in_2
act_in_1
act_in_2
act_input_i
done_o
pi_out_1
output_y_o
pi_out_2
Figure 4 · Timing Diagram of the PI Controller
Resource Utilization
®
Speed ID IQ PI Controller is implemented on the SmartFusion 2 system-on-chip (SoC) field programmable gate array
(FPGA) device. Table 3 shows the resource utilization report after synthesis with g_STD_IO_WIDTH value equal to
18.
Table 3 · Resource Utilization of the Speed ID IQ PI Controller
Cell Usage
8
Description
Sequential Elements
485
Combinational Logic
704
MACC
1
RAM1kx18
0
RAM64x18
0
UG0612: Speed ID IQ PI Controller – User Guide
List of Changes
The following table shows important changes made in this document for each revision.
Revision
Changes
Page
Revision 2
(October 2015)
Updated SAR (69696).
NA
Revision 1
(March 2015)
Initial release.
NA
UG0612: Speed ID IQ PI Controller – User Guide
9
Product Support
Product Support
Microsemi SoC Products Group backs its products with various support services, including Customer Service,
Customer Technical Support Center, a website, electronic mail, and worldwide sales offices. This appendix contains
information about contacting Microsemi SoC Products Group and using these support services.
Customer Service
Contact Customer Service for non-technical product support, such as product pricing, product upgrades, update
information, order status, and authorization.
From North America, call 800.262.1060
From the rest of the world, call 650.318.4460
Fax, from anywhere in the world 650. 318.8044
Customer Technical Support Center
Microsemi SoC Products Group staffs its Customer Technical Support Center with highly skilled engineers who can
help answer your hardware, software, and design questions about Microsemi SoC Products. The Customer Technical
Support Center spends a great deal of time creating application notes, answers to common design cycle questions,
documentation of known issues and various FAQs. So, before you contact us, please visit our online resources. It is
very likely we have already answered your questions.
Technical Support
For Microsemi SoC Products Support, visit http://www.microsemi.com/products/fpga-soc/design-support/fpga-socsupport.
Website
You can browse a variety of technical and non-technical information on the Microsemi SoC Products Group home
page, at http://www.microsemi.com/products/fpga-soc/fpga-and-soc.
Contacting the Customer Technical Support Center
Highly skilled engineers staff the Technical Support Center. The Technical Support Center can be contacted by email
or through the Microsemi SoC Products Group website.
Email
You can communicate your technical questions to our email address and receive answers back by email, fax, or
phone. Also, if you have design problems, you can email your design files to receive assistance. We constantly
monitor the email account throughout the day. When sending your request to us, please be sure to include your full
name, company name, and your contact information for efficient processing of your request.
The technical support email address is soc_tech@microsemi.com.
My Cases
Microsemi SoC Products Group customers may submit and track technical cases online by going to My Cases.
10
UG0612: Speed ID IQ PI Controller – User Guide
ITAR Technical Support
Outside the U.S.
Customers needing assistance outside the US time zones can either contact technical support via email
(soc_tech@microsemi.com) or contact a local sales office. Visit About Us for sales office listings and corporate
contacts.
ITAR Technical Support
For technical support on RH and RT FPGAs that are regulated by International Traffic in Arms Regulations (ITAR),
contact us via soc_tech@microsemi.com. Alternatively, within My Cases, select Yes in the ITAR
drop-down list. For a complete list of ITAR-regulated Microsemi FPGAs, visit the ITAR web page.
UG0612: Speed ID IQ PI Controller –User Guide
11
Microsemi Corporation (Nasdaq: MSCC) offers a comprehensive portfolio of semiconductor
and system solutions for communications, defense & security, aerospace and industrial
markets. Products include high-performance and radiation-hardened analog mixed-signal
integrated circuits, FPGAs, SoCs and ASICs; power management products; timing and
synchronization devices and precise time solutions, setting the world’s standard for time; voice
processing devices; RF solutions; discrete components; security technologies and scalable
anti-tamper products; Ethernet solutions; Power-over-Ethernet ICs and midspans; as well as
custom design capabilities and services. Microsemi is headquartered in Aliso Viejo, Calif., and
has approximately 3,600 employees globally. Learn more at www.microsemi.com.
Microsemi Corporate Headquarters
One Enterprise, Aliso Viejo,
CA 92656 USA
Within the USA: +1 (800) 713-4113
Outside the USA: +1 (949) 380-6100
Sales: +1 (949) 380-6136
Fax: +1 (949) 215-4996
E-mail: sales.support@microsemi.com
© 2015 Microsemi Corporation. All
rights reserved. Microsemi and the
Microsemi logo are trademarks of
Microsemi Corporation. All other
trademarks and service marks are the
property of their respective owners.
Microsemi makes no warranty, representation, or guarantee regarding the information contained herein or
the suitability of its products and services for any particular purpose, nor does Microsemi assume any
liability whatsoever arising out of the application or use of any product or circuit. The products sold
hereunder and any other products sold by Microsemi have been subject to limited testing and should not
be used in conjunction with mission-critical equipment or applications. Any performance specifications are
believed to be reliable but are not verified, and Buyer must conduct and complete all performance and
other testing of the products, alone and together with, or installed in, any end-products. Buyer shall not
rely on any data and performance specifications or parameters provided by Microsemi. It is the Buyer’s
responsibility to independently determine suitability of any products and to test and verify the same. The
information provided by Microsemi hereunder is provided “as is, where is” and with all faults, and the
entire risk associated with such information is entirely with the Buyer. Microsemi does not grant, explicitly
or implicitly, to any party any patent rights, licenses, or any other IP rights, whether with regard to such
information itself or anything described by such information. Information provided in this document is
proprietary to Microsemi, and Microsemi reserves the right to make any changes to the information in this
document or to any products and services at any time without notice.
50200612-2/10.15