| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Vincent ONDE Microcontroller Division Applications Dennis NOLAN Power
Top Searches for this datasheetST92141 MOTOR CONTROL SOFTWARE LIBRARY VERSION UPDATE Vincent ONDE Microcontroller Division Applications Dennis NOLAN Power Supply Applications continuous search improvement, Microcontroller Division STMicroelectronics investigated different ways generating sine waves using ST92141 MCUs. This document presents implementation motor control software from library integration point view. Features this second release ST92141 Motor Control Software Library will discussed, well upgraded characteristics applications based version 1.0. This version dramatically reduces amount memory needed library, while keeping load reasonable level (approximately 15%). also enables designers drive single-phase 2-phase motors using same module interfaces 3-phase motors. Important Note: Toolchain longer upgraded supported (does work with Windows versions above Win98), mandatory start developments with release 2.1.1 higher) software library working with Toolchain. Most issues, software modules function prototype descriptions described this document remain valid. However section 1.4.3 obsolete refers Toolchain. Enhancements upgrade issues related Release 2.1.1 described application note AN1367. Application Note AN1084 "Getting Started with ST92141 Software Library Version 1.0" remains required reading even developments directly based Version 2.1.1. Version 2.1.1 Software Package available internet st92141.htm#soft AN1277/0502 1/16 Table Contents INTRODUCTION UPGRADED CHARACTERISTICS GENERATION METHOD 180° PHASE SHIFT OPERATION INTERRUPTS TASKS MODIFICATION 1.3.1 ZPC_IT 1.3.2 ADT_IT SOURCE FILE MODIFICATIONS 1.4.1 ACMOTOR Module 1.4.1.1 Obsolete Functions 1.4.1.2 Modified Functions 1.4.2 IMCMODUL Module 1.4.2.1 Functions 1.4.3 MAKEFILE File 1.4.4 REGISTER File 1.4.5 SINE.ASM File UPGRADING VERSION APPLICATIONS DIRECT UPGRADE UPGRADE WITH POSSIBLE MINOR CHANGES APPLICATION UPGRADE WITH POSSIBLE MAJOR CHANGES APPLICATION APPENDIX FUNCTIONS DOCUMENTATION INTERRUPT FLOWCHARTS 2/16 ST92141 Motor Control Software Library Version Update UPGRADED CHARACTERISTICS GENERATION METHOD reference, look-up tables were used generate sine wave PWMs version 1.0. main task interrupts obtain duty cycles from these tables load them into dedicated induction motor control peripheral. Sine wave tables were processed background task when necessary flags required interrupts indicate that look-up table(s) been changed. Although this method provides very loads speed, main drawback consumption (around bytes 48step sine tables). Version 2.0, sine waves generated real time during interrupt service routines using 256-step reference sine wave that stored ROM. powerful 8/16-bit architecture ST92141, high frequency internal clock MHz) optimized assembly interrupt routine, load maintained reasonable level. following table summarizes performance changes between versions, assuming frequency (fPWM) 12.218 centred switching patterns. Register Load Frequency Quantification Frequency Range Number steps sine period Version 5652 above Fixed, high speed high speed) Version 5087 constant (theoretical max: fPWM/2)1 Variable, 100% regardless speed (including narrow pulse cancellation capability) Gain Maximum Modulation Note Higher output frequencies produced using higher switching frequencies avoid subharmonic currents generation. spreadsheets that required compute 256-step reference sine wave included with library package, \utility directory: sine.xls, using Excel (2000 Edition) format, sine.13 using Lotus (Version format. 3/16 ST92141 Motor Control Software Library Version Update 180° PHASE SHIFT OPERATION Operations with sine wave phase shifts other than 120° possible. This allow supply single- two-phase motors Uninterruptible Power Supplies (UPS). practice, this done conditional compilation with #define statements IMCParam.h file: #define DEGREES_180 single-phase motors with starting capacitors #define DEGREES_120 Standard 3-phase motors #define DEGREES_90 Two-phase motors phase shifts, both main auxiliary (starting) motor windings connected half-bridges generating sine wave PWMs, their common point being supplied third half-bridge, mains rectification achieved bridge (typically nominal mains voltages approximately VAC), central point rectification capacitors voltage doubler configuration (typically nominal mains voltages approximately VAC). Note: When compiling with #define DEGREES_180, following warning message displayed during make process: imcmodul.c(366): warning: comparison always limited range data type This message generated Direction IMC_GetRotationDirection(void) function which does make sense when generating single-phase voltages (the direction rotation cannot reversed). above function will therefore always return "Direction" type variable equal COUNTERCLOCKWISE_DIRECTION constant. entire contents "gmake" command output stored re-directing this output file rather than screen. Instead "gmake", enter following instruction: gmake out.txt "out.txt" file will contain make process information. 4/16 ST92141 Motor Control Software Library Version Update INTERRUPTS TASKS MODIFICATION ADT_IT ZPC_IT interrupts macrocell used perform different tasks. Nevertheless, most information concerning software time bases described application note AN1084 ("Getting started with ST92141 Software Library Version 1.0") still remain valid. 1.3.1 ZPC_IT Zero Counter (ZPC) interrupt occurs with every cycle. this interrupt routine, duty cycles calculated sine wave generation. Active braking also achieved this routine, using same method described version current injection). This routine been written assembly speed optimization reasons. flowchart this interrupt described appendix (Figure Figure 2.). Duration: 10.5 with clock. 1.3.2 ADT_IT Automatic Data Transfer (ADT) interrupt occurs with every cycle replaces interrupt described version 1.0. This function provides software time base increasing several software timers every with each timer being dedicated particular task. order minimize load, this time base function replaced other timer resources (the Extended Function Timer Standard Timer, used UART) having just interrupt each period. This done easily clearing (ADTE) Interrupt Mask Register (IMR) IMC_Init function. Duration: Average: Maximum: with clock. 5/16 ST92141 Motor Control Software Library Version Update SOURCE FILE MODIFICATIONS Among files delivered with version library, following modules dedicated sine wave generation have been modified ACMOTOR library release. possible impacts these changes previously developed applications listed Section 1.4.1 ACMOTOR Module This module includes following source files (the revision number each individual file also listed): acmotor.c (v2.0), acmotor.h (v1.0), acmparam.h (v1.0). 1.4.1.1 Obsolete Functions following functions longer supported this module: ACM_FreqToPeriod(u16 StatorFrequency); void ACM_SetNewPWMFreq(u16 NewStatorFrequency, NewPeriod); void Calc_rpt_tab(void); (assembly routine) void Calc_sin(void); (assembly routine) These functions were closely linked previous principle sine wave generation obsolete. 1.4.1.2 Modified Functions single function prototype been modified: BOOL ACM_Update_Sine_Tables NewVoltage, NewStatorFrequency); replaced void ACM_Update_Sine_Tables NewVoltage, NewFrequency) longer necessary return Boolean variable indicating this function achieved successfully, since this always true. Nevertheless, following functions have been modified, keep same interface (i.e. functionality maintained care must taken previously delivered source files were re-used project, Section 2.2): void ACM_RampUp(u16 EndFrequency, RampTime) void ACM_SustainSpeed(u16 Time) 6/16 ST92141 Motor Control Software Library Version Update 1.4.2 IMCMODUL Module This module includes following source files (the revision number each individual file also listed): IMCModul.c (v1.0) IMCModul.h (v1.0) IMCParam.h (v1.0) 1.4.2.1 Functions following functions have been created meet requirements generation method maintain certain modularity between IMCMODUL ACMOTOR modules: void IMC_Reset_Brake_Flag(void); void IMC_Set_NeutralOffset(void); void IMC_SetWaveform(WaveForm_t); Direction IMC_GetRotationDirection(void); These functions described Section 3.1. 1.4.3 MAKEFILE File makefile revision number 1.0. This file been modified since assembly file longer needed other than crt9.asm start-up file (the sine.asm file been removed from makefile's "ASM_List" sources list, Section 1.4.5). other files, settings (compiler, assembler linker options) utilities maintained. 1.4.4 REGISTER File Reg_file.h revision number 1.0. mapping registers been modified (approximately half library variables version have been deleted). Registers mapped follows: Register group R15) reserved compiler, Register group (R16 R31) reserved processing interrupt, Register group part group (R32 R53) reserved software library (miscellaneous use, including UART), upper part register file (register group below) still reserved system stack. System stack must carefully monitored during development avoid overlapping with user-defined registers. Assuming system stack bytes (i.e. R223 down R193) used, this provides user-free registers (R54 R192). 7/16 ST92141 Motor Control Software Library Version Update 1.4.5 SINE.ASM File This file previously contained assembly routines used fill tables required sine wave generation. these routines obsolete, this file removed from library files. UPGRADING VERSION APPLICATIONS This chapter divided into sections which should studied depending work performed using version this library: Source code modified functions based example functions delivered with library (such ACM_RampUp, ACM_SustainSpeed) were written. Refer Section 2.1. Some functions were modified functions were written based example functions delivered with library, except sine wave generation routines. Refer Section 2.2. sine wave generation source code modified. Refer Section 2.3. DIRECT UPGRADE order directly upgrade version your application, files listed above (except reg_file.h, acmparam.h IMCParam.h files) must replaced with their corresponding files version 2.0. sine.asm file removed. addition: Registers must re-mapped using reg_file.h baseline (registers user-free), User parameters stored prior versions acmparam.h IMCParam.h files must replaced version. UPGRADE WITH POSSIBLE MINOR CHANGES APPLICATION order directly upgrade version your application with possible minor changes, files listed above (except reg_file.h, acmparam.h IMCParam.h files) must replaced with their corresponding files version 2.0. sine.asm file removed. addition: Registers must re-mapped using reg_file.h baseline (registers user-free), User parameters stored prior versions acmparam.h IMCParam.h files must replaced version. Tests using Boolean variables returned ACM_Update_Sine_Tables must removed applicable code order comply with version this function. This pos- 8/16 ST92141 Motor Control Software Library Version Update sible since updates done (worst case latency being period). update required before interrupt, previous will simply overwritten. functions developed using ACM_RampUp ACM_SustainSpeed functions examples must re-validated. ACM_GetCurrentStatorFreq() function stored beginning module determine starting point ramp stator frequency value sustained, rather than systematically called each time Voltage variable updated Regulation loop. recommend examining source code these functions order have clear idea functions achieved (although there slight changes) compare them functions based examples given version 1.0. UPGRADE WITH POSSIBLE MAJOR CHANGES APPLICATION order directly upgrade version your application with possible major changes, application upgrade must only done functions listed Section 1.4.1.1 being obsolete required, application will greatly benefit from increased performance version 2.0, compared that version 1.0. conditions listed above met, recommendations listed Section must followed. APPENDIX FUNCTIONS DOCUMENTATION prototypes functions listed below have been added IMCModul.h header file. IMC_Reset_Brake_Flag .page IMC_Set_NeutralOffset .page IMC_SetWaveform .page IMC_GetRotationDirection .page With exception IMC_GetRotationDirection function, main purpose these functions setup sine wave generation ACM_Init function. full description provided order give user exhaustive library reference full visibility over source code. 9/16 ST92141 Motor Control Software Library Version Update IMC_Reset_Brake_Flag Synopsis #include "IMCModul.h" void IMC_Reset_Brake_Flag (void); Description this function reset variable needed enable active braking motor. This function required order properly initialize sine wave generation ACM_Init function. also interrupt flowchart Figure Note This function must confused with IMC_Brake_Disable function, which also disables signals dedicated outputs imposing fixed pattern. recommend using IMC_Brake_Disable function rather than IMC_Reset_Brake_Flag disable active braking. 10/16 ST92141 Motor Control Software Library Version Update IMC_Set_NeutralOffset Synopsis #include "IMCModul.h" void IMC_Set_NeutralOffset(void); Description this function neutral point sine waves duty cycle. This function required order properly initialize sine wave generation ACM_Init function. Caution recommend modifying this function unless frequency must modified. This function closely linked CMP0 register setting (defining frequency), where setting inconsistent value will result sine voltage imbalance parasitic current injections. 11/16 ST92141 Motor Control Software Library Version Update IMC_SetWaveform Synopsis #include "IMCModul.h" void IMC_SetWaveform(WaveForm_t); Description During sine wave generation interrupts, values from reference wave form (sine instance) stored data array accessed pointer this array before being computed desired voltage frequency commands. IMC_SetWaveform function sets this pointer base address desired reference waveform. This function required order properly initialize sine wave generation ACM_Init function. Inputs Input value reference wave shape selection "typedef"-ed IMCModul.h: typedef enum PURE_SINE WaveForm_t; This convenient avoid manual entry #define instructions. Although that time there only single type shape available (sine), this could extended easily future include trapezoid shapes, fundamental plus third harmonic sine, etc. Note Default value input range PURE_SINE. 12/16 ST92141 Motor Control Software Library Version Update IMC_GetRotationDirection Synopsis #include "IMCModul.h" Direction IMC_GetRotationDirection(void); Description This function returns current rotation direction (note that this information relative, physical direction being imposed motor phases hardware connections). Returns Output value direction only values "typedef"-ed IMCModul.h: typedef enum CLOCKWISE_DIRECTION, COUNTERCLOCKWISE_DIRECTION Direction; Note explained Section 1.2, warning message will appear when compiling with "#define DEGREES_180" option. 13/16 ST92141 Motor Control Software Library Version Update INTERRUPT FLOWCHARTS Figure Interrupt Overview (Phase Processing 120° Phase Shift) Switch working register group from Group Group Save current page working page brake enabled? Phase duty cycle BrakeDutyCycle command Phase Phase (I.e. side switch this phase switched Process Phase store result Phase Process Phase store result Phase Phase (Phases Reset Interrupt Pending flag Restore current page Restore Compiler working register (Group IRET 14/16 ST92141 Motor Control Software Library Version Update Figure Details Phase Duty Cycle Processing (including Shift Situation) Phase Duty Cycle Integrate frequency command obtain pointer reference sine wave table Phase Processing Obtain sample from table Scale according voltage command Sample from sine's positive half-period? Complement result result close 100%? Prepare true 100% duty cycle result close Prepare true duty cycle result match 10-bit range compare registers Subtract result from Phase offset result Load Compare register macrocell Apply desired phase shift (90°, 120°, 180°) Phase pointer obtain Phase pointer Process Phase same Phase load Compare register macrocell Process Phase load Compare register macrocell: Phase -(Phase Phase 120° 180° phase shift Phase duty cycle phase shift Executed only shift. 15/16 ST92141 Motor Control Software Library Version Update PRESENT NOTE WHICH GUIDANCE ONLY AIMS PROVIDING CUSTOMERS WITH INFORMATION REGARDING THEIR PRODUCTS ORDER THEM SAVE TIME. RESULT, STMICROELECTRONICS SHALL HELD LIABLE DIRECT, INDIRECT CONSEQUENTIAL DAMAGES WITH RESPECT CLAIMS ARISING FROM CONTENT SUCH NOTE AND/OR MADE CUSTOMERS INFORMATION CONTAINED HEREIN CONNEXION WITH THEIR PRODUCTS." Information furnished believed accurate reliable. However, STMicroelectronics assumes responsibility consequences such information infringement patents other rights third parties which result from use. license granted implication otherwise under patent patent rights STMicroelectronics. Specifications mentioned this publication subject change without notice. This publication supersedes replaces information previously supplied. STMicroelectronics products authorized critical components life support devices systems without express written approval STMicroelectronics. logo registered trademark STMicroelectronics 2002 STMicroelectronics Rights Reserved. Purchase Components STMicroelectronics conveys license under Philips Patent. Rights these components system granted provided that system conforms Standard Specification defined Philips. STMicroelectronics Group Companies Australia Brazil Canada China Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Singapore Spain Sweden Switzerland United Kingdom U.S.A. http://www.st.com 16/16 Other recent searchesTHS12082 - THS12082 THS12082 Datasheet SUM18N25-165 - SUM18N25-165 SUM18N25-165 Datasheet SS6104 - SS6104 SS6104 Datasheet SK24A - SK24A SK24A Datasheet SK26A - SK26A SK26A Datasheet PD-20046 - PD-20046 PD-20046 Datasheet MPQ7091 - MPQ7091 MPQ7091 Datasheet MNCLC400A-X - MNCLC400A-X MNCLC400A-X Datasheet 2SC5779 - 2SC5779 2SC5779 Datasheet
Privacy Policy | Disclaimer |