更新阈值设置
This commit is contained in:
parent
6210e22544
commit
dd1851d360
File diff suppressed because one or more lines are too long
@ -132,15 +132,28 @@ void MotorCtrl(void)//10ms
|
|||||||
MOTOR2Ctrl(MotorStateReal[MOTOR2]);
|
MOTOR2Ctrl(MotorStateReal[MOTOR2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t getOC_th(void)
|
||||||
|
{
|
||||||
|
if (MotorStateReal[MOTOR1] != ACT_NOACT)
|
||||||
|
{
|
||||||
|
return 70U;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 60U;
|
||||||
|
}
|
||||||
|
//return 50U;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CurrentDetecte(void)
|
void CurrentDetecte(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
static uint16_t OC_Count1=0;
|
static uint16_t OC_Count1=0;
|
||||||
|
uint16_t OC_th;
|
||||||
current1 = getAdval(ADCH_RLY1);
|
current1 = getAdval(ADCH_RLY1);
|
||||||
|
OC_th = getOC_th();
|
||||||
if (current1 > 100U && OC1flag == 0)
|
if (current1 > OC_th && OC1flag == 0)
|
||||||
{
|
{
|
||||||
OC_Count1++;
|
OC_Count1++;
|
||||||
if (OC_Count1 >= 200)
|
if (OC_Count1 >= 200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user