[STM32F1] 关于STM32,CMSIS-DSP库中,arm_pid_q15()这个函数

[复制链接]
3841|6
 楼主| zhihuasz 发表于 2017-7-11 17:59 | 显示全部楼层 |阅读模式
CMSIS-DSP的手册中说明:The function is implemented using a 64-bit internal accumulator. 请问如何理解这句话?STM32内部有这个64位累加器?如果是只是有那么一个64位变量的话,arm_pid_instance_q15里面也没有64位的变量啊。
手册中只是提到,参考__SIMD32_CONST这个东西,但是其原理又是什么呢?

百思不得其姐,求高人指点






--------------------------------手册说明原文的分界线----------------------------------------
static __INLINE  q15_t arm_pid_q15         ( arm_pid_instance_q15 *          S , q15_t          in)        

Parameters
    [in,out]        S        points to an instance of the Q15 PID Control structure
    [in]        in        input sample to process

Returns
    out processed output sample.

Scaling and Overflow Behavior:

    The function is implemented using a 64-bit internal accumulator. Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. Lastly, the accumulator is saturated to yield a result in 1.15 format.

References    __SIMD32_CONST, arm_pid_instance_q15::A0, arm_pid_instance_q15::A1, and arm_pid_instance_q15::state.
 楼主| zhihuasz 发表于 2017-7-12 15:45 | 显示全部楼层
大神请指点一二吧~~~~
734774645 发表于 2017-7-12 18:04 | 显示全部楼层
其实这个函数跟是不是STM32没关系,我见新唐板块有个贴,发了个新唐的内部资料,中文版,就是介绍这DSP内核的库函数的,其中就有这个PID的怎么玩。
 楼主| zhihuasz 发表于 2017-7-13 10:05 | 显示全部楼层
734774645 发表于 2017-7-12 18:04
其实这个函数跟是不是STM32没关系,我见新唐板块有个贴,发了个新唐的内部资料,中文版,就是介绍这DSP内核 ...

那估计也就是文档的错误了。感谢
kingsing2 发表于 2017-7-14 14:37 | 显示全部楼层
734774645 发表于 2017-7-12 18:04
其实这个函数跟是不是STM32没关系,我见新唐板块有个贴,发了个新唐的内部资料,中文版,就是介绍这DSP内核 ...

你说的这个帖子的地址是啥呢
airwill 发表于 2017-7-15 16:50 | 显示全部楼层
是的,  STM32 是 32 位的处理器, 从内核手册看内部没有 64 的寄存器, 所以应该是库里使用了两个 32 位寄存器 (变量) 构成一个 64 位变量做运算吧
huangcunxiake 发表于 2017-7-15 22:29 | 显示全部楼层
安富莱_STM32-V5开发板_数字信号处理教程%28V1.0%29
去找这个,文件太大没法上传。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

9

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部