0% found this document useful (0 votes)
40 views15 pages

Speed Estimator

The document discusses using a model based design toolbox to enable fast prototyping. It describes using a Hall sensor to estimate motor speed based on measuring the period of the Hall signal. FreeMASTER can be used over CAN to test the speed estimator in an open loop control. The document provides background on calculating motor speed from the Hall signal and implementing the speed estimator using a software approach. It also describes setting up FreeMASTER over CAN using an external termination resistor. In conclusion, the reader is encouraged to design their next project using these tools and techniques.

Uploaded by

Fatih
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views15 pages

Speed Estimator

The document discusses using a model based design toolbox to enable fast prototyping. It describes using a Hall sensor to estimate motor speed based on measuring the period of the Hall signal. FreeMASTER can be used over CAN to test the speed estimator in an open loop control. The document provides background on calculating motor speed from the Hall signal and implementing the speed estimator using a software approach. It also describes setting up FreeMASTER over CAN using an external termination resistor. In conclusion, the reader is encouraged to design their next project using these tools and techniques.

Uploaded by

Fatih
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

MODEL BASED DESIGN TOOLBOX

ENABLING FAST PROTOTYPING AND DESIGN

• Speed Estimation based on Hall Sensor


• Create Simulink model for Speed Estimator
• Test Speed Estimator in Open Loop Control with FreeMASTER via CAN

EXTERNAL USE
Application mapping: SW vs. HW
MotorGD DevKit 3-phase Inverter

MISO/MOSI/SCLK/CS
MC34GD3000
pre-driver
EN RST

Vdc Idc
ADC SPI GPIO
ADC
Initialization
GPIO HS LS HS LS HS LS
1 2 3 4 5 6
Desired PWM
Speed + Speed PI Duty cycle ON
FlexPWM Protection
-
Controller OFF
SVM
FreeMASTER

UART
DIR BLDC commutation LED
CW/CCW Control Sequence GPIO
CAN Position
Motor Hall A
Actual Speed Hall Measure Hall Time & Hall B
OpenSDA 1/T counts Position Recognition
eTIMER Hall C

1 MPC5744P
EXTERNAL USE DevKit
Motor Speed – Technical Background

Hall Effect Sensor

T=1/f

2 EXTERNAL USE
Motor Speed – Technical Background

Hall Effect Sensor

T=1/f

60 ∙ 𝑓
𝑁𝑠 =
𝑝
• Ns – rotor speed in RPM

3 EXTERNAL USE
Motor Speed – Technical Background

Hall Effect Sensor

T=1/f

60 ∙ 𝑓
𝑁𝑠 =
𝑝
• Ns – rotor speed in RPM
• f – frequency in cycles per seconds (Hz)

4 EXTERNAL USE
Motor Speed – Technical Background

Hall Effect Sensor

T=1/f

60 ∙ 𝑓
𝑁𝑠 =
𝑝
• Ns – rotor speed in RPM
• f – frequency in cycles per seconds (Hz)
• p – number of pole pairs

5 EXTERNAL USE
Speed Estimator Prerequisites

6 EXTERNAL USE
Speed Estimator Prerequisites
1. Need a “well defined” periodic signal

HALL A

HALL B

HALL C

0° 60° 120° 180° 240° 300°


HALL STATE = 2 HALL STATE = 6 HALL STATE = 4 HALL STATE = 5 HALL STATE = 1 HALL STATE = 3

SECTOR = A SECTOR = B SECTOR = C SECTOR = D SECTOR = E SECTOR = F

7 EXTERNAL USE
Speed Estimator Prerequisites
1. Need a “well defined” periodic signal
2. Detect the periodic signal transitions

HALL A

HALL B

HALL C

0° 60° 120° 180° 240° 300°


HALL STATE = 2 HALL STATE = 6 HALL STATE = 4 HALL STATE = 5 HALL STATE = 1 HALL STATE = 3

SECTOR = A SECTOR = B SECTOR = C SECTOR = D SECTOR = E SECTOR = F

8 EXTERNAL USE
Speed Estimator Prerequisites
1. Need a “well defined” periodic signal
2. Detect the periodic signal transitions
3. Need a simple counter to measure between signal transitions

HALL A

HALL B

HALL C

0° 60° 120° 180° 240° 300°


HALL STATE = 2 HALL STATE = 6 HALL STATE = 4 HALL STATE = 5 HALL STATE = 1 HALL STATE = 3

SECTOR = A SECTOR = B SECTOR = C SECTOR = D SECTOR = E SECTOR = F

No of Counts
Counting
Window

9 EXTERNAL USE 180° electrical degrees period


Speed Estimator Implementation
• There are multiple approaches to measure the speed: HW or SW based
• We are going to use a SW based approach – measuring the period of the HALL A active HIGH signal

10 EXTERNAL USE
Speed Estimator Implementation
• There are multiple approaches to measure the speed: HW or SW based
• We are going to use a SW based approach – measuring the period of the HALL A active HIGH signal

360° electrical degrees period


1. Hall signal semi-period calculation
HALL A
𝑇ℎ = 𝑇𝑄 ∙ 𝑁𝐶 (eq. 1)
0° 60° 120° 180° 240° 300°

2. 360 electrical degrees period calculation


𝑇 = 2 ∙ 𝑇ℎ (eq. 2) TQ
NC
(time quanta)
Counting (no. of counts)
3. Hall signal frequency Window
𝑓 = 1/𝑇 (eq. 3)
180° electrical degrees period

Th
4. Estimated Speed
𝑓 T = 2 • Th
𝑁𝑠 = 60 ∙ ൗ𝑝 (eq. 4)

11 EXTERNAL USE
FreeMASTER over CAN
• UART1(routed via OpenSDA micro USB port) shares the same pins as FET pre-driver
• Enable FreeMASTER to use the CAN0 interface

• NOTE! R38 is not places on the PCB. An external 120Ohm CAN termination resistor must be placed between
CAN-H and CAN-L signals

12 EXTERNAL USE
FreeMASTER over CAN - Setup

CAN-H CAN-L GND

13 EXTERNAL USE
MODEL BASED DESIGN TOOLBOX
ENABLING FAST PROTOTYPING AND DESIGN

…you are now ready to design the next big thing. Good luck!

Need help? Visit us at: https://community.nxp.com/community/mbdt to share ideas

EXTERNAL USE

You might also like