Рассчёт ошибки вычисления угла

This commit is contained in:
Eugene 2023-10-19 09:19:47 +03:00
parent d0b478370b
commit aec5029d50
11 changed files with 281 additions and 196 deletions

View File

@ -49,10 +49,13 @@
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH.131753599" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${COM_TI_C2000WARE_SOFTWARE_PACKAGE_INCLUDE_PATH}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/Freemaster}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src/ExternalEEPROM}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src/Peripherals}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/lib}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src}"/>
<listOptionValue builtIn="false" value="${PROJECT_ROOT}"/>
<listOptionValue builtIn="false" value="${C2000WARE_COMMON_INCLUDE}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src/vector}"/>
<listOptionValue builtIn="false" value="${C2000WARE_HEADERS_INCLUDE}"/>
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
</option>
@ -65,6 +68,7 @@
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_SUPPRESS.842502178" name="Suppress diagnostic &lt;id&gt; (--diag_suppress, -pds)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_SUPPRESS" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="10063"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ADVICE__PERFORMANCE.547226040" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.ADVICE__PERFORMANCE" value="--advice:performance=all" valueType="string"/>
<inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS.37853400" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS.1857696012" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS.1780292617" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compiler.inputType__ASM_SRCS"/>
@ -152,6 +156,7 @@
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src/ExternalEEPROM}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/Freemaster}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src}"/>
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/src/vector}"/>
<listOptionValue builtIn="false" value="${COM_TI_C2000WARE_SOFTWARE_PACKAGE_INCLUDE_PATH}"/>
<listOptionValue builtIn="false" value="${PROJECT_ROOT}"/>
<listOptionValue builtIn="false" value="${C2000WARE_COMMON_INCLUDE}"/>

View File

@ -23,6 +23,10 @@ encoding//CPU1_RAM/lib/subdir_vars.mk=UTF-8
encoding//CPU1_RAM/makefile=UTF-8
encoding//CPU1_RAM/objects.mk=UTF-8
encoding//CPU1_RAM/sources.mk=UTF-8
encoding//CPU1_RAM/src/ExternalEEPROM/subdir_rules.mk=UTF-8
encoding//CPU1_RAM/src/ExternalEEPROM/subdir_vars.mk=UTF-8
encoding//CPU1_RAM/src/Peripherals/subdir_rules.mk=UTF-8
encoding//CPU1_RAM/src/Peripherals/subdir_vars.mk=UTF-8
encoding//CPU1_RAM/src/subdir_rules.mk=UTF-8
encoding//CPU1_RAM/src/subdir_vars.mk=UTF-8
encoding//CPU1_RAM/subdir_rules.mk=UTF-8

View File

