| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
CCU-C504 Block Commutation Mode Revolution Speed Measuring B
Top Searches for this datasheetC500 Family ApNotes CCU-C504 Block Commutation Mode Revolution Speed Measuring Block Commutation Mode brushless Synchronous Motors following application note concerns microcontrollers C500 family with Peripheral Unit Chip which similar SAx-C504-LM SAx-C504-2RM block commutation mode, synchronous generated defined incoming digital signal pattern e.g. hall sensors, which applied INT0-2 inputs, sampled. Each transition INT0-2 inputs results change state outputs according implemented block commutation table unit without using load this operation. Figure1: Synchronous Motor Block Commutation Mode Semiconductor Group Scheibert CCU-C504 Page -1/33/96 C500 Family ApNotes monitoring sensor input signal timing block commutation mode, signal transitions INT0-2 external interrupt inputs also generate interrupt capture event channel CAPCOM unit connection with compare timer With this implemented feature, revolution speed acceleration slow down phases synchronous motor easly recorded. rotor angle motor between generated eletrical hall sensor signals dependent number pairs poles machine. formula given block commutation mode CAPCOM channel automatically configured capture mode. signal transition INT0-2 external inputs generates capture pulse CAPCOM channel independently selected signal transition type rising falling edge.The consequence that 16-bit content former started compare timer captured signal transition INT0-2 corresponding capture registers CCL0 CCH0. calculating actual revolution speed synchronous motor, corresponding external interrupt INT0-2 inputs used capturing actual compare timer values. difference between directly followed 16-bit capture values than defined time base calculation actual revolution speed (regarding number pairs poles machine). difference from directly followed compare timer count values without calculation, practically each external interrupt routine actual capture value saved compare timer restarted with count value 0000H mode Compare timer overflows period value FFFFH allowed have recognized software avoid wrong speed recording. revolution speed measure range restricted following formula parameters: [Hz] int_ period edge number used external interrupt inputs (possible: revolutions second [Hz] (resolution countvalue) resolution compare timer dependent selected input clock prescaler ratio (fosc/2 fosc/256) 0001H minimum count value compare timer rps_max) FFFFH maximum count value compare timer rps_min) number pairs poles rising falling edge sensitive external interrupt input rising falling edge sensitive external interrupt input int_no period resolution countvalue edge Semiconductor Group Scheibert CCU-C504 Page -2/33/96 C500 Family ApNotes following table gives examle range revolution speed measuring dependent fixed parameters edge int_no Compare timer (COMPT1) input clock prescaler ratio variable. COMPT1 input clock fosc/2 fosc/4 fosc/8 fosc/16 fosc/32 fosc/64 fosc/128 fosc/256 period_min (COMPT1) 5x10-8 1x10-7 2x10-7 4x10-7 8x10-7 1.6x10-6 3.2x10-6 6.4x10-6 edge int_no period_max COMPT1 3.28x10-3 6.55x10-3 13.11x10-3 26.21x10-3 52.43x10-3 104.86x10-3 209.72x10-3 419.43x10-3 rps_min [Hz] 50.86 25.43 12.71 6.35 3.18 1.59 0.79 0.40 rps_max (theoretical [Hz] 3.33x108 1.66x107 8.33x106 4.16x106 2.08x106 1.04x106 5.21x105 2.60x104 Table Calculated examples revolution speed measuring shadowed column table with rps_max theoretical calculated maximum frequencies revolution measurement with COMPT1 count value 0001H which practical cannot achieved because restricted performance microcontroller mechanical restrictions motor. column rps_min represents minimim resolution revolution speed measurement with COMPT1 count value FFFFH. optimal parameters have selected according individual application demands. following source code listing example uses edge=2, int_no=1 fosc/256 prescaler ratio dependent used motor). This application example intended moment record revolution speed. there demand recording acceleration slow down phases brushless motor, example extended revolution speed value array which accessed with pointers. Scheibert Appendix: pages source assembler listings Semiconductor Group Scheibert CCU-C504 Page -3/33/96 C500 Family ApNotes COMPILER V5.02, 05/03/96 09:28:02 PAGE COMPILER V5.02, COMPILATION MODULE OBJECT MODULE PLACED RPS.OBJ COMPILER INVOKED C:\C51\BIN\C51.EXE RPS.C PL(100) PW(127) ROM(LARGE) SMALL OT(6,SPEED) stmt level source -file rps.c Copyright 1996 Siemens Klaus Scheibert, 03/04/96 Keil Compiler V5.02 ************************SW Application Note CCU-504 Revolution Speed Measuring Block Commutation Mode brushless Motors fixed parameters: edge int_no prescaler ratio compare timer fosc/256 #pragma DEBUG OBJECTEXTEND CODE #pragma NOLISTINCLUDE #include <reg504.h> #include <intc504.h> #define FOREVER for(;;) special function register declarations C504 interrupt number definition file endless loop command lines directives /*********************** GLOBAL DECLARATION VARIABLES union unsigned capture_reg; unsigned char capture_byte[2]; capture_union; #define capture_low capture_union.capture_byte[1] #define capture_high capture_union.capture_byte[0] #define capture_value capture_union.capture_reg with this union, copie from capture register comparetimer located data available unsigned char unsigned data difference_val; unsigned char data compt1_ov_val; copie cature value done difference_val value used test compare timer overflow PROCEDURES void comp_ini (void) CT1OFH 0x00; CT1OFL 0x00; CCPH 0x0FF; CCPL 0x0FF; COINI 0x0FF; CMSEL0 0x33; CMSEL1 0x03; TRCON BCON CT1CON 0x00; 0x05; 0x0F; CAPCOM UNIT BLOCK COMMUTATION MODE offset register value reset values period register value maximum values period 6.4us 419.43ms fosc=40MHz prescalers fosc/256 compare CCx=1, COUTx=1 inactive state capture mode enabled block commutation mode CAPCOM channel automatically configured capture mode captured CCL0/CCH0*/ CTRAP function disabled CCx/COUTx pins block commutation mode selected with rotate right BCEN block commutation mode enabled start mode prescaler fosc/256 (period 6.4us 419.43ms) void int_ini (void) ITCON 0x03; CCIE IEN1 0x80; 0x20; interrupt initialization enable external interupt0 P3.2 rising/falling edge-triggered mode interrupt ECTP enabling period interrupt enable compare timer interrupt enable interrupts void rps_sub (void) subroutine saving captured compare timer value difference_val (compt1_ov_val difference_val 0x00; compt1_ov_val 0x00; else test error condition before saving capture value comt1 overflow occured difference_val 0x00 reset compare timer error condition Semiconductor Group Scheibert CCU-C504 Appendix Page -1/43/96 C500 Family ApNotes COMPILER V5.02, difference_val capture_value; save capture_value difference_val 05/03/96 09:28:02 PAGE void extintx_sub (void) capture_high CCH0; capture_low CCL0; CT1CON 0x17; CT1CON 0x0F; subroutine external interrupt0 load cature_value stop reset compare timer ct1clock fosc/256 start comparetimer with 0000H*/ instruction cycles measurement error fosc MHz) INTERRUPTS void comptim1 (void) interrupt COMT1 using #define CCIR 0x7F; compt1_ov_val compt1_ov_val+1; clear interrupt flag CT1FP error condition COMT1 (73H) Compare Timer interrupt void extint0 (void) interrupt EXTI0 using #define EXTI0 EXTI0 (03H) external interrupt extintx_sub rps_sub call external interrupt subroutine call subroutine calculation MAIN PROGRAM void main (void) comp_ini int_ini FOREVER call compare timer initialisation procedure block commutation mode with rotate right subroutine enable interrupt0 endless loop Semiconductor Group Scheibert CCU-C504 Appendix Page -2/43/96 C500 Family ApNotes COMPILER V5.02, 05/03/96 09:28:02 PAGE ASSEMBLY LISTING GENERATED OBJECT CODE FUNCTION comp_ini (BEGIN) SOURCE LINE SOURCE LINE SOURCE LINE 0000 0001 F5E7 0003 F5E6 0005 75DFFF 0008 75DEFF 000B 75E2FF 000E 43E333 0011 43E403 0014 F5CF 0016 75D705 0019 75E10F 001C CT1OFH,A SOURCE LINE CT1OFL,A SOURCE LINE CCPH,#0FFH SOURCE LINE CCPL,#0FFH SOURCE LINE COINI,#0FFH SOURCE LINE CMSEL0,#033H SOURCE LINE CMSEL1,#03H SOURCE LINE TRCON,A SOURCE LINE BCON,#05H SOURCE LINE CT1CON,#0FH SOURCE LINE FUNCTION comp_ini (END) FUNCTION int_ini (BEGIN) SOURCE LINE SOURCE LINE SOURCE LINE 0000 D288 0002 D2A8 0004 759A03 0007 43D680 000A 43A920 000D D2AF 000F SETB SETB SETB SOURCE LINE SOURCE LINE ITCON,#03H SOURCE LINE CCIE,#080H SOURCE LINE IEN1,#020H SOURCE LINE SOURCE LINE FUNCTION int_ini (END) FUNCTION rps_sub (BEGIN) SOURCE LINE SOURCE LINE SOURCE LINE 0000 0002 0003 0005 E500 9400 4008 SETB SUBB A,compt1_ov_val A,#00H ?C0003 SOURCE SOURCE difference_val,A difference_val+01H,A SOURCE compt1_ov_val,A SOURCE LINE LINE 0007 0008 F500 000A F500 000C F500 000E 000F LINE LINE ?C0003: SOURCE LINE SOURCE LINE difference_val,capture_union SOURCE LINE SOURCE LINE 000F 850000 0012 850000 0015 0015 ?C0005: FUNCTION rps_sub (END) FUNCTION extintx_sub (BEGIN) SOURCE SOURCE SOURCE capture_union,CCH0 SOURCE capture_union+01H,CCL0 SOURCE CT1CON,#017H SOURCE CT1CON,#0FH SOURCE LINE LINE LINE LINE LINE LINE LINE 0000 85C300 0003 85C200 0006 75E117 0009 75E10F 000C FUNCTION extintx_sub (END) FUNCTION comptim1 (BEGIN) SOURCE LINE SOURCE LINE 0000 53E57F CCIR,#07FH SOURCE LINE Semiconductor Group Scheibert CCU-C504 Appendix Page -3/43/96 C500 Family ApNotes COMPILER V5.02, 0003 0500 0005 compt1_ov_val SOURCE LINE RETI FUNCTION comptim1 (END) FUNCTION extint0 (BEGIN) PUSH PUSH SOURCE LINE SOURCE LINE 0004 120000 0007 120000 000A D0D0 000C D0E0 000E LCALL LCALL extintx_sub SOURCE LINE rps_sub SOURCE LINE RETI FUNCTION extint0 (END) FUNCTION main (BEGIN) SOURCE LINE SOURCE LINE SOURCE LINE 0000 120000 0003 120000 0006 LCALL LCALL comp_ini SOURCE LINE int_ini SOURCE LINE ?C0009: SOURCE LINE SOURCE LINE 0006 80FE 0008 SJMP ?C0009 SOURCE LINE FUNCTION main (END) 05/03/96 09:28:02 PAGE 0000 C0E0 0002 C0D0 Semiconductor Group Scheibert CCU-C504 Appendix Page -4/43/96 Other recent searchesV850E - V850E V850E Datasheet V850E - V850E V850E Datasheet V850ES - V850ES V850ES Datasheet V850ES - V850ES V850ES Datasheet SEMI-47 - SEMI-47 SEMI-47 Datasheet MA700 - MA700 MA700 Datasheet MA700A - MA700A MA700A Datasheet FTP-632MCL101 - FTP-632MCL101 FTP-632MCL101 Datasheet FTP-602 - FTP-602 FTP-602 Datasheet CL-824-MU1L1-T - CL-824-MU1L1-T CL-824-MU1L1-T Datasheet BUL6823 - BUL6823 BUL6823 Datasheet 2SB689 - 2SB689 2SB689 Datasheet
Privacy Policy | Disclaimer |