当前位置:网站首页>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
边栏推荐
- 网上电子元器件采购商城:打破采购环节信息不对称难题,赋能企业高效协同管理
- 【leetcode周赛总结】LeetCode第 81 场双周赛(6.25)
- Geom of R language using ggplot2 package_ Histogram function visual histogram (histogram plot)
- The function of qualifier in C language
- 微帧科技荣获全球云计算大会“云鼎奖”!
- useMemo,memo,useRef等相关hooks详解
- FR练习题目---综合题
- mysql8.0JSON_ Instructions for using contains
- C language -- structure and function
- APR protocol and defense
猜你喜欢

有一个强大又好看的,赛过Typora,阿里开发的语雀编辑器

申请代码签名证书时如何选择合适的证书品牌?

CyCa children's physical etiquette Ningbo training results assessment came to a successful conclusion

ASP.NET大型外卖订餐系统源码 (PC版+手机版+商户版)

黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,

Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)

Penetration testing methodology

Thymeleaf th:with局部变量的使用
![[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)](/img/d7/f49bca8da2ce286c18508325985990.png)
[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)

家用电器行业商业供应链协同平台解决方案:供应链系统管理精益化,助推企业智造升级
随机推荐
非技术部门,如何参与 DevOps?
Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection
openGauss数据库源码解析系列文章—— 密态等值查询技术详解(下)
家用电器行业商业供应链协同平台解决方案:供应链系统管理精益化,助推企业智造升级
Which Internet companies are worth going to in Shenzhen for software testers [Special Edition for software testers]
dynamic programming
网上电子元器件采购商城:打破采购环节信息不对称难题,赋能企业高效协同管理
PostgreSQL 13 installation
Why do mechanical engineers I know complain about low wages?
TS所有dom元素的类型声明
Thymeleaf th:classappend attribute append th:styleappend style append th:data- custom attribute
MySQL user-defined function ID number to age (supports 15 / 18 digit ID card)
Google eventbus usage details
What about SSL certificate errors? Solutions to common SSL certificate errors in browsers
How to protect user privacy without password authentication?
Time to calculate cron expression based on cronsequencegenerator
R language uses the multinom function of NNET package to build an unordered multi classification logistic regression model, and uses the coef function to obtain the log odds ratio corresponding to eac
There is a powerful and good-looking language bird editor, which is better than typora and developed by Alibaba
Thymeleaf 常用函数
FR练习题目---简单题