@ -66,11 +66,11 @@ MEMORY
SECTIONS
{
codestart : > BEGIN, ALIGN(8)
.text : >> FLASH1 | FLASH2 | FLASH3 | FLASH4, ALIGN(8)
.cinit : > FLASH4, ALIGN(8)
.switch : > FLASH1, ALIGN(8)
.text : >> FLASH1 | FLASH2 | FLASH3 | FLASH4, ALIGN(8) //text - Code
.cinit : > FLASH4, ALIGN(8) //cinit - Init values fos global and static vars
.switch : > FLASH1, ALIGN(8) //switch - tables for switch statements
.reset : > RESET, TYPE = DSECT /* not used, */
.stack : > RAMM1
.stack : > RAMM1 //stack - Local vars
#if defined(__TI_EABI__)
.init_array : > FLASH1, ALIGN(8)
@ -82,12 +82,12 @@ SECTIONS
/* Initalized sections go in Flash */
.const : > FLASH5, ALIGN(8)
#else
.pinit : > FLASH1, ALIGN(8)
.ebss : > RAMLS5
.pinit : > FLASH1, ALIGN(8) //pinit - tables for global constructors (C++)
.ebss : > RAMLS5 //ebss - Global vars
.esysmem : > RAMLS5
.cio : > RAMLS5
/* Initalized sections go in Flash */
.econst : >> FLASH4 | FLASH5, ALIGN(8)
.econst : >> FLASH4 | FLASH5, ALIGN(8) //econst - constants
#endif
ramgs0 : > RAMGS0, type=NOINIT

View File

@ -58,12 +58,12 @@ MEMORY
SECTIONS
{
codestart : > BEGIN
.text : >> RAMD01 | RAMLS02 | RAMLS3 | RAMGS101112
.cinit : > RAMM0
.switch : > RAMM0
.text : >> RAMD01 | RAMLS02 | RAMLS3 | RAMGS101112 //text - Code
.cinit : > RAMM0 //cinit - Init values fos global vars
.switch : > RAMM0 //switch - tables for switch statements
.reset : > RESET, TYPE = DSECT /* not used, */
.stack : > RAMM1
.stack : > RAMM1 //stack - Local vars
#if defined(__TI_EABI__)
.bss : >> RAMLS56 | RAMGS101112
.bss:output : > RAMLS3
@ -72,8 +72,8 @@ SECTIONS
.data : >> RAMLS56 | RAMLS7 | RAMGS101112
.sysmem : > RAMLS4
#else
.pinit : > RAMM0
.ebss : >> RAMLS56
.pinit : > RAMM0 //pinit - tables for global constructors (C++)
.ebss : >> RAMLS56 //ebss - Global vars
.econst : > RAMLS56
.esysmem : > RAMLS56
#endif
@ -86,6 +86,14 @@ SECTIONS
MSGRAM_CPU_TO_CM > CPUTOCMRAM, type=NOINIT
MSGRAM_CM_TO_CPU > CMTOCPURAM, type=NOINIT
/* The following section definition are for SDFM examples */
Filter_RegsFile : > RAMGS0
Filter1_RegsFile : > RAMGS1, fill=0x1111
Filter2_RegsFile : > RAMGS2, fill=0x2222
Filter3_RegsFile : > RAMGS3, fill=0x3333
Filter4_RegsFile : > RAMGS4, fill=0x4444
Difference_RegsFile : >RAMGS5, fill=0x3333
.TI.ramfunc : {} > RAMM0
}

View File

@ -1,5 +1,5 @@
/******************************************************************************
*
* //Texas code composer variant
* Freescale Semiconductor Inc.
* (c) Copyright 2004-2007 Freescale Semiconductor, Inc.
* (c) Copyright 2001-2004 Motorola, Inc.

Binary file not shown.

View File

@ -321,10 +321,7 @@ void sdfmGet(uint16_t N)
loopCounter[N] = 0;
if(!initDone[N])
{
for(i = 0; i <= (MAX_SAMPLES-1); i++)
{
OffsetCount += FilterResult[N][i];
}
for(i = 0; i <= (MAX_SAMPLES-1); i++) OffsetCount += FilterResult[N][i];
sdfmOffset[N] = OffsetCount>>FILTER_BIT;
initDone[N] = 0xFF;
}
@ -335,6 +332,7 @@ void sdfmGet(uint16_t N)
SDDFPARM_Reg_arr[N]->bit.AE = 0;
EDIS;
sdfmAdcErr[N] = 0;
if(N == SDFM_IA) Gpio54out(0);
if(N == SDFM_IB) Gpio55out(0);
if(N == SDFM_IC) Gpio56out(0);

View File

@ -62,7 +62,7 @@ TvectorCurrentLoop CurrLoop;
TMode Mode = OffMode;
uint16_t Step = 0, StepS, Nstep = 2, NoLoop = 0, StepShift = 6;
float CurrentRegTuneAmpl = 0, FRM_cur = 0;
int16_t Angle_test=0,sin_int,cos_int;
int16_t Angle_test=0,sin_int,cos_int, AngleErr;
void vectorFault(void)
@ -285,6 +285,8 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
Angle_test = Atan(sin_int, cos_int);
AngleErr = Angle_test - vectorSinCos.Angle;
// CurrLoop.piIq.Ref = Inputs->IqRef;//Çàäàííîå

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
@ -9,7 +11,9 @@
<configuration XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
@ -18,7 +22,9 @@
<instance XML_version="1.2" desc="Texas Instruments XDS100v2 USB Debug Probe_0" href="connections/TIXDS100v2_Connection.xml" id="Texas Instruments XDS100v2 USB Debug Probe_0" xml="TIXDS100v2_Connection.xml" xmlpath="connections"/>
@ -27,7 +33,9 @@
<connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
@ -36,7 +44,9 @@
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
@ -45,7 +55,9 @@
<instance XML_version="1.2" href="drivers/tixds100v2c28x.xml" id="drivers" xml="tixds100v2c28x.xml" xmlpath="drivers"/>
@ -54,7 +66,9 @@
<instance XML_version="1.2" href="drivers/tixds100v2cla2.xml" id="drivers" xml="tixds100v2cla2.xml" xmlpath="drivers"/>
@ -63,7 +77,9 @@
<instance XML_version="1.2" href="drivers/tixds100v2cs_child.xml" id="drivers" xml="tixds100v2cs_child.xml" xmlpath="drivers"/>
@ -72,7 +88,9 @@
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
@ -81,7 +99,9 @@
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
@ -90,7 +110,9 @@
<instance XML_version="1.2" href="drivers/tixds510ajsm.xml" id="drivers" xml="tixds510ajsm.xml" xmlpath="drivers"/>
@ -99,168 +121,6 @@
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="TMS320F28388D_0" href="devices/f28388d.xml" id="TMS320F28388D_0" xml="f28388d.xml" xmlpath="devices"/>
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D" simulation="no">
<router HW_revision="1.0" XML_version="1.2" description="ICEPick_C router" id="IcePick_C_0" isa="ICEPICK_C">
<subpath id="Subpath_1">
<property Type="numericfield" Value="0x11" desc="Port Number_0" id="Port Number"/>
</subpath>
<subpath id="CM">
<property Type="numericfield" Value="0x12" desc="Port Number_1" id="Port Number"/>
</subpath>
<subpath id="Subpath_3">
<cpu HW_revision="1.0" XML_version="1.2" description="JLM" deviceSim="false" id="JLM" isa="AJSM">
<property Type="numericfield" Value="0x0" id="Unlock Key bits 31:00"/>
<property Type="numericfield" Value="0x0" id="Unlock Key bits 63:32"/>
<property Type="numericfield" Value="0x0" id="Unlock Key bits 95:64"/>
<property Type="numericfield" Value="0x0" id="Unlock Key bits 127:96"/>
</cpu>
</subpath>
</router>
@ -269,8 +129,210 @@
<instance XML_version="1.2" desc="TMS320F28388D_0" href="devices/f28388d.xml" id="TMS320F28388D_0" xml="f28388d.xml" xmlpath="devices"/>
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D" simulation="no">
<router HW_revision="1.0" XML_version="1.2" description="ICEPick_C router" id="IcePick_C_0" isa="ICEPICK_C">
<subpath id="Subpath_1">
<property Type="numericfield" Value="0x11" desc="Port Number_0" id="Port Number"/>
</subpath>
<subpath id="CM">
<property Type="numericfield" Value="0x12" desc="Port Number_1" id="Port Number"/>
</subpath>
<subpath id="Subpath_3">
<cpu HW_revision="1.0" XML_version="1.2" description="JLM" deviceSim="false" id="JLM" isa="AJSM">
<property Type="numericfield" Value="0x0" id="Unlock Key bits 31:00"/>
<property Type="numericfield" Value="0x0" id="Unlock Key bits 63:32"/>
<property Type="numericfield" Value="0x0" id="Unlock Key bits 95:64"/>
<property Type="numericfield" Value="0x0" id="Unlock Key bits 127:96"/>
</cpu>
</subpath>
</router>
</device>
@ -279,7 +341,9 @@
</platform>
@ -288,7 +352,9 @@
</connection>
@ -297,7 +363,9 @@
</configuration>

Binary file not shown.