Welcome![Sign In][Sign Up]
Location:
Search - pid velocity algorithm code

Search list

[Mathimatics-Numerical algorithmsPID-c-source-code

Description: 在使用单片机作为控制cpu时,请稍作简化,具体的PID参数必须由具体对象通过实验确定。由于单片机的处理速度和ram资源的限制,一般不采用浮点数运算,而将所有参数全部用整数,运算到最后再除以一个2的N次方数据(相当于移位),作类似定点数运算,可大大提高运算速度,根据控制精度的不同要求,当精度要求很高时,注意保留移位引起的“余数”,做好余数补偿。这个程序只是一般常用pid算法的基本架构,没有包含输入输出处理部分。-In the use of single-chip microcomputer as the control cpu, please make some simplification, the specific PID parameters must be determined through experiments at specific audiences. As the single-chip processing speed and ram resource constraints, generally do not use floating-point, and will use all parameters of all integers, computing the final 2 and then divided by a N-th power of data (equivalent to shift), similar fixed-point computation can be greatly enhanced speed of operation, according to the different requirements of control precision, when high precision, the attention to retain the shift caused by the balance , do a good job in the balance of compensation. This procedure is commonly used algorithm pid basic structure does not contain input and output part of treatment.
Platform: | Size: 1024 | Author: 王强 | Hits:

CodeBus www.codebus.net