85 lines
18 KiB
XML
85 lines
18 KiB
XML
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
|
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_bsp___p_i_d_8h_source" xml:lang="zh">
|
|
<title>bsp_PID.h</title>
|
|
<indexterm><primary>D:/gitt/MicrochipFor32/bsp_Device/bsp_PID.h</primary></indexterm>
|
|
浏览该文件的文档.<programlisting linenumbering="unnumbered"><anchor xml:id="_bsp___p_i_d_8h_source_1l00001"/>00001 <emphasis role="comment">/*----------------------------------------------------------------------------------------------------</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00002"/>00002 <emphasis role="comment"> #</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00003"/>00003 <emphasis role="comment"> #  Copyright (c) 2022 Yuankang Liang(XerolySkinner)</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00004"/>00004 <emphasis role="comment"> #</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00005"/>00005 <emphasis role="comment"> #  本软件按原样提供,无任何明示或暗示</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00006"/>00006 <emphasis role="comment"> #  在任何情况下,作者都不承担任何损害赔偿责任</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00007"/>00007 <emphasis role="comment"> #</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00008"/>00008 <emphasis role="comment"> #  使用的许可声明:</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00009"/>00009 <emphasis role="comment"> #  1.  不得歪曲本软件的来源,你不能声称你编写了原始软件.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00010"/>00010 <emphasis role="comment"> #  2.  免费授予以任何目的,前提是版权声明出现在所有副本中.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00011"/>00011 <emphasis role="comment"> #      并且版权声明和许可声明同时出现.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00012"/>00012 <emphasis role="comment"> #  3.  你有使用,复制,修改,分发,和销售本软件的许可.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00013"/>00013 <emphasis role="comment"> #  4.  如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00014"/>00014 <emphasis role="comment"> #  5.  本通知不得从任何来源删除或更改.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00015"/>00015 <emphasis role="comment"> #</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00016"/>00016 <emphasis role="comment"> #  Yuankang Liang(XerolySkinner)</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00017"/>00017 <emphasis role="comment"> #      E-mail:zabbcccbbaz@163.com</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00018"/>00018 <emphasis role="comment"> #      QQ:2715099320</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00019"/>00019 <emphasis role="comment"> #      Mobile Phone:13005636215</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00020"/>00020 <emphasis role="comment"> #</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00021"/>00021 <emphasis role="comment"> #  All rights reserved.</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00022"/>00022 <emphasis role="comment"> */</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00023"/>00023
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00034"/>00034 <emphasis role="preprocessor">#ifdef __cplusplus</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00035"/>00035 <emphasis role="preprocessor">#pragma once</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00036"/>00036 <emphasis role="preprocessor">#include "<link linkend="_varint_8h">varint.h</link>"</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00038"/>00038 <emphasis role="comment">//----------------------------------------------------------------------------------------------------</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00039"/>00039 <emphasis role="comment">//  类目</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00043"/><link linkend="_classbsp___position___p_i_d">00043</link> <emphasis role="comment"></emphasis><emphasis role="keyword">class </emphasis><link linkend="_classbsp___position___p_i_d">bsp_Position_PID</link>{
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00044"/>00044     <emphasis role="keyword">public</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00045"/>00045         <link linkend="_classbsp___position___p_i_d_1ac50b1ff29153eed1fcb252a3eee2aa69">bsp_Position_PID</link>(<emphasis role="keywordtype">void</emphasis>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00046"/>00046         <link linkend="_classbsp___position___p_i_d_1ac50b1ff29153eed1fcb252a3eee2aa69">bsp_Position_PID</link>(
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00047"/>00047             <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1aa2ea863045a5bc0785693013154b6a52">Kp</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a58c60be7603ec356bbe428fb989d4e68">Ki</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a1678e1ea6b9e6ea56fde93df5aad4f75">Kd</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a04921569cfe25681f8763beaae01c1bc">target</link>,
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00048"/>00048             <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a08bba095208d3dcdb8c07e741dc3a77a">result_H</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a42a8eb4e1c96871e1b4eacb0cf46e196">result_L</link>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00049"/>00049         <link linkend="_classbsp___position___p_i_d_1a9cd33ec75d5ca15939d132644d4ceea8">~bsp_Position_PID</link>(<emphasis role="keywordtype">void</emphasis>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00050"/>00050     <emphasis role="keyword">public</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00051"/>00051         <emphasis role="keywordtype">float</emphasis>   <link linkend="_classbsp___position___p_i_d_1ac658466d8bc1d12fcd403c4b6f9ca9f7">PID</link>(<emphasis role="keywordtype">float</emphasis> temp);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00052"/>00052         <emphasis role="keywordtype">void</emphasis>    <link linkend="_classbsp___position___p_i_d_1a7b60d7f8a80c632c501561e7e0765f14">clean</link>(<emphasis role="keywordtype">void</emphasis>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00053"/>00053         <emphasis role="keywordtype">void</emphasis>    <link linkend="_classbsp___position___p_i_d_1add37a6f47b3f9b6dd0d945def8ed2ef1">set</link>(<emphasis role="keywordtype">float</emphasis> P, <emphasis role="keywordtype">float</emphasis> I, <emphasis role="keywordtype">float</emphasis> D);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00054"/>00054     <emphasis role="keyword">public</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00055"/><link linkend="_classbsp___position___p_i_d_1a04921569cfe25681f8763beaae01c1bc">00055</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a04921569cfe25681f8763beaae01c1bc">target</link>;       
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00056"/><link linkend="_classbsp___position___p_i_d_1aa2ea863045a5bc0785693013154b6a52">00056</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1aa2ea863045a5bc0785693013154b6a52">Kp</link>;           
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00057"/><link linkend="_classbsp___position___p_i_d_1a1678e1ea6b9e6ea56fde93df5aad4f75">00057</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a1678e1ea6b9e6ea56fde93df5aad4f75">Kd</link>;           
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00058"/><link linkend="_classbsp___position___p_i_d_1a58c60be7603ec356bbe428fb989d4e68">00058</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a58c60be7603ec356bbe428fb989d4e68">Ki</link>;           
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00059"/><link linkend="_classbsp___position___p_i_d_1a77ecc1d6378fb03cc63c9a3a263c90b2">00059</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a77ecc1d6378fb03cc63c9a3a263c90b2">result</link>;       
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00060"/>00060     <emphasis role="keyword">private</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00061"/><link linkend="_classbsp___position___p_i_d_1a9e7c0b93c1936f3aca77800997f99c05">00061</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a9e7c0b93c1936f3aca77800997f99c05">integral</link>;     
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00062"/><link linkend="_classbsp___position___p_i_d_1a04a54e038d2229f330e1913ce8b8aada">00062</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a04a54e038d2229f330e1913ce8b8aada">lasterror</link>;    
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00063"/>00063
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00064"/><link linkend="_classbsp___position___p_i_d_1a08bba095208d3dcdb8c07e741dc3a77a">00064</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a08bba095208d3dcdb8c07e741dc3a77a">result_H</link>;     
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00065"/><link linkend="_classbsp___position___p_i_d_1a42a8eb4e1c96871e1b4eacb0cf46e196">00065</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___position___p_i_d_1a42a8eb4e1c96871e1b4eacb0cf46e196">result_L</link>;     
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00066"/>00066     };
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00068"/>00068 <emphasis role="comment">//----------------------------------------------------------------------------------------------------</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00069"/>00069 <emphasis role="comment">//  类目</emphasis>
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00073"/><link linkend="_classbsp___increment___p_i_d">00073</link> <emphasis role="comment"></emphasis><emphasis role="keyword">class </emphasis><link linkend="_classbsp___increment___p_i_d">bsp_Increment_PID</link> {
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00074"/>00074     <emphasis role="keyword">public</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00075"/>00075         <link linkend="_classbsp___increment___p_i_d_1a1dec336ee026d7e1148dfb68052055d2">bsp_Increment_PID</link>(<emphasis role="keywordtype">void</emphasis>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00076"/>00076         <link linkend="_classbsp___increment___p_i_d_1a1dec336ee026d7e1148dfb68052055d2">bsp_Increment_PID</link>(
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00077"/>00077             <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a4bd6b08091f76f357da2dab404a3a97b">Kp</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a368b2b2bd531ef46a9518889f9f07eec">Ki</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1acbe47a0c902698a6e11db1d0651a2627">Kd</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a6f2142a4e99c8a6bd5b604fe53c8e6b1">target</link>,
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00078"/>00078             <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a90bb2ca2ebe196b8063183336c63186a">result_H</link>, <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a17d1546dc185ae482d4d7b72af1ac5cd">result_L</link>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00079"/>00079         <link linkend="_classbsp___increment___p_i_d_1a3eb46ef6d491464f9cc8bfdc0ded1155">~bsp_Increment_PID</link>(<emphasis role="keywordtype">void</emphasis>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00080"/>00080     <emphasis role="keyword">public</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00081"/>00081         <emphasis role="keywordtype">float</emphasis>   <link linkend="_classbsp___increment___p_i_d_1a7f39310ecc4cd1f8029a6545bd37e0a9">PID</link>(<emphasis role="keywordtype">float</emphasis> temp);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00082"/>00082         <emphasis role="keywordtype">void</emphasis>    <link linkend="_classbsp___increment___p_i_d_1aa1cab8492ec6a289debfc215689d9b38">clean</link>(<emphasis role="keywordtype">void</emphasis>);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00083"/>00083         <emphasis role="keywordtype">void</emphasis>    <link linkend="_classbsp___increment___p_i_d_1aeddd6d60b615571d390653e9a958b2b4">set</link>(<emphasis role="keywordtype">float</emphasis> P, <emphasis role="keywordtype">float</emphasis> I, <emphasis role="keywordtype">float</emphasis> D);
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00084"/>00084     <emphasis role="keyword">public</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00085"/><link linkend="_classbsp___increment___p_i_d_1a6f2142a4e99c8a6bd5b604fe53c8e6b1">00085</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a6f2142a4e99c8a6bd5b604fe53c8e6b1">target</link>;       
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00086"/><link linkend="_classbsp___increment___p_i_d_1a4bd6b08091f76f357da2dab404a3a97b">00086</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a4bd6b08091f76f357da2dab404a3a97b">Kp</link>;           
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00087"/><link linkend="_classbsp___increment___p_i_d_1acbe47a0c902698a6e11db1d0651a2627">00087</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1acbe47a0c902698a6e11db1d0651a2627">Kd</link>;           
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00088"/><link linkend="_classbsp___increment___p_i_d_1a368b2b2bd531ef46a9518889f9f07eec">00088</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a368b2b2bd531ef46a9518889f9f07eec">Ki</link>;           
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00089"/><link linkend="_classbsp___increment___p_i_d_1a7e567c42a56682a0f24e39a92a562e40">00089</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a7e567c42a56682a0f24e39a92a562e40">result</link>;       
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00090"/>00090     <emphasis role="keyword">private</emphasis>:
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00091"/><link linkend="_classbsp___increment___p_i_d_1aaf7c047c9aa963bb6b7524fd8fc6242b">00091</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1aaf7c047c9aa963bb6b7524fd8fc6242b">lasterror</link>;    
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00092"/><link linkend="_classbsp___increment___p_i_d_1a8df6076b4bb4d4d1e4c7ee2777defb82">00092</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a8df6076b4bb4d4d1e4c7ee2777defb82">preerror</link>;     
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00093"/>00093
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00094"/><link linkend="_classbsp___increment___p_i_d_1a90bb2ca2ebe196b8063183336c63186a">00094</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a90bb2ca2ebe196b8063183336c63186a">result_H</link>;     
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00095"/><link linkend="_classbsp___increment___p_i_d_1a17d1546dc185ae482d4d7b72af1ac5cd">00095</link>         <emphasis role="keywordtype">float</emphasis> <link linkend="_classbsp___increment___p_i_d_1a17d1546dc185ae482d4d7b72af1ac5cd">result_L</link>;     
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00096"/>00096     };
|
|
<anchor xml:id="_bsp___p_i_d_8h_source_1l00098"/>00098 <emphasis role="preprocessor">#endif</emphasis>
|
|
</programlisting></section>
|