当前位置:网站首页>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
边栏推荐
- How to choose the appropriate certificate brand when applying for code signing certificate?
- Thymeleaf common functions
- Topology可视化绘图引擎
- How to protect user privacy without password authentication?
- LeetCode_ 2 (add two numbers)
- Introduction, installation, introduction and detailed introduction to postman!
- 外盘入金都不是对公转吗,那怎么保障安全?
- R language ggplot2 visualization: gganimate package is based on Transition_ The time function creates dynamic scatter animation (GIF) and uses shadow_ Mark function adds static scatter diagram as anim
- SaaS multi tenant solution for FMCG industry to build digital marketing competitiveness of the whole industry chain
- 做自媒体视频二次剪辑,怎样剪辑不算侵权
猜你喜欢

非技术部门,如何参与 DevOps?

用 Go 跑的更快:使用 Golang 为机器学习服务

Online electronic component purchasing Mall: break the problem of information asymmetry in the purchasing process, and enable enterprises to effectively coordinate management

一键更改多个文件名字
![[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)

FR练习题目---综合题

How does redis implement multiple zones?

Thymeleaf th:with局部变量的使用

【leetcode周赛总结】LeetCode第 81 场双周赛(6.25)

Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
随机推荐
强联通分量
Topology visual drawing engine
be careful! Software supply chain security challenges continue to escalate
超级哇塞的快排,你值得学会!
【学习笔记】阶段测试1
Faire un clip vidéo auto - média deux fois, comment clip n'est pas considéré comme une infraction
一键更改多个文件名字
leetcode:881. lifeboat
做自媒体视频二次剪辑,怎样剪辑不算侵权
03_ Dataimport of Solr
ASP. Net large takeout ordering system source code (PC version + mobile version + merchant version)
Postgresql 13 安装
PMP考试20天能通过吗?
Thymeleaf th:with局部变量的使用
[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)
mysql8.0JSON_CONTAINS的使用说明
Isn't it right to put money into the external market? How can we ensure safety?
用 Go 跑的更快:使用 Golang 为机器学习服务
手写promise与async await
[learning notes] connectivity and circuit of graph