21.01.2014 Views

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Source <strong>Co</strong>de<br />

Source <strong>Co</strong>de Files<br />

/*****************************************************************************\<br />

* SINT16 PI_<strong>Co</strong>ntroller (void): This subroutines contains the PI controller *<br />

* implementation. *<br />

* *<br />

* Parameters: None. *<br />

* *<br />

* Return: SINT16. <strong>Co</strong>ntroller output. *<br />

\*****************************************************************************/<br />

/*<br />

----<br />

| | Mp(K)<br />

---------| Kp |--------<br />

| | | |<br />

--- | ---- | --- -------<br />

R(K) -------| + | E(K) | --| + | M(K) | |<br />

| |--------| | |---------| Plant |--<br />

U(K) ------| - | | --| + | | | |<br />

| --- | ---------- | --- ------- |<br />

| | | Ki | | |<br />

| -------|----------|---- |<br />

| |1 - Z^(-1)| Mi(K) |<br />

| ---------- |<br />

| |<br />

-----------------------------------------------------------------------<br />

E(K) = R(K) - U(K)<br />

Mp(K) = E(K) * Kp<br />

Mi(K) = Mi(K - 1) + E(K) * Ki<br />

M(K) = Mp(K) + Mi(K)<br />

where:<br />

Symbol<br />

Variable Name<br />

E(K):<br />

<strong>Co</strong>ntrolDifference<br />

R(K):<br />

RefSpeed<br />

U(K):<br />

Speed<br />

Mp(K):<br />

P_Portion<br />

Mi(K):<br />

I_Portion<br />

Mi(K - 1): I_PortionK_1<br />

M(K):<br />

<strong>Co</strong>ntrollerOutput<br />

Kp:<br />

P_Gain<br />

Ki:<br />

I_Gain<br />

BLDC Motor <strong>Co</strong>ntrol Board for Industrial and Appliance Applications<br />

DRM007<br />

MOTOROLA Source <strong>Co</strong>de 133

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

Saved successfully!

Ooh no, something went wrong!