全功能完成版本V1.0

This commit is contained in:
2025-09-16 12:08:36 +08:00
parent b6be5c1ffe
commit ce198ed458
7 changed files with 187 additions and 97 deletions
+135 -27
View File
@@ -101,9 +101,7 @@
<sRunDeb>0</sRunDeb> <sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime> <sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn> <bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf> <nTsel>2</nTsel>
<bTchkAxf>0</bTchkAxf>
<nTsel>4</nTsel>
<sDll></sDll> <sDll></sDll>
<sDllPa></sDllPa> <sDllPa></sDllPa>
<sDlgDll></sDlgDll> <sDlgDll></sDlgDll>
@@ -114,7 +112,7 @@
<tDlgDll></tDlgDll> <tDlgDll></tDlgDll>
<tDlgPa></tDlgPa> <tDlgPa></tDlgPa>
<tIfile></tIfile> <tIfile></tIfile>
<pMon>Segger\JL2CM3.dll</pMon> <pMon>BIN\CMSIS_AGDI.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
<SetRegEntry> <SetRegEntry>
@@ -130,7 +128,7 @@
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>CMSIS_AGDI</Key> <Key>CMSIS_AGDI</Key>
<Name>UL2CM3(-S0 -C0 -P0 ) -FN2 -FC1000 -FD1FFF8000 -FF0HC32F460_512K -FF1HC32F460_otp -FL080000 -FL13FC -FS00 -FS13000C00 -FP0($$Device:HC32F460JETA$FlashARM\HC32F460_512K.FLM) -FP1($$Device:HC32F460JETA$FlashARM\HC32F460_otp.FLM)</Name> <Name>-X"Any" -UAny -O206 -S9 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD1FFF8000 -FC1000 -FN2 -FF0HC32F460_512K.FLM -FS00 -FL080000 -FP0($$Device:HC32F460JETA$FlashARM\HC32F460_512K.FLM) -FF1HC32F460_otp.FLM -FS13000C00 -FL13FC -FP1($$Device:HC32F460JETA$FlashARM\HC32F460_otp.FLM)</Name>
</SetRegEntry> </SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
@@ -150,25 +148,73 @@
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>DLGUARM</Key> <Key>DLGUARM</Key>
<Name>?</Name> <Name></Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint> <Breakpoint>
<Bp> <Bp>
<Number>0</Number> <Number>0</Number>
<Type>0</Type> <Type>0</Type>
<LineNumber>57</LineNumber> <LineNumber>235</LineNumber>
<EnabledFlag>1</EnabledFlag> <EnabledFlag>1</EnabledFlag>
<Address>30944</Address> <Address>24890</Address>
<ByteObject>0</ByteObject> <ByteObject>0</ByteObject>
<HtxType>0</HtxType> <HtxType>0</HtxType>
<ManyObjects>0</ManyObjects> <ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject> <SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess> <BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount> <BreakIfRCount>1</BreakIfRCount>
<Filename>..\source\Module\dc_motor\dc_motor.c</Filename> <Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand> <ExecCommand></ExecCommand>
<Expression>\\BombSensor\../source/Module/dc_motor/dc_motor.c\57</Expression> <Expression>\\BombSensor\../source/User/Src/main.c\235</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>211</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>24642</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\BombSensor\../source/User/Src/main.c\211</Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>185</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>24380</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\BombSensor\../source/User/Src/main.c\185</Expression>
</Bp>
<Bp>
<Number>3</Number>
<Type>0</Type>
<LineNumber>163</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>24122</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\BombSensor\../source/User/Src/main.c\163</Expression>
</Bp> </Bp>
</Breakpoint> </Breakpoint>
<WatchWindow1> <WatchWindow1>
@@ -210,57 +256,57 @@
<Ww> <Ww>
<count>7</count> <count>7</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>App.ADTrack.LeftUp_Org_AdZero,0x0A</ItemText> <ItemText>LeftSlopeSum,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>8</count> <count>8</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>App.ADTrack.LeftLow_Org_AdZero,0x0A</ItemText> <ItemText>RightSlopeSum,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>9</count> <count>9</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>App.ADTrack.RightUp_Org_AdZero,0x0A</ItemText> <ItemText>LeftDiffSum,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>10</count> <count>10</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>App.ADTrack.RightLow_Org_AdZero,0x0A</ItemText> <ItemText>RightDiffSum,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>11</count> <count>11</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>LeftSlopeSum,0x0A</ItemText> <ItemText>KeyASta</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>12</count> <count>12</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>RightSlopeSum,0x0A</ItemText> <ItemText>KeyBSta</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>13</count> <count>13</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>LeftDiffSum,0x0A</ItemText> <ItemText>DcMotorDispEn</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>14</count> <count>14</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>RightDiffSum,0x0A</ItemText> <ItemText>Olu_diff1,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>15</count> <count>15</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>KeyASta</ItemText> <ItemText>Oll_diff1,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>16</count> <count>16</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>KeyBSta</ItemText> <ItemText>Oru_diff1,0x0A</ItemText>
</Ww> </Ww>
<Ww> <Ww>
<count>17</count> <count>17</count>
<WinNumber>1</WinNumber> <WinNumber>1</WinNumber>
<ItemText>DcMotorDispEn</ItemText> <ItemText>Orl_diff1,0x0A</ItemText>
</Ww> </Ww>
</WatchWindow1> </WatchWindow1>
<Tracepoint> <Tracepoint>
@@ -307,7 +353,6 @@
<pMultCmdsp></pMultCmdsp> <pMultCmdsp></pMultCmdsp>
<DebugDescription> <DebugDescription>
<Enable>1</Enable> <Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
<EnableLog>0</EnableLog> <EnableLog>0</EnableLog>
<Protocol>2</Protocol> <Protocol>2</Protocol>
<DbgClock>5000000</DbgClock> <DbgClock>5000000</DbgClock>
@@ -395,8 +440,6 @@
<sRunDeb>0</sRunDeb> <sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime> <sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn> <bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>-1</nTsel> <nTsel>-1</nTsel>
<sDll></sDll> <sDll></sDll>
<sDllPa></sDllPa> <sDllPa></sDllPa>
@@ -410,7 +453,72 @@
<tIfile></tIfile> <tIfile></tIfile>
<pMon></pMon> <pMon></pMon>
</DebugOpt> </DebugOpt>
<Breakpoint/> <Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>163</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>185</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>211</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>3</Number>
<Type>0</Type>
<LineNumber>235</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\source\User\Src\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<Tracepoint> <Tracepoint>
<THDelay>0</THDelay> <THDelay>0</THDelay>
</Tracepoint> </Tracepoint>
@@ -1058,7 +1166,7 @@
<GroupNumber>3</GroupNumber> <GroupNumber>3</GroupNumber>
<FileNumber>49</FileNumber> <FileNumber>49</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\source\User\Src\Debug.c</PathWithFileName> <PathWithFileName>..\source\User\Src\Debug.c</PathWithFileName>
@@ -1134,7 +1242,7 @@
<GroupNumber>5</GroupNumber> <GroupNumber>5</GroupNumber>
<FileNumber>54</FileNumber> <FileNumber>54</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\source\Module\dc_motor\dc_motor.c</PathWithFileName> <PathWithFileName>..\source\Module\dc_motor\dc_motor.c</PathWithFileName>
+3 -24
View File
@@ -10,7 +10,7 @@
<TargetName>Debug</TargetName> <TargetName>Debug</TargetName>
<ToolsetNumber>0x4</ToolsetNumber> <ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName> <ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed> <pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
<uAC6>0</uAC6> <uAC6>0</uAC6>
<TargetOption> <TargetOption>
<TargetCommonOption> <TargetCommonOption>
@@ -184,8 +184,6 @@
<hadXRAM>0</hadXRAM> <hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam> <uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP> <RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>1</hadIRAM2> <hadIRAM2>1</hadIRAM2>
<hadIROM2>1</hadIROM2> <hadIROM2>1</hadIROM2>
<StupSel>8</StupSel> <StupSel>8</StupSel>
@@ -326,7 +324,6 @@
<uThumb>0</uThumb> <uThumb>0</uThumb>
<uSurpInc>0</uSurpInc> <uSurpInc>0</uSurpInc>
<uC99>1</uC99> <uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO> <useXO>0</useXO>
<v6Lang>3</v6Lang> <v6Lang>3</v6Lang>
<v6LangP>3</v6LangP> <v6LangP>3</v6LangP>
@@ -352,7 +349,7 @@
<NoWarn>0</NoWarn> <NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc> <uSurpInc>0</uSurpInc>
<useXO>0</useXO> <useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt> <uClangAs>0</uClangAs>
<VariousControls> <VariousControls>
<MiscControls></MiscControls> <MiscControls></MiscControls>
<Define></Define> <Define></Define>
@@ -861,8 +858,6 @@
<hadXRAM>0</hadXRAM> <hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam> <uocXRam>0</uocXRam>
<RvdsVP>1</RvdsVP> <RvdsVP>1</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>1</hadIRAM2> <hadIRAM2>1</hadIRAM2>
<hadIROM2>1</hadIROM2> <hadIROM2>1</hadIROM2>
<StupSel>8</StupSel> <StupSel>8</StupSel>
@@ -1003,7 +998,6 @@
<uThumb>0</uThumb> <uThumb>0</uThumb>
<uSurpInc>0</uSurpInc> <uSurpInc>0</uSurpInc>
<uC99>1</uC99> <uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO> <useXO>0</useXO>
<v6Lang>0</v6Lang> <v6Lang>0</v6Lang>
<v6LangP>0</v6LangP> <v6LangP>0</v6LangP>
@@ -1029,7 +1023,7 @@
<NoWarn>0</NoWarn> <NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc> <uSurpInc>0</uSurpInc>
<useXO>0</useXO> <useXO>0</useXO>
<ClangAsOpt>4</ClangAsOpt> <uClangAs>0</uClangAs>
<VariousControls> <VariousControls>
<MiscControls></MiscControls> <MiscControls></MiscControls>
<Define></Define> <Define></Define>
@@ -1376,19 +1370,4 @@
<files/> <files/>
</RTE> </RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project> </Project>
@@ -1,6 +1,6 @@
/* /*
* Auto generated Run-Time-Environment Configuration File * Auto generated Run-Time-Environment Component Configuration File
* *** Do not modify ! *** * *** Do not modify ! ***
* *
* Project: 'HC32F460' * Project: 'HC32F460'
@@ -17,5 +17,4 @@
#define CMSIS_device_header "HC32F460JETA.h" #define CMSIS_device_header "HC32F460JETA.h"
#endif /* RTE_COMPONENTS_H */ #endif /* RTE_COMPONENTS_H */
@@ -34,7 +34,7 @@ void DCMOTORDBGOnOff(uint8_t OnOff)
/* Timer4 CNT */ /* Timer4 CNT */
#define TIMER4_UNIT (M4_TMR41) #define TIMER4_UNIT (M4_TMR41)
#define TIMER4_CNT_CYCLE_VAL (10000u) /* Timer4 counter cycle value */ #define TIMER4_CNT_CYCLE_VAL (500u) /* Timer4 counter cycle value */
/* Timer4 OCO */ /* Timer4 OCO */
#define TIMER4_OCO_HIGH_CH (Timer4OcoOuh) /* only Timer4OcoOuh Timer4OcoOvh Timer4OcoOwh */ #define TIMER4_OCO_HIGH_CH (Timer4OcoOuh) /* only Timer4OcoOuh Timer4OcoOvh Timer4OcoOwh */
@@ -11,9 +11,9 @@
#define TIMER TIMER4 #define TIMER TIMER4
// 电机控制参数 // 电机控制参数
#define PWM_PERIOD TIM_PERIOD // PWM周期值 (ARR) #define PWM_PERIOD TIM_PERIOD // PWM周期值 (ARR)
#define MAX_SPEED 9900 // 最大速度(PWM占空比) #define MAX_SPEED 480 // 最大速度(PWM占空比)
#define ACCEL_STEP 100 // 加速步进值 #define ACCEL_STEP 10 // 加速步进值
#define DECEL_STEP 100 // 减速步进值 #define DECEL_STEP 10 // 减速步进值
#define ACCEL_INTERVAL 2 // 加减速间隔(ms) #define ACCEL_INTERVAL 2 // 加减速间隔(ms)
+1 -1
View File
@@ -12,7 +12,7 @@
#define SLOPE_CNT 40 #define SLOPE_CNT 40
#define STOP_TIME_MS 500 #define STOP_TIME_MS 500
#define RUN_TIME_MS 500 #define RUN_TIME_MS 0
#define BDC_STOP() Motor_Control(MOTOR_CMD_STOP) #define BDC_STOP() Motor_Control(MOTOR_CMD_STOP)
#define BDC_UP() Motor_Control(MOTOR_CMD_FORWARD) #define BDC_UP() Motor_Control(MOTOR_CMD_FORWARD)
+43 -39
View File
@@ -140,15 +140,6 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
App.RightRunFalg = false; App.RightRunFalg = false;
if(LeftSlopeSum > RightSlopeSum && LeftDiffSum > RightDiffSum) if(LeftSlopeSum > RightSlopeSum && LeftDiffSum > RightDiffSum)
{ {
uint32_t UpSlopeSum = abs(App.LeftUpCS1237_SlopeArray[0]) + abs(App.RightUpCS1237_SlopeArray[0]);
uint32_t LowSlopeSum = abs(App.LeftLowCS1237_SlopeArray[0]) + abs(App.RightUpCS1237_SlopeArray[0]);
uint32_t UpDiffSum = abs(lu_diff[0]) + abs(ru_diff[0]);
uint32_t LowDiffSum = abs(ll_diff[0]) + abs(rl_diff[0]);
// if(UpSlopeSum > LowSlopeSum && UpDiffSum > LowDiffSum)
// {
//
// }
App.LeftRunFalg = true; App.LeftRunFalg = true;
if(((App.LeftUpCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT) if(((App.LeftUpCS1237_SlopeArray[0] <= -App.ADTrack.Slope_VPT)
&& (App.LeftUpCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT) && (App.LeftUpCS1237_SlopeArray[1] <= -App.ADTrack.Slope_VPT)
@@ -161,14 +152,17 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
&& (Olu_diff3 >= App.ADTrack.LeftUpVPT) && (Olu_diff3 >= App.ADTrack.LeftUpVPT)
&& (Oll_diff1 <= -App.ADTrack.LeftLowVPT) && (Oll_diff1 <= -App.ADTrack.LeftLowVPT)
&& (Oll_diff2 <= -App.ADTrack.LeftLowVPT) && (Oll_diff2 <= -App.ADTrack.LeftLowVPT)
&& (Oll_diff3 <= -App.ADTrack.LeftLowVPT)) && (Oll_diff3 <= -App.ADTrack.LeftLowVPT)))
)
{ {
BDC_UP(); if((abs(Olu_diff1) > abs(Orl_diff1) + 10000)
App.UpFlag = true; && (abs(Oll_diff1) > abs(Oru_diff1) + 10000))
App.StopFlag = false; {
App.DownFlag = false; BDC_UP();
App.RunCollDelay1mSCnt = RUN_TIME_MS; App.UpFlag = true;
App.StopFlag = false;
App.DownFlag = false;
App.RunCollDelay1mSCnt = RUN_TIME_MS;
}
} }
else if(((App.LeftUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT) else if(((App.LeftUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
&& (App.LeftUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT) && (App.LeftUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
@@ -181,14 +175,17 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
&& (Olu_diff1 <= -App.ADTrack.LeftUpVPT) && (Olu_diff1 <= -App.ADTrack.LeftUpVPT)
&& (Oll_diff1 >= App.ADTrack.LeftLowVPT) && (Oll_diff1 >= App.ADTrack.LeftLowVPT)
&& (Oll_diff1 >= App.ADTrack.LeftLowVPT) && (Oll_diff1 >= App.ADTrack.LeftLowVPT)
&& (Oll_diff1 >= App.ADTrack.LeftLowVPT)) && (Oll_diff1 >= App.ADTrack.LeftLowVPT)))
)
{ {
BDC_DOWN(); if((abs(Oll_diff1) > abs(Oru_diff1) + 10000)
App.DownFlag = true; && (abs(Olu_diff1) > abs(Orl_diff1) + 10000))
App.StopFlag = false; {
App.UpFlag = false; BDC_DOWN();
App.RunCollDelay1mSCnt = RUN_TIME_MS; App.DownFlag = true;
App.StopFlag = false;
App.UpFlag = false;
App.RunCollDelay1mSCnt = RUN_TIME_MS;
}
} }
} }
else if(LeftSlopeSum < RightSlopeSum && LeftDiffSum < RightDiffSum) else if(LeftSlopeSum < RightSlopeSum && LeftDiffSum < RightDiffSum)
@@ -205,14 +202,17 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
&& (Oru_diff3 >= App.ADTrack.RightUpVPT) && (Oru_diff3 >= App.ADTrack.RightUpVPT)
&& (Orl_diff1 <= -App.ADTrack.RightLowVPT) && (Orl_diff1 <= -App.ADTrack.RightLowVPT)
&& (Orl_diff2 <= -App.ADTrack.RightLowVPT) && (Orl_diff2 <= -App.ADTrack.RightLowVPT)
&& (Orl_diff3 <= -App.ADTrack.RightLowVPT)) && (Orl_diff3 <= -App.ADTrack.RightLowVPT)))
)
{ {
BDC_UP(); if((abs(Orl_diff1) > abs(Olu_diff1) + 10000)
App.UpFlag = true; && (abs(Oru_diff1) > abs(Oll_diff1) + 10000))
App.StopFlag = false; {
App.DownFlag = false; BDC_UP();
App.RunCollDelay1mSCnt = RUN_TIME_MS; App.UpFlag = true;
App.StopFlag = false;
App.DownFlag = false;
App.RunCollDelay1mSCnt = RUN_TIME_MS;
}
} }
else if(((App.RightUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT) else if(((App.RightUpCS1237_SlopeArray[0] >= App.ADTrack.Slope_VPT)
&& (App.RightUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT) && (App.RightUpCS1237_SlopeArray[1] >= App.ADTrack.Slope_VPT)
@@ -228,11 +228,15 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
&& (Orl_diff3 >= App.ADTrack.RightLowVPT)) && (Orl_diff3 >= App.ADTrack.RightLowVPT))
) )
{ {
BDC_DOWN(); if((abs(Oru_diff1) > abs(Oll_diff1) + 10000)
App.DownFlag = true; && (abs(Orl_diff1) > abs(Olu_diff1) + 10000))
App.StopFlag = false; {
App.UpFlag = false; BDC_DOWN();
App.RunCollDelay1mSCnt = RUN_TIME_MS; App.DownFlag = true;
App.StopFlag = false;
App.UpFlag = false;
App.RunCollDelay1mSCnt = RUN_TIME_MS;
}
} }
} }
} }
@@ -543,10 +547,10 @@ static void AppLoopHandler(void)
App.EvenRunning = false; App.EvenRunning = false;
App.ADTrack.Slope_VPT = 2000; App.ADTrack.Slope_VPT = 2000;
App.ADTrack.LeftUpVPT = 10000; App.ADTrack.LeftUpVPT = 40000;
App.ADTrack.LeftLowVPT = 10000; App.ADTrack.LeftLowVPT = 40000;
App.ADTrack.RightUpVPT = 10000; App.ADTrack.RightUpVPT = 40000;
App.ADTrack.RightLowVPT = 10000; App.ADTrack.RightLowVPT = 40000;
App.ADTrack.LeftUp_Org_AdZero = App.LeftUpCS1237_TrendArray[0]; App.ADTrack.LeftUp_Org_AdZero = App.LeftUpCS1237_TrendArray[0];
App.ADTrack.LeftLow_Org_AdZero = App.LeftLowCS1237_TrendArray[0]; App.ADTrack.LeftLow_Org_AdZero = App.LeftLowCS1237_TrendArray[0];