AN2513

By Milan Brejl, Ph.D.
Functional Overview
The 3-phase Hall Sensor Decoder (3HD) TPU Function is useful for decoding information from a Hall sensor signal in a motion control system. The function uses three input channels to obtain this information for the CPU:•position in one of six sectors,
•direction,
•period of last revolution updated 6-times per revolution,•
revolution counter.Figure 1 illustrates the functionality.
Figure 1. Signals processed by 3HD TPU function and corresponding values
F r e e s c a l e  S e m i c o n d u c t o r , I
n c .©Freescale Semiconductor, Inc., 2004. All rights reserved.
Function Configuration
Unlike most of the functions in the MC TPU Library, the 3HD is single-function, and not a member of a function set. There are no restrictions on channel assigment – it can run on any three channels.
Table 1 shows the configuration options and restrictions.
openapiThe three Hall sensor signals are called Phase A, Phase B and Phase C. The
Host Sequence (HSQ) bit 0 is used to determine Phase C, which updates the revolution counter in addition to other processing activities common to all phases. The HSQ is also used for other configur
ation options – refer to the detailed function descriptions.
Table 2 shows an example of configuration. The Phase A signal is connected to channel 0, Phase B to channel 1 and Phase C to channel 2. The TCR1 clock is selected for all timing operations.
In this configuration, when no other functions run on the same TPU, the 3HD can receive and process input transitions at a rate of up to 690 kcounts per second at 40MHz IMB clock.
Table 1. 3HD TPU function configuration options and restrictions
TPU function How many
channels
Assignable channels
3HD
3any 3 channels
Table 2. Example of configuration
Channel
TPU function
HSQ Priority 03HD 00middle 13HD 00middle 2
3HD
01
middle
F r e e s c a l e  S e m i c o n d u c t o r , I
n c .
AN2513/D
Function Configuration
Table 3 shows the TPU function code sizes.
Configuration Order The CPU configures the TPU as follows.
1.Disables the channels by clearing the two channel priority bits on each
channel used (not necessary after reset).
蝉式2.Selects the channel functions on all used channels by writing the
function numbers to the channel function select bits.3.Initializes function parameters. The parameters PinAdrPrev_A,
PinAdrNext_A, PinAdrPrev_B, PinAdrNext_B and RC initialization value must be set before initialization.4.Set the HSQ (Host Sequence) bits to identify Phase C channel and to
select TCR1 or TCR2 clock. The clock selection must be the same on all channels.
5.Issues an HSR (Host Service Request) type %10 all 3HD channels to
initialize decoding.
6.Enables servicing by assigning high, middle or low priority to the channel
priority bits. All Phase A, Phase B and Phase C channels should be assigned the same priority.
NOTE:
A CPU routine that configures the TPU can be generated automatically using the MPC500_Quick_Start Graphical Configuration Tool.
Table 3. TPU function code sizes
TPU function
Code size
3HD
63 µ instructions + 8 entries = 71 long words
F r e e s c a l e  S e m i c o n d u c t o r , I
n c .
Detailed Function Description
3-phase Hall Sensor Decoder (3HD)
The 3HD operates on three channels and processes the incoming Hall sensor signals. As a result of this processing, the Sector parameter gets a value that reflects the position of a motion system in one of six sectors. The state of the Hall sensor signals and the corresponding Sector value is listed in Table 4.
Table 4. Hall sensor signal states and corresponding Sector value
A Sector value of 0 or 7 indicates an illegal state of the Hall sensor signals.The Sector value history determines the direction of the motion system. The Direction parameter can be assigned a value of 0 or 1. See Table 5.Table 5. Sector value sequence and corresponding Direction value
The Period value is calculated each time the sector is changed. The Period value is the TCR time of last revolution. It is measured from the last edge of similar type (low-high / high-low), on the same channel, to the current edge – see Figure 1 and Figure 2. This method eliminates inaccuracies in the Hall sensor signals. The Period parameter does not contain a valid value during the first revolution after initialization, or after a change of direction.
Phase A
Phase B
Phase C
Sector 10041106010201130011101500001117
Sector value sequence Direction
4, 6, 2, 3, 1, 5, 4,...04, 5, 1, 3, 2, 6, 4,...
1
海马m1F r e e s c a l e  S e m i c o n d u c t o r , I
西贝柳斯n c .
AN2513/D
Detailed Function Description
Figure 2. Hall sensor signals in opposite direction to Figure 1 and corresponding values
Two function modes are provided:
•TCR1 clock selected •
TCR2 clock selected
The selected mode is determined by the HSQ bit 1. The user has to select the same mode on all channels.
The function provides interpolation support. The parameters LastEdgeT and ActualT are updated on a Host Service Request HSR = 11. LastEdgeT then has the value of the last incoming edge time in the TCR clocks and ActualT has the current value of the TCR clock.
李琦家庭背景The CPU program should use 32-bit reads to ensure coherency of the two parameters. This applies to coherent reads of LastEdgeT and ActualT as well as the Sector and TCR_VALUE, which is necessary for interpolation calculations.
F r e e s c a l e  S e m i c o n d u c t o r , I
n c .

本文发布于:2024-09-21 02:33:13,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/423810.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:行政   机关   处理   公文   背景
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议