打印
[STM32F1]

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

[复制链接]
3272|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内核 ...

那估计也就是文档的错误了。感谢

使用特权

评论回复
5
kingsing2| | 2017-7-14 14:37 | 只看该作者
734774645 发表于 2017-7-12 18:04
其实这个函数跟是不是STM32没关系,我见新唐板块有个贴,发了个新唐的内部资料,中文版,就是介绍这DSP内核 ...

你说的这个帖子的地址是啥呢

使用特权

评论回复
6
airwill| | 2017-7-15 16:50 | 只看该作者
是的,  STM32 是 32 位的处理器, 从内核手册看内部没有 64 的寄存器, 所以应该是库里使用了两个 32 位寄存器 (变量) 构成一个 64 位变量做运算吧

使用特权

评论回复
7
huangcunxiake| | 2017-7-15 22:29 | 只看该作者
安富莱_STM32-V5开发板_数字信号处理教程%28V1.0%29
去找这个,文件太大没法上传。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

9

帖子

1

粉丝