сделана возможность меннять частоту ШИМ
This commit is contained in:
parent
1035d02861
commit
44cfb121d4
@ -15,7 +15,7 @@
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Default.1796646261" name="CPU1_FLASH" parent="com.ti.ccstudio.buildDefinitions.C2000.Default">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Default.1796646261." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain.2086402514" name="TI Build Tools" secondaryOutputs="" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1002978132">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain.2086402514" name="TI Build Tools" secondaryOutputs="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.outputType__BIN.2063562915" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1002978132">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.606629708" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28388D"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_CORE_ID="/>
|
||||
@ -68,7 +68,7 @@
|
||||
<listOptionValue builtIn="false" value="CPU1"/>
|
||||
<listOptionValue builtIn="false" value="_FLASH"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.112350031" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.off" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL.112350031" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.OPT_LEVEL._none" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_SUPPRESS.774130655" name="Suppress diagnostic <id> (--diag_suppress, -pds)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DIAG_SUPPRESS" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="10063"/>
|
||||
</option>
|
||||
@ -104,11 +104,11 @@
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS.124158911" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.1747906040" name="C2000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE.1913583788" name="Enable tool" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE" value="false" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE.1913583788" name="Enable tool" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.BYTE.1101072510" name="Output as bytes rather than target addressing (--byte, -byte)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.BYTE" value="false" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.MAP.1539045047" name="Specify map file name (--map, -map=file)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.MAP" value="" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.LINKERFILL.1786756473" name="Include linker fill sections in images (--linkerfill, -linkerfill)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.LINKERFILL" value="false" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.1010264582" name="Output format" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.ASCII" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.1010264582" name="Output format" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.BINARY" valueType="enumerated"/>
|
||||
<outputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.outputType__BIN.2063562915" name="Binary File" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.outputType__BIN"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
|
||||
@ -36,12 +36,12 @@ MEMORY
|
||||
// RAMGS15_RSVD : origin = 0x01CFF8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
|
||||
|
||||
/* Flash sectors */
|
||||
FLASH0 : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
|
||||
FLASH1 : origin = 0x082000, length = 0x002000 /* on-chip Flash */
|
||||
FLASH2 : origin = 0x084000, length = 0x002000 /* on-chip Flash */
|
||||
FLASH3 : origin = 0x086000, length = 0x002000 /* on-chip Flash */
|
||||
FLASH4 : origin = 0x088000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH5 : origin = 0x090000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH0 : origin = 0x080002, length = 0x001FFE, fill=0x0000 /* on-chip Flash */
|
||||
FLASH1 : origin = 0x082000, length = 0x002000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH2 : origin = 0x084000, length = 0x002000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH3 : origin = 0x086000, length = 0x002000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH4 : origin = 0x088000, length = 0x008000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH5 : origin = 0x090000, length = 0x008000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH6 : origin = 0x098000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH7 : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH8 : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */
|
||||
|
||||
@ -92,6 +92,15 @@ void GpioInit(void)
|
||||
|
||||
InputXbarRegs.INPUT4SELECT = GPIO_FaultPWMpin;//xint1
|
||||
|
||||
GpioCtrlRegs.GPIO_Bttonclik_MUX.bit.GPIO_Bttonclik = 0;//Buttons Clik
|
||||
GpioCtrlRegs.GPIO_Bttonclik_GMUX.bit.GPIO_Bttonclik = 0;
|
||||
GpioCtrlRegs.GPIO_Bttonclik_DIR.bit.GPIO_Bttonclik = 0;
|
||||
GpioDataRegs.GPIO_Bttonclik_DAT.bit.GPIO_Bttonclik = 0;
|
||||
GpioCtrlRegs.GPIO_Bttonclik_SEL.bit.GPIO_Bttonclik = 2;
|
||||
|
||||
InputXbarRegs.INPUT6SELECT = GPIO_Bttonclikpin;//xint3
|
||||
|
||||
|
||||
GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 1;//EQEP
|
||||
GpioCtrlRegs.GPAGMUX2.bit.GPIO20 = 0;
|
||||
GpioCtrlRegs.GPADIR.bit.GPIO20 = 0;
|
||||
@ -122,9 +131,9 @@ void GpioInit(void)
|
||||
GpioCtrlRegs.GPDCSEL1.bit.GPIO103 = 2;
|
||||
#else
|
||||
GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0;
|
||||
GpioCtrlRegs.GPAGMUX2.bit.GPIO21 = 0;
|
||||
GpioCtrlRegs.GPAGMUX2.bit.GPIO21 = 0;//питание датчика bissc
|
||||
GpioCtrlRegs.GPADIR.bit.GPIO21 = 1;
|
||||
GpioDataRegs.GPADAT.bit.GPIO21 = 1;//BISS-C_PWR_EN
|
||||
GpioDataRegs.GPADAT.bit.GPIO21 = 0;//BISS-C_PWR_EN
|
||||
GpioCtrlRegs.GPACSEL3.bit.GPIO21 = 2;
|
||||
|
||||
GpioCtrlRegs.GPDMUX1.bit.GPIO98 = 0;
|
||||
|
||||
@ -37,6 +37,14 @@
|
||||
#define GPIO_FaultPWM_MUX GPDMUX1
|
||||
#define GPIO_FaultPWMpin 99
|
||||
|
||||
#define GPIO_Bttonclik GPIO83
|
||||
#define GPIO_Bttonclik_SEL GPCCSEL3
|
||||
#define GPIO_Bttonclik_DIR GPCODR
|
||||
#define GPIO_Bttonclik_DAT GPCDAT
|
||||
#define GPIO_Bttonclik_GMUX GPCGMUX2
|
||||
#define GPIO_Bttonclik_MUX GPCMUX2
|
||||
#define GPIO_Bttonclikpin 83
|
||||
|
||||
#define GPIO_RS485_DE 133
|
||||
#define GPIO_RS485_RE 145
|
||||
|
||||
|
||||
@ -136,7 +136,6 @@ void vectorControl(int16_t CurrentA, int16_t CurrentB, int16_t CurrentC, int16_t
|
||||
BissStartSet();
|
||||
FMSTREnableSet();
|
||||
AdcStartSet();
|
||||
|
||||
}
|
||||
|
||||
void vectorInitCurrLoop(void)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vector.h
|
||||
*
|
||||
* Created on: 20 сент. 2023 г.
|
||||
* Created on: 20 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. 2023 <EFBFBD>.
|
||||
* Author: seklyuts
|
||||
*/
|
||||
|
||||
@ -76,7 +76,7 @@ typedef struct
|
||||
|
||||
typedef enum
|
||||
{
|
||||
OffMode, //Мотор остановлен
|
||||
OffMode, //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
StepMode, //
|
||||
StayMode,
|
||||
CurrentRegTune,
|
||||
@ -95,6 +95,7 @@ void vectorControl(int16_t CurrentA, int16_t CurrentB, int16_t CurrentC, int16_t
|
||||
void vectorFault(void);
|
||||
float my_sqrtf(float x);
|
||||
void vectorResCurrLoop(void);
|
||||
void vectorRegKoeffRecalc(float Koeff);
|
||||
|
||||
|
||||
#endif /* SRC_VECTOR_H_ */
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
|
||||
|
||||
|
||||
<configuration XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS2xx USB Debug Probe_0" href="connections/TIXDS2XXUSB_Connection.xml" id="Texas Instruments XDS2xx USB Debug Probe_0" xml="TIXDS2XXUSB_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.C2000.Default.1796646261" name="CPU2_FLASH" parent="com.ti.ccstudio.buildDefinitions.C2000.Default">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.C2000.Default.1796646261." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain.2086402514" name="TI Build Tools" secondaryOutputs="" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1002978132">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain.2086402514" name="TI Build Tools" secondaryOutputs="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.outputType__BIN.2063562915" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1002978132">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.606629708" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=TMS320C28XX.TMS320F28388D"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_CORE_ID="/>
|
||||
@ -105,11 +105,11 @@
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS.124158911" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.1747906040" name="C2000 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE.1913583788" name="Enable tool" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE" value="false" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE.1913583788" name="Enable tool" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.TOOL_ENABLE" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.BYTE.1101072510" name="Output as bytes rather than target addressing (--byte, -byte)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.BYTE" value="false" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.MAP.1539045047" name="Specify map file name (--map, -map=file)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.MAP" value="" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.LINKERFILL.1786756473" name="Include linker fill sections in images (--linkerfill, -linkerfill)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.LINKERFILL" value="false" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.1010264582" name="Output format" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.ASCII" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.1010264582" name="Output format" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.OUTPUT_FORMAT.BINARY" valueType="enumerated"/>
|
||||
<outputType id="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.outputType__BIN.2063562915" name="Binary File" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.hex.outputType__BIN"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
|
||||
@ -36,13 +36,13 @@ MEMORY
|
||||
// RAMGS15_RSVD : origin = 0x01CFF8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
|
||||
|
||||
/* Flash sectors */
|
||||
FLASH0 : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
|
||||
FLASH1 : origin = 0x082000, length = 0x002000 /* on-chip Flash */
|
||||
FLASH2 : origin = 0x084000, length = 0x002000 /* on-chip Flash */
|
||||
FLASH3 : origin = 0x086000, length = 0x002000 /* on-chip Flash */
|
||||
FLASH4 : origin = 0x088000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH5 : origin = 0x090000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH6 : origin = 0x098000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH0 : origin = 0x080002, length = 0x001FFE, fill=0x0000 /* on-chip Flash */
|
||||
FLASH1 : origin = 0x082000, length = 0x002000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH2 : origin = 0x084000, length = 0x002000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH3 : origin = 0x086000, length = 0x002000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH4 : origin = 0x088000, length = 0x008000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH5 : origin = 0x090000, length = 0x008000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH6 : origin = 0x098000, length = 0x008000, fill=0x0000 /* on-chip Flash */
|
||||
FLASH7 : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH8 : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */
|
||||
FLASH9 : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */
|
||||
@ -74,7 +74,7 @@ SECTIONS
|
||||
|
||||
#if defined(__TI_EABI__)
|
||||
.init_array : > FLASH1, ALIGN(8)
|
||||
.bss : > RAMLS5 // instead of RAMLS5
|
||||
.bss : >> RAMLS5 | RAMLS6 // instead of RAMLS5
|
||||
.bss:output : > RAMLS3
|
||||
.bss:cio : > RAMLS5
|
||||
.data : > RAMLS5
|
||||
@ -92,7 +92,7 @@ SECTIONS
|
||||
|
||||
ramgs0 : > RAMGS0, type=NOINIT
|
||||
ramgs1 : > RAMGS1, type=NOINIT
|
||||
|
||||
|
||||
MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, type=NOINIT
|
||||
MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, type=NOINIT
|
||||
MSGRAM_CPU_TO_CM : > CPUTOCMRAM, type=NOINIT
|
||||
@ -100,11 +100,13 @@ SECTIONS
|
||||
|
||||
/* The following section definition are for SDFM examples */
|
||||
Filter_RegsFile : > RAMGS10
|
||||
Filter1_RegsFile : > RAMLS1, fill=0x1111
|
||||
Filter2_RegsFile : > RAMLS2, fill=0x2222
|
||||
Filter3_RegsFile : > RAMLS3, fill=0x3333
|
||||
Filter4_RegsFile : > RAMLS4, fill=0x4444
|
||||
Difference_RegsFile : >RAMGS5, fill=0x3333
|
||||
Filter1_RegsFile : > RAMLS1
|
||||
Filter2_RegsFile : > RAMLS2
|
||||
Filter3_RegsFile : > RAMLS3
|
||||
Filter4_RegsFile : > RAMLS4
|
||||
Filter6_RegsFile : > RAMLS6
|
||||
Filter14_RegsFile : > RAMGS14
|
||||
Difference_RegsFile : >RAMGS5
|
||||
|
||||
#if defined(__TI_EABI__)
|
||||
.TI.ramfunc : {} LOAD = FLASH3,
|
||||
|
||||
@ -120,7 +120,7 @@ FMSTR_BPTR FMSTR_CopyToBuffer(FMSTR_BPTR pDestBuff, FMSTR_ADDR nSrcAddr, FMSTR_S
|
||||
while(nSize--)
|
||||
{
|
||||
*pd++ = *ps;
|
||||
*pd++ = (*ps++) >> 8; //*pd++ = *ps++;
|
||||
*pd++ = (*ps++) >> 8; //*pd++ = *ps++;изменения для TI
|
||||
}
|
||||
return (FMSTR_BPTR) pd;
|
||||
}
|
||||
@ -158,7 +158,7 @@ FMSTR_BPTR FMSTR_CopyFromBuffer(FMSTR_ADDR nDestAddr, FMSTR_BPTR pSrcBuff, FMSTR
|
||||
while(nSize--)
|
||||
{
|
||||
*pd = *ps++;
|
||||
*pd++ += (*ps++)<<8; // *pd++ = *ps++;
|
||||
*pd++ += (*ps++)<<8; // *pd++ = *ps++; изменения для TI
|
||||
}
|
||||
return (FMSTR_BPTR) ps;
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ FMSTR_BPTR FMSTR_SetUpRec(FMSTR_BPTR pMessageIO)
|
||||
#else
|
||||
/* size in native sizeof units (=bytes on most platforms) */
|
||||
pcm_wRecBuffSize = (FMSTR_SIZE)FMSTR_REC_BUFF_SIZE;
|
||||
FMSTR_ARR2ADDR(pcm_nRecBuffAddr, pcm_pOwnRecBuffer); // заполнение буфера
|
||||
FMSTR_ARR2ADDR(pcm_nRecBuffAddr, pcm_pOwnRecBuffer); // заполнение буфера
|
||||
#endif
|
||||
|
||||
/* seek the setup data */
|
||||
@ -629,7 +629,7 @@ static void FMSTR_Recorder2(void)
|
||||
for (i=0U; i<pcm_nRecVarCount; i++)
|
||||
{
|
||||
sz = pcm_pRecVarSize[i];
|
||||
FMSTR_CopyMemory(pcm_dwRecWritePtr, pcm_pRecVarAddr[i], sz); // заполнение буфера тут
|
||||
FMSTR_CopyMemory(pcm_dwRecWritePtr, pcm_pRecVarAddr[i], sz); // заполнение буфера тут
|
||||
sz /= FMSTR_CFG_BUS_WIDTH;
|
||||
pcm_dwRecWritePtr += sz;
|
||||
}
|
||||
|
||||
Binary file not shown.
@ -6,12 +6,14 @@
|
||||
*/
|
||||
#include "f28x_project.h"
|
||||
#include "temperature.h"
|
||||
|
||||
#include "eqep.h"
|
||||
uint16_t eqepTic[3] = {0,0,0};
|
||||
uint16_t eqip_Max = 160; //16mS
|
||||
uint16_t eqepTemperature = 0;
|
||||
|
||||
|
||||
uint16_t geteqepTemperature(){
|
||||
return eqepTemperature;
|
||||
}
|
||||
uint16_t eqep_read_counter(void)
|
||||
{
|
||||
return EQep1Regs.QPOSCNT;
|
||||
@ -33,7 +35,7 @@ void eqep_init(void)
|
||||
EQep1Regs.QEPCTL.bit.QPEN = 1;//QEP unit timer enable
|
||||
}
|
||||
|
||||
void eqepTest(void)
|
||||
void eqepTest(void) //каждую 0.1 мс
|
||||
{
|
||||
eqepTic[0] = EQep1Regs.QPOSCNT;
|
||||
if(eqepTic[0] != 0)
|
||||
|
||||
@ -12,5 +12,5 @@ uint16_t eqep_read_counter(void);
|
||||
void eqep_reset_counter(void);
|
||||
void eqep_init(void);
|
||||
void eqepTest(void);
|
||||
|
||||
uint16_t geteqepTemperature(void);
|
||||
#endif /* SRC_PERIPHERALS_EQEP_H_ */
|
||||
|
||||
@ -32,12 +32,12 @@ void I2CMasterGpioInit(void)
|
||||
//
|
||||
//Configure I2C pins
|
||||
//
|
||||
GPIO_SetupPinMux(GPIO_PIN_SDAA, GPIO_MUX_CPU1, 6);
|
||||
GPIO_SetupPinMux(GPIO_PIN_SDAA, GPIO_MUX_CPU2, 6);
|
||||
GPIO_SetupPinOptions(GPIO_PIN_SDAA, GPIO_OUTPUT, GPIO_PULLUP);
|
||||
GPIO_SetupPinMux(GPIO_PIN_SCLA, GPIO_MUX_CPU1, 6);
|
||||
GPIO_SetupPinMux(GPIO_PIN_SCLA, GPIO_MUX_CPU2, 6);
|
||||
GPIO_SetupPinOptions(GPIO_PIN_SCLA, GPIO_OUTPUT, GPIO_PULLUP);
|
||||
}
|
||||
|
||||
#define I2C_NUMBYTES 0x2U
|
||||
void I2CMasterInit(uint16_t I2C_OwnAddress, uint16_t I2CSlave_Address)
|
||||
{
|
||||
EALLOW;
|
||||
@ -50,10 +50,9 @@ void I2CMasterInit(uint16_t I2C_OwnAddress, uint16_t I2CSlave_Address)
|
||||
// I2C configuration. Use a 400kHz I2CCLK with a 50% duty cycle.
|
||||
//
|
||||
//I2C_initMaster(base, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_50); = 1000000 / (I2CPSC+1) / (I2CCLKL + I2CCLKH)
|
||||
I2caRegs.I2CPSC.all = 49; // Prescaler - need 7-12 Mhz on module clk
|
||||
I2caRegs.I2CCLKL = 12; // NOTE: must be non zero
|
||||
I2caRegs.I2CCLKH = 12; // NOTE: must be non zero
|
||||
|
||||
I2caRegs.I2CPSC.all = 0xB; // Prescaler - need 7-12 Mhz on module clk
|
||||
I2caRegs.I2CCLKL = 0x7; // NOTE: must be non zero
|
||||
I2caRegs.I2CCLKH = 0x8; // NOTE: must be non zero
|
||||
|
||||
//
|
||||
// Configure Master as a Transmitter
|
||||
@ -64,7 +63,7 @@ void I2CMasterInit(uint16_t I2C_OwnAddress, uint16_t I2CSlave_Address)
|
||||
//
|
||||
// Set data count
|
||||
//
|
||||
// I2caRegs.I2CCNT = I2C_NUMBYTES;
|
||||
I2caRegs.I2CCNT = I2C_NUMBYTES;
|
||||
|
||||
//
|
||||
// Set the bit count to 8 bits per data byte
|
||||
|
||||
@ -94,14 +94,14 @@ void PWMAllInit(void)
|
||||
PwmBrake100 = PERIOD_BRAKE;
|
||||
PwmMotor100 = PERIOD_MOTOR;
|
||||
|
||||
PWMInit(PWM_BASE_TIMER, TimerBase, INDEPENDED); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
PWMInit(PWM_A, PwmMotor100, COMPLIMENTARY);//<EFBFBD><EFBFBD><EFBFBD>
|
||||
PWMInit(PWM_B, PwmMotor100, COMPLIMENTARY);//<EFBFBD><EFBFBD><EFBFBD>
|
||||
PWMInit(PWM_C, PwmMotor100, COMPLIMENTARY);//<EFBFBD><EFBFBD><EFBFBD>
|
||||
PWMInit(PWM_BRAKE, PwmBrake100, INDEPENDED);//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
PWMInit(PWM_FAN, PwmFan100, INDEPENDED);//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
PWMInit(PWM_BASE_TIMER, TimerBase, INDEPENDED); //счётчик общего назначени
|
||||
PWMInit(PWM_A, PwmMotor100, COMPLIMENTARY);//ШИМ
|
||||
PWMInit(PWM_B, PwmMotor100, COMPLIMENTARY);//ШИМ
|
||||
PWMInit(PWM_C, PwmMotor100, COMPLIMENTARY);//ШИМ
|
||||
PWMInit(PWM_BRAKE, PwmBrake100, INDEPENDED);//Тормоз
|
||||
PWMInit(PWM_FAN, PwmFan100, INDEPENDED);//вентилятор и чоппер
|
||||
|
||||
//11 <EFBFBD> 12 <20><><EFBFBD> SDFM
|
||||
//11 и 12 для SDFM
|
||||
PWMInit(11, PwmMotor100, INDEPENDED);
|
||||
PWMInit(12, PwmMotor100, INDEPENDED);
|
||||
|
||||
@ -124,12 +124,12 @@ void PWMAllInit(void)
|
||||
EDIS;
|
||||
|
||||
EALLOW;
|
||||
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC =1;// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC =1;// синхронный запуск таймеров
|
||||
EDIS;
|
||||
}
|
||||
|
||||
|
||||
void PWMGpioInit(void)//<EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
void PWMGpioInit(void)//Тут в библиотечном файле вручную проверяем что пины те которые надо по схеме
|
||||
{
|
||||
InitEPwm2Gpio();
|
||||
InitEPwm5Gpio();
|
||||
@ -191,6 +191,9 @@ void PWMInitInterruptEn(void)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void PWMInit(uint16_t Num, uint16_t Period, uint16_t Independed)
|
||||
{
|
||||
|
||||
@ -221,7 +224,7 @@ void PWMInit(uint16_t Num, uint16_t Period, uint16_t Independed)
|
||||
EPwmRegs[Num]->TZCTL.bit.TZA = 3;
|
||||
EPwmRegs[Num]->TZCTL.bit.TZB = 3;
|
||||
EPwmRegs[Num]->TZFRC.all = 4;
|
||||
EDIS; //
|
||||
EDIS; //Программно выставляем TZ-событие
|
||||
//
|
||||
// Set actions
|
||||
//
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#define PERIOD_FAN (SYS_PWM_FREQUENCY/2.0/FREQUENCY_FAN)
|
||||
|
||||
#define PERIOD_BRAKE (SYS_PWM_FREQUENCY/2.0/FREQUENCY_BRAKE) //Tic
|
||||
#define PERIOD_MOTOR (SYS_PWM_FREQUENCY/2.0/FREQUENCY_MOTOR) //Tic
|
||||
#define PERIOD_MOTOR (SYS_PWM_FREQUENCY/2.0/FREQUENCY_MOTOR) //Tic = 5000
|
||||
|
||||
#define EPWM_DB (EPWM_DB_mkS*SYS_PWM_FREQUENCY/1000000)
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
#define SDFM_DELAY (SDFM_DELAY_mkS*SYS_PWM_FREQUENCY/1000000)
|
||||
|
||||
#define PERIOD_2 (PERIOD_MOTOR/2.0)
|
||||
#define PWM_MAX (PERIOD_MOTOR - EPWM_DB)
|
||||
#define PWM_MIN EPWM_DB*2
|
||||
//#define PWM_MAX (PERIOD_MOTOR - EPWM_DB)
|
||||
//#define PWM_MIN EPWM_DB*2
|
||||
#define INDEPENDED 1
|
||||
#define COMPLIMENTARY 0
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
#include "i2c_init.h"
|
||||
#include "timer_base.h"
|
||||
#include "vector.h"
|
||||
#include "pwm_interrupts.h"
|
||||
#include "sdfm.h"
|
||||
#include "adc_init.h"
|
||||
#include <pwm_init.h>
|
||||
@ -20,6 +19,7 @@
|
||||
#include "eqep.h"
|
||||
#include "temperature.h"
|
||||
#include "rele.h"
|
||||
#include "pwm_interrupts.h"
|
||||
|
||||
volatile uint16_t AutoChange = 0;
|
||||
volatile uint16_t PWM_out = 2500;
|
||||
@ -37,18 +37,42 @@ typedef struct
|
||||
int16_t UC;
|
||||
}strPWMABC;
|
||||
|
||||
|
||||
volatile uint16_t PeriodPWM[2] = {PERIOD_MOTOR, PERIOD_MOTOR};
|
||||
volatile uint16_t PeriodPWM_2 = PERIOD_2;
|
||||
volatile strPWMABC PWM_motor = {PERIOD_2, PERIOD_2, PERIOD_2};
|
||||
|
||||
int16_t A_proc,B_proc,C_proc;
|
||||
uint16_t PWM_Vent = PERIOD_FAN;
|
||||
uint16_t PWM_Chop = 0;
|
||||
uint16_t PWM_SDFM_delay = SDFM_DELAY;
|
||||
uint16_t Timing_PWM[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc)
|
||||
void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc, uint16_t Mode)
|
||||
{
|
||||
|
||||
A_proc = (int16_t)((phaseA/Udc)*PERIOD_2);
|
||||
B_proc = (int16_t)((phaseB/Udc)*PERIOD_2);
|
||||
C_proc = (int16_t)((phaseC/Udc)*PERIOD_2);
|
||||
if(PeriodPWM[0] != PeriodPWM[1])
|
||||
{
|
||||
if(Mode == OffMode)
|
||||
{
|
||||
if(PeriodPWM[0] < PERIOD_2) PeriodPWM[0]=PERIOD_2;
|
||||
if(PeriodPWM[0] > PERIOD_MOTOR) PeriodPWM[0]=PERIOD_MOTOR;
|
||||
PeriodPWM[1] = PeriodPWM[0];
|
||||
vectorRegKoeffRecalc(PeriodPWM[0]/PERIOD_MOTOR);
|
||||
EPwmRegs[PWM_A]->TBPRD = EPwmRegs[PWM_B]->TBPRD = EPwmRegs[PWM_C]->TBPRD = PeriodPWM[0];
|
||||
PeriodPWM_2 = PeriodPWM[0]/2;
|
||||
EPwmRegs[11]->TBPRD = PeriodPWM[0]*2-1;
|
||||
PWM_SDFM_delay = 2*PeriodPWM[0] - 5000;
|
||||
EPwm11Regs.CMPA.bit.CMPA = PWM_SDFM_delay;
|
||||
}
|
||||
else PeriodPWM[0] == PeriodPWM[1];
|
||||
}
|
||||
|
||||
|
||||
|
||||
A_proc = (int16_t)((phaseA/Udc)*PeriodPWM_2);
|
||||
B_proc = (int16_t)((phaseB/Udc)*PeriodPWM_2);
|
||||
C_proc = (int16_t)((phaseC/Udc)*PeriodPWM_2);
|
||||
|
||||
if(A_proc > 0) A_proc+= EPWM_DB/2;
|
||||
else if(A_proc < 0) A_proc-= EPWM_DB/2;
|
||||
@ -57,12 +81,12 @@ void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc)
|
||||
if(C_proc > 0) C_proc+= EPWM_DB/2;
|
||||
else if(C_proc < 0) C_proc-= EPWM_DB/2;
|
||||
|
||||
PWM_motor.UA = PERIOD_2 + A_proc;
|
||||
PWM_motor.UB = PERIOD_2 + B_proc;
|
||||
PWM_motor.UA = PeriodPWM_2 + A_proc;
|
||||
PWM_motor.UB = PeriodPWM_2 + B_proc;
|
||||
#ifdef REF0
|
||||
PWM_motor.UC = PERIOD_2 - C_proc;
|
||||
PWM_motor.UC = PeriodPWM_2 - C_proc;
|
||||
#else
|
||||
PWM_motor.UC = PERIOD_2 + C_proc;
|
||||
PWM_motor.UC = PeriodPWM_2 + C_proc;
|
||||
#endif
|
||||
|
||||
// FaultABC = FaultPWM;
|
||||
@ -71,18 +95,16 @@ void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc)
|
||||
if((FaultABC)||(FaultABCFix))
|
||||
{
|
||||
PWM_ABC_StopAllClose();
|
||||
PWM_motor.UA = PERIOD_2;
|
||||
PWM_motor.UB = PERIOD_2;
|
||||
PWM_motor.UC = PERIOD_2;
|
||||
PWM_motor.UA = PeriodPWM_2;
|
||||
PWM_motor.UB = PeriodPWM_2;
|
||||
PWM_motor.UC = PeriodPWM_2;
|
||||
vectorFault();
|
||||
}
|
||||
|
||||
EPwmRegs[PWM_A]->CMPA.bit.CMPA = PERIOD_MOTOR - PWM_motor.UA;
|
||||
EPwmRegs[PWM_B]->CMPA.bit.CMPA = PERIOD_MOTOR - PWM_motor.UB;
|
||||
EPwmRegs[PWM_C]->CMPA.bit.CMPA = PERIOD_MOTOR - PWM_motor.UC;
|
||||
EPwmRegs[PWM_A]->CMPA.bit.CMPA = PeriodPWM[0] - PWM_motor.UA;
|
||||
EPwmRegs[PWM_B]->CMPA.bit.CMPA = PeriodPWM[0] - PWM_motor.UB;
|
||||
EPwmRegs[PWM_C]->CMPA.bit.CMPA = PeriodPWM[0] - PWM_motor.UC;
|
||||
|
||||
// EPwmRegs[PWM_FAN]->CMPA.bit.CMPA = PERIOD_FAN - PWM_Vent;
|
||||
// EPwmRegs[3]->CMPB.bit.CMPB = PERIOD_MOTOR - PWM_Chop;
|
||||
}
|
||||
|
||||
|
||||
@ -251,20 +273,23 @@ __interrupt void epwm6_isr(void)
|
||||
|
||||
|
||||
|
||||
uint16_t PWM_test = SDFM_DELAY;
|
||||
|
||||
void saveTimingNow(uint16_t N)
|
||||
{
|
||||
Timing_PWM[N] = EPwm11Regs.TBCTR;
|
||||
}
|
||||
|
||||
|
||||
__interrupt void epwm11_isr(void)
|
||||
{
|
||||
|
||||
// EPwm11Regs.CMPA.bit.CMPA = PWM_SDFM_delay;
|
||||
// EPwm11Regs.CMPB.bit.CMPB = PWM_SDFM_delay;
|
||||
// EPwm11Regs.CMPC = PWM_SDFM_delay;
|
||||
// EPwm11Regs.CMPD = PWM_SDFM_delay;
|
||||
|
||||
|
||||
EPwm11Regs.CMPA.bit.CMPA = PWM_test;
|
||||
EPwm11Regs.CMPB.bit.CMPB = PWM_test;
|
||||
EPwm11Regs.CMPC = PWM_test;
|
||||
EPwm11Regs.CMPD = PWM_test;
|
||||
|
||||
saveTimingNow(0);
|
||||
if(TestStopSync != 3) sdfm_start_conversion_current();
|
||||
|
||||
PwmFlagStartCurrentMeashure = 1;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* pwm_interrupts.h
|
||||
*
|
||||
* Created on: 21 àâã. 2023 ã.
|
||||
* Created on: 21 <EFBFBD><EFBFBD><EFBFBD>. 2023 <EFBFBD>.
|
||||
* Author: seklyuts
|
||||
*/
|
||||
|
||||
@ -17,9 +17,9 @@ __interrupt void epwm4_isr(void);
|
||||
__interrupt void epwm8_isr(void);
|
||||
__interrupt void epwm6_isr(void);
|
||||
__interrupt void epwm11_isr(void);
|
||||
void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc);
|
||||
void pwm_set_volt_3F(float phaseA, float phaseB, float phaseC, float Udc, uint16_t Mode);
|
||||
void pwm_clr_PwmFlagStartADC(void);
|
||||
|
||||
void saveTimingNow(uint16_t);
|
||||
|
||||
|
||||
#endif /* SRC_PWM_INTERRUPTS_H_ */
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
#include "sdfm.h"
|
||||
#include "vector.h"
|
||||
#include "frm_uart.h"
|
||||
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
@ -104,8 +105,8 @@ uint16_t loopCounter[8] = {0,0,0,0,0,0,0,0};
|
||||
__interrupt void Sdfm1_ISR(void);
|
||||
__interrupt void Sdfm2_ISR(void);
|
||||
|
||||
volatile float CurrentFactorBrake = FACTOR_CURRENT_BRAKE*32767.0;
|
||||
volatile float CurrentFactorMotor = FACTOR_CURRENT_MOTOR*32767.0;
|
||||
volatile float CurrentFactorBrake = FACTOR_CURRENT_BRAKE*32768.0;
|
||||
volatile float CurrentFactorMotor = FACTOR_CURRENT_MOTOR*32768.0;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -64,6 +64,7 @@
|
||||
|
||||
#define FACTOR_CURRENT_BRAKE (FACTOR_CURRENT_BRAKE_A/BIT_MAX)
|
||||
#define FACTOR_CURRENT_MOTOR (FACTOR_CURRENT_MOTOR_A/BIT_MAX)
|
||||
#define DIV_FACTOR_CURRENT_MOTOR (1/FACTOR_CURRENT_MOTOR)
|
||||
|
||||
void SdfmGpioInit(void);
|
||||
void SdfmInitEnable(void);
|
||||
|
||||
@ -25,6 +25,8 @@ __interrupt void fault_isr(void)
|
||||
vectorResCurrLoop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint16_t fault_read_check(void)
|
||||
{
|
||||
return fault_read;
|
||||
@ -51,9 +53,11 @@ uint16_t Err1, Err2;
|
||||
|
||||
void faultInit(void)
|
||||
{
|
||||
uint16_t Fault_Bytes;
|
||||
uint16_t Conf0 = 0xFE;
|
||||
uint16_t Conf1 = 0xFF;
|
||||
|
||||
uint16_t Fault_Bytes;
|
||||
|
||||
Err1 = I2CWrite(I2C_FAULT_SLAVE_ADDRESS, 6, 1, true, &Conf0);
|
||||
|
||||
Err2 = I2CWrite(I2C_FAULT_SLAVE_ADDRESS, 7, 1, true, &Conf1);
|
||||
|
||||
@ -9,6 +9,9 @@
|
||||
#include "frm_uart.h"
|
||||
#include "gpio_init.h"
|
||||
#include "fault.h"
|
||||
#include "i2c_oled.h"
|
||||
#include "buttons.h"
|
||||
#include "eqep.h"
|
||||
|
||||
volatile uint16_t counter=0 ;
|
||||
volatile uint16_t counter1=0 ;
|
||||
@ -16,7 +19,7 @@ volatile uint16_t counter2=0 ;
|
||||
|
||||
volatile uint16_t testMode = 0;
|
||||
|
||||
//uint16_t PWM_Vent1;
|
||||
uint16_t BisscPwrOn = 1;
|
||||
|
||||
void frmmstr_run(void)
|
||||
{
|
||||
@ -60,6 +63,14 @@ static uint16_t diod = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(BisscPwrOn)
|
||||
{
|
||||
GpioDataRegs.GPADAT.bit.GPIO21 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
GpioDataRegs.GPADAT.bit.GPIO21 = 0;
|
||||
}
|
||||
//Gpio95out(Rele);
|
||||
//if(vectorReleOn()) GpioTurnOnRele;
|
||||
//else GpioTurnOffRele;
|
||||
@ -68,10 +79,11 @@ static uint16_t diod = 0;
|
||||
{
|
||||
fault_read_clr();
|
||||
fault_read_ports();
|
||||
}
|
||||
else {
|
||||
|
||||
}else{
|
||||
// buttonsDisp();
|
||||
// ScreenDisp();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
|
||||
#include "pwm_init.h"
|
||||
#include "f28x_project.h"
|
||||
#include "f2838x_cputimervars.h"
|
||||
#include "pwm_interrupts.h"
|
||||
#include "sdfm.h"
|
||||
#include "f2838x_sdfm_drivers.h"
|
||||
@ -23,6 +24,144 @@
|
||||
#include "temperature.h"
|
||||
#include "eqep.h"
|
||||
#include "rele.h"
|
||||
#include "rele.h"
|
||||
#include "i2c_oled.h"
|
||||
|
||||
extern uint16_t I2C_TXdata[];
|
||||
extern uint16_t I2C_RXdata[];
|
||||
|
||||
struct CPUTIMER_VARS CpuTimer0;
|
||||
struct CPUTIMER_VARS CpuTimer1;
|
||||
struct CPUTIMER_VARS CpuTimer2;
|
||||
|
||||
unsigned long uptimeSeconds = 0; // Ãëîáàëüíàÿ ïåðåìåííàÿ äëÿ ÷àñîâ
|
||||
|
||||
__interrupt void cpuTimer0ISR(void)
|
||||
{
|
||||
CpuTimer0.InterruptCount++;
|
||||
uptimeSeconds++;
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 1
|
||||
//
|
||||
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
|
||||
}
|
||||
void InitCpuTimers(void)
|
||||
{
|
||||
//
|
||||
// CPU Timer 0
|
||||
// Initialize address pointers to respective timer registers:
|
||||
//
|
||||
CpuTimer0.RegsAddr = &CpuTimer0Regs;
|
||||
|
||||
//
|
||||
// Initialize timer period to maximum:
|
||||
//
|
||||
CpuTimer0Regs.PRD.all = 0xFFFFFFFF;
|
||||
|
||||
//
|
||||
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT):
|
||||
//
|
||||
CpuTimer0Regs.TPR.all = 0;
|
||||
CpuTimer0Regs.TPRH.all = 0;
|
||||
|
||||
//
|
||||
// Make sure timer is stopped:
|
||||
//
|
||||
CpuTimer0Regs.TCR.bit.TSS = 1;
|
||||
|
||||
//
|
||||
// Reload all counter register with period value:
|
||||
//
|
||||
CpuTimer0Regs.TCR.bit.TRB = 1;
|
||||
|
||||
//
|
||||
// Reset interrupt counters:
|
||||
//
|
||||
CpuTimer0.InterruptCount = 0;
|
||||
|
||||
//
|
||||
// Initialize address pointers to respective timer registers:
|
||||
//
|
||||
CpuTimer1.RegsAddr = &CpuTimer1Regs;
|
||||
CpuTimer2.RegsAddr = &CpuTimer2Regs;
|
||||
|
||||
//
|
||||
// Initialize timer period to maximum:
|
||||
//
|
||||
CpuTimer1Regs.PRD.all = 0xFFFFFFFF;
|
||||
CpuTimer2Regs.PRD.all = 0xFFFFFFFF;
|
||||
|
||||
//
|
||||
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT):
|
||||
//
|
||||
CpuTimer1Regs.TPR.all = 0;
|
||||
CpuTimer1Regs.TPRH.all = 0;
|
||||
CpuTimer2Regs.TPR.all = 0;
|
||||
CpuTimer2Regs.TPRH.all = 0;
|
||||
|
||||
//
|
||||
// Make sure timers are stopped:
|
||||
//
|
||||
CpuTimer1Regs.TCR.bit.TSS = 1;
|
||||
CpuTimer2Regs.TCR.bit.TSS = 1;
|
||||
|
||||
//
|
||||
// Reload all counter register with period value:
|
||||
//
|
||||
CpuTimer1Regs.TCR.bit.TRB = 1;
|
||||
CpuTimer2Regs.TCR.bit.TRB = 1;
|
||||
|
||||
//
|
||||
// Reset interrupt counters:
|
||||
//
|
||||
CpuTimer1.InterruptCount = 0;
|
||||
CpuTimer2.InterruptCount = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// ConfigCpuTimer - This function initializes the selected timer to the period
|
||||
// specified by the "Freq" and "Period" parameters. The "Freq"
|
||||
// is entered as "MHz" and the period in "uSeconds". The timer
|
||||
// is held in the stopped state after configuration.
|
||||
//
|
||||
void ConfigCpuTimer(struct CPUTIMER_VARS *Timer, float Freq, float Period)
|
||||
{
|
||||
Uint32 temp;
|
||||
|
||||
//
|
||||
// Initialize timer period:
|
||||
//
|
||||
Timer->CPUFreqInMHz = Freq;
|
||||
Timer->PeriodInUSec = Period;
|
||||
temp = (long) (Freq * Period);
|
||||
|
||||
//
|
||||
// Counter decrements PRD+1 times each period
|
||||
//
|
||||
Timer->RegsAddr->PRD.all = temp - 1;
|
||||
|
||||
//
|
||||
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
|
||||
//
|
||||
Timer->RegsAddr->TPR.all = 0;
|
||||
Timer->RegsAddr->TPRH.all = 0;
|
||||
|
||||
//
|
||||
// Initialize timer control register:
|
||||
//
|
||||
Timer->RegsAddr->TCR.bit.TSS = 1; // 1 = Stop timer, 0 = Start/Restart
|
||||
// Timer
|
||||
Timer->RegsAddr->TCR.bit.TRB = 1; // 1 = reload timer
|
||||
Timer->RegsAddr->TCR.bit.SOFT = 0;
|
||||
Timer->RegsAddr->TCR.bit.FREE = 0; // Timer Free Run Disabled
|
||||
Timer->RegsAddr->TCR.bit.TIE = 1; // 0 = Disable/ 1 = Enable Timer
|
||||
// Interrupt
|
||||
|
||||
//
|
||||
// Reset interrupt counter:
|
||||
//
|
||||
Timer->InterruptCount = 0;
|
||||
}
|
||||
|
||||
void InitPerif(void)
|
||||
{
|
||||
@ -87,19 +226,45 @@ void InitPerif(void)
|
||||
#else
|
||||
eqep_init();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Enable Timer0
|
||||
EALLOW;
|
||||
PieVectTable.TIMER0_INT = &cpuTimer0ISR;
|
||||
EDIS;
|
||||
InitCpuTimers();
|
||||
// Configure CPU-Timer 0, 1, and 2 to interrupt every second:
|
||||
// 200MHz CPU Freq, 1 second Period (in uSeconds)
|
||||
//
|
||||
ConfigCpuTimer(&CpuTimer0, 200, 1000000);
|
||||
//
|
||||
// To ensure precise timing, use write-only instructions to write to the
|
||||
// entire register. Therefore, if any of the configuration bits are changed
|
||||
// in ConfigCpuTimer and InitCpuTimers, the below settings must also be
|
||||
// be updated.
|
||||
//
|
||||
CpuTimer0Regs.TCR.all = 0x4000;
|
||||
//
|
||||
// Enable CPU int1 which is connected to CPU-Timer 0, CPU int13
|
||||
// which is connected to CPU-Timer 1, and CPU int 14, which is connected
|
||||
// to CPU-Timer 2
|
||||
//
|
||||
IER |= M_INT1;
|
||||
//
|
||||
// Enable TINT0 in the PIE: Group 1 interrupt 7
|
||||
//
|
||||
PieCtrlRegs.PIEIER1.bit.INTx7 = 1;
|
||||
//
|
||||
// Enable global Interrupts and higher priority real-time debug events:
|
||||
//
|
||||
|
||||
EINT; // Enable Global interrupt INTM
|
||||
ERTM; // Enable Global realtime interrupt DBGM
|
||||
|
||||
I2CMasterInit(I2C_OWN_ADDRESS,I2C_FAULT_SLAVE_ADDRESS);
|
||||
I2CMasterInit(I2C_OWN_ADDRESS,0x3C);
|
||||
/* Init LCD */
|
||||
SSD1306_Init();
|
||||
buttonsInit();
|
||||
faultInit();
|
||||
|
||||
|
||||
rele_initRele();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ uint16_t Num = 0;
|
||||
void vectorControl(int16_t CurrentA, int16_t CurrentB, int16_t CurrentC, int16_t sdfmUdc)
|
||||
{
|
||||
|
||||
|
||||
saveTimingNow(1);
|
||||
pwm_clr_PwmFlagStartADC();
|
||||
Ia = -CurrentA;//sdfm_get(6);
|
||||
Ib = -CurrentB;//sdfm_get(3);
|
||||
@ -182,12 +182,14 @@ void vectorControl(int16_t CurrentA, int16_t CurrentB, int16_t CurrentC, int16_t
|
||||
}
|
||||
Udc = sdfmUdc * FACTOR_VDC;
|
||||
vector_klark_park(SectorCheckOn,Ia,Ib,Ic);
|
||||
saveTimingNow(2);
|
||||
vector_inversion();
|
||||
saveTimingNow(3);
|
||||
BissStartSet();
|
||||
FMSTREnableSet();
|
||||
AdcStartSet();
|
||||
sdfm_start_conversion_brake();
|
||||
|
||||
saveTimingNow(4);
|
||||
}
|
||||
|
||||
void vectorInitCurrLoop(void)
|
||||
@ -222,6 +224,15 @@ void vectorInitCurrLoop(void)
|
||||
CurrLoop.piIq.i1 = 0; // Data: integrator storage: ui(k-1)
|
||||
}
|
||||
|
||||
|
||||
void vectorRegKoeffRecalc(float Koeff)
|
||||
{
|
||||
CurrLoop.piId.Kp = PI_REG_I_PROPOR*Koeff;
|
||||
CurrLoop.piId.Ki = PI_REG_I_INTEGR*Koeff;
|
||||
CurrLoop.piIq.Kp = PI_REG_I_PROPOR*Koeff;
|
||||
CurrLoop.piIq.Ki = PI_REG_I_INTEGR*Koeff;
|
||||
}
|
||||
|
||||
void vectorResCurrLoop(void)
|
||||
{
|
||||
CurrLoop.piId.Ref = 0; // Input: reference set-point
|
||||
@ -290,27 +301,28 @@ void vector_inversion(void)
|
||||
vectorUabc.b=-temp3;
|
||||
vectorUabc.c=-(temp1+temp2);
|
||||
}
|
||||
pwm_set_volt_3F(vectorUabc.a,vectorUabc.b,vectorUabc.c, UdcVolt);
|
||||
pwm_set_volt_3F(vectorUabc.a,vectorUabc.b,vectorUabc.c, UdcVolt, Mode);
|
||||
}
|
||||
|
||||
float Test1, Test2;
|
||||
float FRM_Ud, FRM_Uq;
|
||||
volatile int16_t I_fbk_int, I_ref_int;
|
||||
|
||||
void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, int16_t CurrentC)
|
||||
{
|
||||
|
||||
/* if (Inputs->UpdateUdc)
|
||||
{
|
||||
//Запоминаем Udc для контура тока(ограничение Umax Рё Umin РІ РџР<D19F>-регуляторе)
|
||||
Outputs->Udc = PmsmVect.UdcFilter.Output;
|
||||
//Защита от деления на 0 и отрицательных чисел
|
||||
if (Outputs->Udc <= 0.0f)
|
||||
Outputs->Udc = VOLTAGE_UDC;
|
||||
//Расчет коэффициента для расчета скважности РЁР<D081>Рњ(РѕРґРёРЅ раз делим, потом каждый цикл РЁР<D081>Рњ умножаем, это эффективнее)
|
||||
PmsmVect.UdcPwmFactor = 1.0f/Outputs->Udc;
|
||||
//Сброс флага
|
||||
Inputs->UpdateUdc = false;
|
||||
}*/
|
||||
/* if (Inputs->UpdateUdc)
|
||||
{
|
||||
//Запоминаем Udc для контура тока(ограничение Umax и Umin в ПИ-регуляторе)
|
||||
Outputs->Udc = PmsmVect.UdcFilter.Output;
|
||||
//Защита от деления на 0 и отрицательных чисел
|
||||
if (Outputs->Udc <= 0.0f)
|
||||
Outputs->Udc = VOLTAGE_UDC;
|
||||
//Расчет коэффициента для расчета скважности ШИМ(один раз делим, потом каждый цикл ШИМ умножаем, это эффективнее)
|
||||
PmsmVect.UdcPwmFactor = 1.0f/Outputs->Udc;
|
||||
//Сброс флага
|
||||
Inputs->UpdateUdc = false;
|
||||
}*/
|
||||
|
||||
|
||||
if (SectorOn )
|
||||
@ -343,7 +355,7 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
|
||||
vectorIabc.c = (float)CurrentC * FactorCurrent;
|
||||
}
|
||||
|
||||
// преобразование Кларк
|
||||
// преобразование Кларк
|
||||
|
||||
vectorI2ph.Alfa = vectorIabc.a;
|
||||
vectorI2ph.Beta = _IQmpy((vectorIabc.a +_IQmpy2(vectorIabc.b)),_IQ(ONEbySQRT3)); //vectorI2ph.Beta = _IQmpy((vectorIabc.b - vectorIabc.c),_IQ(ONEbySQRT3));
|
||||
@ -354,7 +366,7 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
|
||||
vectorSinCos.sin = ((float)sin_int)/32768.0;
|
||||
vectorSinCos.cos = ((float)cos_int)/32768.0;
|
||||
|
||||
// преобразование Парка
|
||||
// преобразование Парка
|
||||
vectorIdq.d = _IQmpy(vectorI2ph.Alfa,vectorSinCos.cos) + _IQmpy(vectorI2ph.Beta,vectorSinCos.sin);
|
||||
vectorIdq.q = _IQmpy(vectorI2ph.Beta,vectorSinCos.cos) - _IQmpy(vectorI2ph.Alfa,vectorSinCos.sin);
|
||||
|
||||
@ -363,7 +375,7 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
|
||||
// AngleErr = Angle_test - vectorSinCos.Angle;
|
||||
|
||||
|
||||
// CurrLoop.piIq.Ref = Inputs->IqRef;//Заданное
|
||||
// CurrLoop.piIq.Ref = Inputs->IqRef;//Заданное
|
||||
|
||||
if (FABS(CurrLoop.piIq.Ref) > CurrLoop.CurrentLimit)
|
||||
{
|
||||
@ -399,7 +411,9 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
|
||||
PI_MACRO(CurrLoop.piIq);
|
||||
PI_MACRO(CurrLoop.piId);
|
||||
|
||||
/*Пропорциональное ограничение напряжений Uq и Ud*/
|
||||
I_fbk_int = (int16_t) (CurrLoop.piId.Fbk*DIV_FACTOR_CURRENT_MOTOR);
|
||||
I_ref_int = (int16_t) (CurrLoop.piId.Ref*DIV_FACTOR_CURRENT_MOTOR);
|
||||
/*Пропорциональное ограничение напряжений Uq и Ud*/
|
||||
// Test1 = my_sqrtf(Test2);
|
||||
|
||||
|
||||
@ -407,7 +421,7 @@ void vector_klark_park(uint16_t SectorOn, int16_t CurrentA, int16_t CurrentB, in
|
||||
|
||||
|
||||
|
||||
if (Ulim > UmaxVolt)// максимальное напряжение в вольтах
|
||||
if (Ulim > UmaxVolt)// максимальное напряжение в вольтах
|
||||
{
|
||||
if(Ulim > ZERO_LVL)
|
||||
{
|
||||
@ -453,7 +467,7 @@ float my_sqrtf(float x)
|
||||
return x * x0;
|
||||
}
|
||||
|
||||
// Фильтр сигнала
|
||||
// Фильтр сигнала
|
||||
int16_t Filter(int16_t inValue, Filtered *Struct) {
|
||||
(*Struct).Value16in = inValue;
|
||||
(*Struct).Value32+=(int32_t)((*Struct).Value16in)-(int32_t)((*Struct).Value16filtered);
|
||||
|
||||
@ -96,6 +96,7 @@ void vectorControl(int16_t CurrentA, int16_t CurrentB, int16_t CurrentC, int16_t
|
||||
void vectorFault(void);
|
||||
float my_sqrtf(float x);
|
||||
void vectorResCurrLoop(void);
|
||||
void vectorRegKoeffRecalc(float Koeff);
|
||||
|
||||
|
||||
#endif /* SRC_VECTOR_H_ */
|
||||
|
||||
@ -1,81 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
|
||||
|
||||
|
||||
<configuration XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
|
||||
|
||||
|
||||
<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"/>
|
||||
|
||||
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2c28x.xml" id="drivers" xml="tixds100v2c28x.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cla2.xml" id="drivers" xml="tixds100v2cla2.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_child.xml" id="drivers" xml="tixds100v2cs_child.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds510ajsm.xml" id="drivers" xml="tixds510ajsm.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
</router>
|
||||
|
||||
|
||||
</device>
|
||||
|
||||
|
||||
</platform>
|
||||
|
||||
|
||||
</connection>
|
||||
|
||||
|
||||
</configuration>
|
||||
|
||||
|
||||
<configuration XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS2xx USB Debug Probe_0" href="connections/TIXDS2XXUSB_Connection.xml" id="Texas Instruments XDS2xx USB Debug Probe_0" xml="TIXDS2XXUSB_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
|
||||
<instance XML_version="1.2" href="drivers/tixds560icepick_c.xml" id="drivers" xml="tixds560icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560c28x.xml" id="drivers" xml="tixds560c28x.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cla2.xml" id="drivers" xml="tixds560cla2.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cs_child.xml" id="drivers" xml="tixds560cs_child.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cs_dap.xml" id="drivers" xml="tixds560cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cortexM.xml" id="drivers" xml="tixds560cortexM.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560ajsm.xml" id="drivers" xml="tixds560ajsm.xml" xmlpath="drivers"/>
|
||||
<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">
|
||||
<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>
|
||||
</router>
|
||||
</device>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
|
||||
@ -76,11 +76,5 @@ ___________________________________________
|
||||
нужно выбрать Mode = 3 и задать ток CurrentRegTuneAmpl в амперах
|
||||
слева выбрать график I с биноклем который
|
||||
после этого менять CurrLoop.piId.Kp и CurrLoop.piId.Ki чтобы изменить характеристику
|
||||
___________________________________________
|
||||
Импульс тока
|
||||
|
||||
В переменную CurrentRegTuneAmplInpuls задать ток импульса
|
||||
В переменную Impulse задать кол-во секунд (от 0.0001 с до 10 сек)
|
||||
|
||||
после этого ток примет значение CurrentRegTuneAmplInpuls на Impulse секунд и после этого Impulse станет равен 0, а ток вернётся к значению CurrentRegTuneAmpl
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user