| Electronic Components Datasheet Search |
|
AN2388 Datasheet(PDF) 46 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2388 Datasheet(HTML) 46 Page - STMicroelectronics |
|
46 / 54 page ![]() Software design AN2388 46/54 The theoretical background explanations have already been handled and assuming that the current model equations can be discretized as follows: Take into consideration that all variables are in q1.15 format. In the above equations, appear two constants: where = sampling time=PWM period In the following code the constants are converted in the new numerical form: void Calc_theta(void) { mul_q15_q15_q31(K_incr, q_Flux_Speed,&Theta_cm_tmp); Teta_cm_new = (short)(Teta_cm_tmp>>16); Theta_cm = Theta_cm+Theta_cm_new; Theta_cm=Theta_cm+q_Mechanical_Rotor_Angle; //Rotor Flux Angle Theta_cm=Theta_cm+q_Mechanical_Rotor_Position } ************************************************************************************ **************************End Calc Teta calculation* ************************************************************************************ ************************ 4.6.4 Generation of sine and cosine values In order to generate sine and cosine values, a sine table and indirect addressing mode have been implemented. In order to have the best performance in term of position accuracy and the used memory minimization, this table contains 28=256 values to represent the [0;2π] range. The above computed position (16-bit integer value) therefore needs to be shifted 8 positions to the right. This new position (8-bit integer value) is used as a pointer (Index_Sin or Index_Cos) to access this table. The outputs of the table are the Sin_Teta_cm and Cos_Teta_cm value represented in Q1.15 format. The following figure below shows how the sine value calculation is handled: K K qS qS i i ≈ +1 3 . 2 . 1 1 . ) ( 1 1 1 1 1 1 eq T f eq i i T n f eq i i T T i i k k K k K k K K s b r r mR qs b r k s mR ds r k mR k mR ⋅ ⋅ + = + = − + = + + + + + + ω θ θ ω λ λ r T T , T 3 10 * 89 . 4 671 . 21 176 . 106 − = Ω = = mH R L T r r r f e x T qK f F x mS S T T qK PU b r t PU r r 15 . 1 529 0 5 . 314 * 10 89 . 4 1 1 15 . 1 019 0 89 . 4 4 . 62 3 ⎯→ ⎯ ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ⋅ = = ⎯→ ⎯ ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ = = − ω µ |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |