更新电机工作流程
This commit is contained in:
parent
9d3b9313c9
commit
46c6538c8b
File diff suppressed because one or more lines are too long
@ -37,6 +37,8 @@ void setMotorState(uint8_t motorid,uint8_t act)
|
|||||||
|
|
||||||
#define MOTOR_DELAY_TIME_8S (800)
|
#define MOTOR_DELAY_TIME_8S (800)
|
||||||
#define MOTOR_DELAY_TIME_6S (600)
|
#define MOTOR_DELAY_TIME_6S (600)
|
||||||
|
#define MOTOR_DELAY_TIME_15S (1500)
|
||||||
|
#define MOTOR_DELAY_TIME_17S (1700)
|
||||||
void MotorCtrl(void)//10ms
|
void MotorCtrl(void)//10ms
|
||||||
{
|
{
|
||||||
static uint16_t MotorRunCount;
|
static uint16_t MotorRunCount;
|
||||||
@ -49,10 +51,19 @@ void MotorCtrl(void)//10ms
|
|||||||
break;
|
break;
|
||||||
case ACT_XQ:
|
case ACT_XQ:
|
||||||
MotorRunCount++;
|
MotorRunCount++;
|
||||||
|
if (MotorRunCount > MOTOR_DELAY_TIME_15S)
|
||||||
|
{
|
||||||
|
MotorRunCount = MOTOR_DELAY_TIME_15S;
|
||||||
|
MotorStateReal[MOTOR1] = ACT_NOACT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
MotorStateReal[MOTOR1] = ACT_XQ;
|
MotorStateReal[MOTOR1] = ACT_XQ;
|
||||||
|
}
|
||||||
|
|
||||||
if (MotorRunCount > MOTOR_DELAY_TIME_6S)
|
if (MotorRunCount > MOTOR_DELAY_TIME_6S)
|
||||||
{
|
{
|
||||||
MotorRunCount = MOTOR_DELAY_TIME_6S;
|
//MotorRunCount = MOTOR_DELAY_TIME_6S;
|
||||||
MotorStateReal[MOTOR2] = ACT_XQ;
|
MotorStateReal[MOTOR2] = ACT_XQ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -64,10 +75,19 @@ void MotorCtrl(void)//10ms
|
|||||||
|
|
||||||
case ACT_XH:
|
case ACT_XH:
|
||||||
MotorRunCount++;
|
MotorRunCount++;
|
||||||
|
if (MotorRunCount > MOTOR_DELAY_TIME_17S)
|
||||||
|
{
|
||||||
|
MotorRunCount = MOTOR_DELAY_TIME_17S;
|
||||||
|
MotorStateReal[MOTOR2] = ACT_NOACT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
MotorStateReal[MOTOR2] = ACT_XH;
|
MotorStateReal[MOTOR2] = ACT_XH;
|
||||||
|
}
|
||||||
|
|
||||||
if (MotorRunCount > MOTOR_DELAY_TIME_8S)
|
if (MotorRunCount > MOTOR_DELAY_TIME_8S)
|
||||||
{
|
{
|
||||||
MotorRunCount = MOTOR_DELAY_TIME_8S;
|
//MotorRunCount = MOTOR_DELAY_TIME_8S;
|
||||||
MotorStateReal[MOTOR1] = ACT_XH;
|
MotorStateReal[MOTOR1] = ACT_XH;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user