调整电机线序及采样电阻
This commit is contained in:
parent
2638a07571
commit
f637bdbf48
@ -25,8 +25,8 @@
|
||||
<MemConfigValue>E:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0144.ddf</MemConfigValue>
|
||||
</PlDriver>
|
||||
<ArmDriver>
|
||||
<EnableCache>0</EnableCache>
|
||||
<EnforceMemoryConfiguration>1</EnforceMemoryConfiguration>
|
||||
<EnableCache>0</EnableCache>
|
||||
</ArmDriver>
|
||||
<DebugChecksum>
|
||||
<Checksum>1315671368</Checksum>
|
||||
|
File diff suppressed because one or more lines are too long
@ -707,37 +707,37 @@ void CurrentDetect(void)
|
||||
|
||||
static uint16_t getOverCurrentTh(uint8_t ch)
|
||||
{
|
||||
uint16_t th = 50;
|
||||
uint16_t th = 100;
|
||||
switch (ch)
|
||||
{
|
||||
case 0:
|
||||
if (MotorStateReal[MotorHG]!=Motor_ACT_NOACT)
|
||||
{
|
||||
th+=50;
|
||||
th+=100;
|
||||
}
|
||||
if (MotorStateReal[MotorKB]!=Motor_ACT_NOACT)
|
||||
{
|
||||
th+=50;
|
||||
th+=100;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (MotorStateReal[MotorTT]!=Motor_ACT_NOACT)
|
||||
{
|
||||
th+=50;
|
||||
th+=100;
|
||||
}
|
||||
if (MotorStateReal[MotorZY]!=Motor_ACT_NOACT)
|
||||
{
|
||||
th+=50;
|
||||
th+=100;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (MotorStateReal[Motor5]!=Motor_ACT_NOACT)
|
||||
{
|
||||
th+=50;
|
||||
th+=100;
|
||||
}
|
||||
if (MotorStateReal[Motor6]!=Motor_ACT_NOACT)
|
||||
{
|
||||
th+=20;
|
||||
th+=100;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -16,7 +16,7 @@
|
||||
#define PDB_BB_SEL (0u) //000b : PDB0 and PDB1 operates independently.
|
||||
#define DMA_CHANNEL0 0
|
||||
#define DMA_CHANNEL1 1
|
||||
#define PWM_PERIOD_HZ 2000
|
||||
#define PWM_PERIOD_HZ 100
|
||||
/*******************************************************************************
|
||||
* the typedefs
|
||||
******************************************************************************/
|
||||
@ -268,8 +268,8 @@ static void PWM_Init(void)
|
||||
PwmLiteDrv_GetDefaultChannelConfig(&channelConfig);
|
||||
channelConfig.pwmMuxType.channelNumber = PWMLITEDRV_MUX_PWM0_CH0;
|
||||
channelConfig.pwmMuxType.padNumber = PWMLITEDRV_MUX_PAD_PWM4;
|
||||
channelConfig.behavior0 = PWMLITEDRV_HIGH_AT_REACH;
|
||||
channelConfig.behavior1 = PWMLITEDRV_LOW_AT_REACH;
|
||||
channelConfig.behavior0 = PWMLITEDRV_LOW_AT_REACH;
|
||||
channelConfig.behavior1 = PWMLITEDRV_HIGH_AT_REACH;
|
||||
channelConfig.threshold0 = 0;
|
||||
channelConfig.threshold1 = 0;
|
||||
PwmLiteDrv_ConfigChannel(&mcu.pwmLiteDrv0, PWMLITEDRV_PWM_CH0, &channelConfig);
|
||||
@ -546,11 +546,11 @@ void hw_MotorCtrl(Motor_ID_Type motorid,Motor_ACT_Type dir)
|
||||
PinsDrv_ClearPin(&mcu.ptd, 0);
|
||||
PinsDrv_ClearPin(&mcu.ptd, 1);
|
||||
break;
|
||||
case Motor_ACT_CW:
|
||||
case Motor_ACT_CCW:
|
||||
PinsDrv_SetPin(&mcu.ptd, 0);
|
||||
PinsDrv_ClearPin(&mcu.ptd, 1);
|
||||
break;
|
||||
case Motor_ACT_CCW:
|
||||
case Motor_ACT_CW:
|
||||
PinsDrv_SetPin(&mcu.ptd, 1);
|
||||
PinsDrv_ClearPin(&mcu.ptd, 0);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user