当前位置:网站首页>Drive brushless DC motor based on Ti drv10970
Drive brushless DC motor based on Ti drv10970
2022-07-05 14:34:00 【No martial arts, no understanding of the Jianghu】
Preface
I took over a project in the laboratory before , Need to use TI Of DRV10970 Chip to drive brushless DC motor with Hall feedback , The motor has been switched on these days , So write an article to record .
About the drive mode of Brushless DC motor , I don't want to go into details ,CSDN There are a lot of them , I'll just say based on TI Of DRV10970 Chip to drive brushless DC motor .
One 、TI DRV10970
1. Introduce
DRV10970 It is an integrated three-phase BLDC Motor driver , Suitable for household appliances 、 Cooling fans and other general motor controls application . The device has built-in intelligent features , And it has a small shape and simple pin distribution structure , It not only reduces the design complexity 、 The circuit board space is saved , And it also reduces the system cost . The integrated protection function improves the robustness and reliability of the system .
This means that we don't need to process Hall signals , The chip will automatically process the hall signal , We just need to output PWM And setting some pins can drive the brushless DC motor .
2. Pin Introduction
name | describe |
---|---|
CPN | Charge pump switching node,Connect a 0.1-µF X7R capacitor rated for VM between CPN and CPP |
CPP | Charge pump switching node,Connect a 0.1-µF X7R capacitor rated for VM between CPN and CPP |
VCP | Charge pump output,Connect a 16-V, 1-µF ceramic capacitor to VM |
GND | Device ground,Must be connected to board ground |
VINT | Integrated regulator output,Integrated regulator (typical voltage 5 V) mainly for internal circuits; Provide external power for less than 20 mA. Bypass to GND with a 10-V, 2.2-µF ceramic capacitor |
VM | Power supply |
CS | Current limit setting pin |
DAA | Drive angle adjustment configuration pin,Low: 10° drive angle adjustment,High: 5° drive angle adjustment,Floating: adaptive drive angle adjustment |
FG | Frequency indication pin,Open drain Electrical Frequency Output pin. One toggle per electrical cycle. Requires an external pull-up of 3.3-kΩ. |
FR | Motor direction control,Direction Control Input.When low, phase driving sequence is U → V → W ( U phase is leading V phase by 120°).When high, the phase driving sequence is U → W → V. |
BRKMOD | Brake mode setting,Low: Coasting mode (phases are tri-stated),High: Brake mode (phases are driven low) |
PWM | Variable duty cycle PWM input for speed control |
RD | Lock indication pin |
RETRY | Auto retry timing configure |
CMTMOD | Commutation mode setting,Low: Sinusoidal operation mode with 0° Hall placement,High: Sinusoidal operation mode with 30° Hall placement,Floating: Trapezoidal operation mode with 30° Hall placement |
We only need to pay special attention to a few of the above pins , Including pulse width modulation (PWM) Input ( Speed command )、FG Output ( Speed feedback )、FR Input ( Forward and reverse control ) as well as RD Output ( Motor lock indication ).
FG and RD yes DRV10970 Feedback to MCU The signal of
CMTMOD Is the setting mode , Generally will CMTMOD Setting low level is sinusoidal mode 0° Place hall element ,
BRKMOD Is the braking mode setting , take BRKMOD The pin is set to low level , Even if BRKMOD The motor set to high level will not brake , Because this pin is used to set the braking mode , Instead of directly braking the motor , Only power off or will PWM Set to 0 Before you can brake .
DAA Is the angle setting of the drive motor , Set it to float , Floating is the adaptive angle to drive the motor
PWM It's the connection MCU Of PWM Output pins ,PWM The frequency of is 15Khz-100Khz.
Two 、 Use steps
1. Program
So it's using DRV10970 when , We need to PWM,FR,BM,CM,DAA Just set it up , I use two chips here to drive two motors
void PWM_Configuration(u16 arr,u16 pre)
{
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_OCInitTypeDef TIM_OCInitStructure;
// TIM_BDTRInitTypeDef TIM_BDTRInitStructure;
RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC |RCC_AHB1Periph_GPIOD, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM12, ENABLE);
GPIO_PinAFConfig(GPIOB,GPIO_PinSource14,GPIO_AF_TIM12); //PB14 Reuse TIM12
GPIO_PinAFConfig(GPIOB,GPIO_PinSource15,GPIO_AF_TIM12); //PB14 Reuse TIM12
// PWM
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_15; //
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; // Multiplexing push pull output
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; // Pull up
GPIO_Init(GPIOB,&GPIO_InitStructure); // initialization PB14
//M1
//GPIO DAA In the air M2 PD14--DAA
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_14 ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;// Normal input mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;// Floating space
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 ; //GPIO_Pin_11
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal output mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;// Push pull output
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;// Pull up
GPIO_Init(GPIOB, &GPIO_InitStructure);// initialization GPIOD
//GPIO M1--PD12--CM
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_15 ; //M2 PD15--FR
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal output mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;// Push pull output
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;// Pull up
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
//GPIO M2--PA12--CM M2-PA11-BM
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12 ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal output mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;// Push pull output
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;// Pull up
GPIO_Init(GPIOA, &GPIO_InitStructure);// initialization GPIOD
//GPIO //FG and RD all feedback
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9| GPIO_Pin_13; // Input
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;// Normal input mode
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
//GPIO // M2--PC8--RD M2--FG--PC14
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_14; // Input
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;// Normal input mode
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//
GPIO_Init(GPIOC, &GPIO_InitStructure);// initialization GPIOD
//GPIO // CMTMOD--PD10
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10|GPIO_Pin_11; // Input
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal input mode
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;//
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
TIM_TimeBaseStructure.TIM_Period= arr-1;
TIM_TimeBaseStructure.TIM_Prescaler= pre-1;
TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_ClockDivision=TIM_CKD_DIV1;
TIM_TimeBaseInit(TIM12,&TIM_TimeBaseStructure); //TIM12
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
// TIM_DeInit(TIM12);
TIM_OC1Init(TIM12, &TIM_OCInitStructure);// Initialize peripherals TIM1 OC1--OC4
TIM_OC2Init(TIM12, &TIM_OCInitStructure);
TIM_OC3Init(TIM12, &TIM_OCInitStructure);
TIM_OC4Init(TIM12, &TIM_OCInitStructure);
TIM_OC1PreloadConfig(TIM12, TIM_OCPreload_Enable);// Enable preload register
TIM_OC2PreloadConfig(TIM12, TIM_OCPreload_Enable);
TIM_OC3PreloadConfig(TIM12, TIM_OCPreload_Enable);
TIM_OC4PreloadConfig(TIM12, TIM_OCPreload_Enable);
TIM_ARRPreloadConfig(TIM12,ENABLE);
TIM_Cmd(TIM12, ENABLE);
//M1
// PD12--CM
GPIO_ResetBits(GPIOD, GPIO_Pin_10 );//PD10---FR PD11---BM
GPIO_SetBits(GPIOD, GPIO_Pin_12 );// PD12--CM
//M2
GPIO_ResetBits(GPIOA, GPIO_Pin_11 );// PA11--BM
GPIO_SetBits(GPIOA, GPIO_Pin_12 );// PD12--CM
}
3、 ... and . How to judge when the chip is damaged
When VM for 12V When electricity is on , If VINT No, 5V Output , It can be considered that the chip is broken
边栏推荐
- 最长公共子序列 - 动态规划
- Fonctions communes de thymeleaf
- Online electronic component purchasing Mall: break the problem of information asymmetry in the purchasing process, and enable enterprises to effectively coordinate management
- mysql8.0JSON_CONTAINS的使用说明
- PHP - fatal error: allowed memory size of 314572800 bytes exhausted
- 面试突击62:group by 有哪些注意事项?
- R language ggplot2 visualization: visual line graph, using legend in theme function The position parameter defines the position of the legend
- C language -- structure and function
- 【招聘岗位】软件工程师(全栈)- 公共安全方向
- 2022年国内正规的期货公司平台有哪些啊?方正中期怎么样?安全可靠吗?
猜你喜欢
周大福践行「百周年承诺」,真诚服务推动绿色环保
选择排序和冒泡排序
实现一个博客系统----使用模板引擎技术
如何将电脑复制的内容粘贴进MobaXterm?如何复制粘贴
How to protect user privacy without password authentication?
Thymeleaf 使用后台自定义工具类处理文本
申请代码签名证书时如何选择合适的证书品牌?
快消品行业SaaS多租户解决方案,构建全产业链数字化营销竞争力
Solution of commercial supply chain collaboration platform in household appliance industry: lean supply chain system management, boosting enterprise intelligent manufacturing upgrading
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
随机推荐
Microframe technology won the "cloud tripod Award" at the global Cloud Computing Conference!
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
Thymeleaf th:classappend属性追加 th:styleappend样式追加 th:data-自定义属性
03_ Dataimport of Solr
用 Go 跑的更快:使用 Golang 为机器学习服务
Isn't it right to put money into the external market? How can we ensure safety?
周大福践行「百周年承诺」,真诚服务推动绿色环保
微帧科技荣获全球云计算大会“云鼎奖”!
Matrix chain multiplication dynamic programming example
Loop invariant
js亮瞎你眼的日期选择器
CPU设计实战-第四章实践任务二用阻塞技术解决相关引发的冲突
最长公共子序列 - 动态规划
Sharing the 12 most commonly used regular expressions can solve most of your problems
注意!软件供应链安全挑战持续升级
分享 12 个最常用的正则表达式,能解决你大部分问题
在Pytorch中使用Tensorboard可视化训练过程
黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,
两个BI开发,3000多张报表?如何做的到?
Show strength. In this way, the mobile phone will not be difficult to move forward