直流电机控制的单极性和双极性对比

讲之前先推荐一篇别人的文章,里边把单极性和双极性说的很清楚,

浅谈PWM控制电机 - gtkknd的专栏 - CSDN博客  https://blog.csdn.net/gtkknd/article/details/77714859,

头一次听说双极性控制我很吃惊,这电路怎么能控制电机,别人讲的头头是道,我搭了个电路实际测试,先上图,原理图,搭的电路,还有电机(N20带编码器)。

直流电机控制的单极性和双极性对比_第1张图片

直流电机控制的单极性和双极性对比_第2张图片

直流电机控制的单极性和双极性对比_第3张图片

void TIM8_PWM_Config(void)
{
  GPIO_InitTypeDef GPIO_InitStructure;
	TIM_TimeBaseInitTypeDef   TIM_TimeBaseInitStructure;
	TIM_OCInitTypeDef         TIM_OCInitStructure;
	TIM_BDTRInitTypeDef       TIM_BDTRInitStructure;
	
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE);
	
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6|GPIO_Pin_7;   //TIM8_1、TIM8_2的PWM输出
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(GPIOC, &GPIO_InitStructure);
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;   //TIM8_1N的PWM输出
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(GPIOA, &GPIO_InitStructure);
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;   //TIM8_2N的PWM输出
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(GPIOB, &GPIO_InitStructure);
	
	TIM_DeInit(TIM8);
	TIM_TimeBaseInitStructure.TIM_Prescaler=0;
	TIM_TimeBaseInitStructure.TIM_Period=5000-1;  //14.4KHz
	TIM_TimeBaseInitStructure.TIM_CounterMode=TIM_CounterMode_Up;
	TIM_TimeBaseInitStructure.TIM_ClockDivision=TIM_CKD_DIV1;
	TIM_TimeBaseInit(TIM8, &TIM_TimeBaseInitStructure);
	
	TIM_OCInitStructure.TIM_OCMode=TIM_OCMode_PWM1;
	TIM_OCInitStructure.TIM_OutputState=TIM_OutputState_Enable;
	TIM_OCInitStructure.TIM_OutputNState=TIM_OutputNState_Enable;
	TIM_OCInitStructure.TIM_Pulse=0;
	TIM_OCInitStructure.TIM_OCPolarity=TIM_OCPolarity_High;
	TIM_OCInitStructure.TIM_OCNPolarity=TIM_OCNPolarity_High;
	TIM_OCInitStructure.TIM_OCIdleState=TIM_OCIdleState_Reset;
	TIM_OCInitStructure.TIM_OCNIdleState=TIM_OCNIdleState_Reset;
	TIM_OC1Init(TIM8,&TIM_OCInitStructure);
	TIM_OC2Init(TIM8,&TIM_OCInitStructure);
	
	TIM_BDTRInitStructure.TIM_OSSRState=TIM_OSSRState_Enable;
	TIM_BDTRInitStructure.TIM_OSSIState=TIM_OSSIState_Enable;
	TIM_BDTRInitStructure.TIM_LOCKLevel=TIM_LOCKLevel_OFF;
	TIM_BDTRInitStructure.TIM_DeadTime=0x48;  //13.89ns*72=1us
	TIM_BDTRInitStructure.TIM_Break=TIM_Break_Disable;                     //刹车功能
	TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High;      //刹车输入高电平有效
	TIM_BDTRInitStructure.TIM_AutomaticOutput=TIM_AutomaticOutput_Enable;  //自动输出使能
	TIM_BDTRConfig(TIM8,&TIM_BDTRInitStructure);
	
	TIM_OC1PreloadConfig(TIM8,TIM_OCPreload_Enable);
	TIM_OC2PreloadConfig(TIM8,TIM_OCPreload_Enable);

	TIM_ARRPreloadConfig(TIM8,ENABLE);
  TIM_Cmd(TIM8,ENABLE);
	TIM_CCPreloadControl(TIM8,DISABLE);  //ENABLE
	TIM_CtrlPWMOutputs(TIM8,ENABLE);
}

测试结果如下:

1、PWM1固定50%占空比,PWM2小于50%反转,大于50%正转,
2、PWM2=100%,正转最大速度6310RPM,空载37.7mA,扭矩还行,堵转131mA,
3、PWM2=0,反转最大速度6550RPM,空载33.2mA,
4、PWM1=PWM2=50%,电机静止,电流24.2mA,
5、PWM2=2000,反转960RPM,空载电流36mA,扭矩非常小,堵转38.9mA,
6、占空比为0,电流为0。

7、PWM1=0,
    PWM2=1000,正转2350RPM,电流20.6mA
    PWM2=2000,正转5140RPM,电流28.6mA
    PWM2=3000,正转7830RPM,电流37.0mA
    PWM2=4000,正转10650RPM,电流45.4mA
    PWM2=5000,正转13500RPM,电流39.2mA,力矩最大,堵转0.44A。


双极性的最高速度达不到最高,输出力矩小,但是据说双极性电机反应快,
双极性适合低速,小扭矩,频繁启停的场合,比如平衡车,
底盘控制还是单极性效率更高,
互补PWM,可以通过把一路输出固定为0转换为单极性控制,其正反转性能一致,这样的实际意义就是可以用无刷电机的控制电路控制有刷电机。

你可能感兴趣的:(直流电机控制的单极性和双极性对比)