cml__ampstruct_8h-source.html

来自「美国COPLEY驱动器,程序开发工具之一.」· HTML 代码 · 共 536 行 · 第 1/5 页

HTML
536
字号
<a name="l00100"></a><a class="code" href="structAmpInfo.html#o23">00100</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structAmpInfo.html#o23">pwm_off</a>;        <span class="comment">///&lt; PWM off time</span><a name="l00101"></a><a class="code" href="structAmpInfo.html#o24">00101</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structAmpInfo.html#o24">pwm_dbzero</a>;     <span class="comment">///&lt; PWM deadband @ zero current</span><a name="l00102"></a><a class="code" href="structAmpInfo.html#o25">00102</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structAmpInfo.html#o25">pwm_dbcont</a>;     <span class="comment">///&lt; PWM deadband @ continuous current</span><a name="l00103"></a><a class="code" href="structAmpInfo.html#o26">00103</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structAmpInfo.html#o26">regenPeak</a>;      <span class="comment">///&lt; Internal regen resister peak limit</span><a name="l00104"></a><a class="code" href="structAmpInfo.html#o27">00104</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structAmpInfo.html#o27">regenCont</a>;      <span class="comment">///&lt; Internal regen resister continuous limit</span><a name="l00105"></a><a class="code" href="structAmpInfo.html#o28">00105</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structAmpInfo.html#o28">regenTime</a>;      <span class="comment">///&lt; Internal regen resister peak time</span><a name="l00106"></a>00106 <span class="comment"></span>};<a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="comment">/***************************************************************************/</span><span class="comment"></span><a name="l00109"></a>00109 <span class="comment">/**</span><a name="l00110"></a>00110 <span class="comment">  This structure holds the position loop configuration parameters specific to </span><a name="l00111"></a>00111 <span class="comment">  the Copley amplifier.</span><a name="l00112"></a>00112 <span class="comment"></span><a name="l00113"></a>00113 <span class="comment">  The position loop is one of three servo control loops used by the amplifier</span><a name="l00114"></a>00114 <span class="comment">  to control a motor.  The configuration parameters used by this control loop</span><a name="l00115"></a>00115 <span class="comment">  allow the servo performance to be 'tuned' for various motors and loads.</span><a name="l00116"></a>00116 <span class="comment"></span><a name="l00117"></a>00117 <span class="comment">  The amplifier member functions Amp::GetPosLoopConfig and Amp::SetPosLoopConfig</span><a name="l00118"></a>00118 <span class="comment">  are used to read and write this data to the amplifier.</span><a name="l00119"></a>00119 <span class="comment">  */</span><a name="l00120"></a>00120 <span class="comment">/***************************************************************************/</span><a name="l00121"></a><a class="code" href="structPosLoopConfig.html">00121</a> <span class="keyword">struct </span><a class="code" href="structPosLoopConfig.html">PosLoopConfig</a><a name="l00122"></a>00122 {<span class="comment"></span><a name="l00123"></a>00123 <span class="comment">   /// Proportional gain</span><a name="l00124"></a><a class="code" href="structPosLoopConfig.html#o0">00124</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structPosLoopConfig.html#o0">kp</a>;<a name="l00125"></a>00125 <span class="comment"></span><a name="l00126"></a>00126 <span class="comment">   /// Velocity feed forward</span><a name="l00127"></a><a class="code" href="structPosLoopConfig.html#o1">00127</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structPosLoopConfig.html#o1">kvff</a>;<a name="l00128"></a>00128 <span class="comment"></span><a name="l00129"></a>00129 <span class="comment">   /// Acceleration feed forward</span><a name="l00130"></a><a class="code" href="structPosLoopConfig.html#o2">00130</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structPosLoopConfig.html#o2">kaff</a>;<a name="l00131"></a>00131 <span class="comment"></span><a name="l00132"></a>00132 <span class="comment">   /// Scaling factor.  This is a multiplier that is applied to the</span><a name="l00133"></a>00133 <span class="comment">   /// output of the position loop.  It's scaled up by 100, so setting</span><a name="l00134"></a>00134 <span class="comment">   /// the scaling factor to 1234 would multiply the output of the </span><a name="l00135"></a>00135 <span class="comment">   /// loop by 12.34.</span><a name="l00136"></a>00136 <span class="comment">   /// This parameter was added in firmware version 3.30.  For any </span><a name="l00137"></a>00137 <span class="comment">   /// earlier version it will default to 100 (scale by 1.0).</span><a name="l00138"></a><a class="code" href="structPosLoopConfig.html#o3">00138</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structPosLoopConfig.html#o3">scale</a>;<a name="l00139"></a>00139 <span class="comment"></span><a name="l00140"></a>00140 <span class="comment">   /// Default constructor.</span><a name="l00141"></a>00141 <span class="comment">   /// Simply initializes all servo parameters to zero.</span><a name="l00142"></a><a class="code" href="structPosLoopConfig.html#a0">00142</a> <span class="comment"></span>   <a class="code" href="structPosLoopConfig.html#a0">PosLoopConfig</a>( <span class="keywordtype">void</span> )<a name="l00143"></a>00143    {<a name="l00144"></a>00144       <a class="code" href="structPosLoopConfig.html#o0">kp</a> = 0;<a name="l00145"></a>00145       <a class="code" href="structPosLoopConfig.html#o1">kvff</a> = 0;<a name="l00146"></a>00146       <a class="code" href="structPosLoopConfig.html#o2">kaff</a> = 0;<a name="l00147"></a>00147       <a class="code" href="structPosLoopConfig.html#o3">scale</a> = 100;<a name="l00148"></a>00148    }<a name="l00149"></a>00149 };<a name="l00150"></a>00150 <a name="l00151"></a>00151 <span class="comment">/***************************************************************************/</span><span class="comment"></span><a name="l00152"></a>00152 <span class="comment">/**</span><a name="l00153"></a>00153 <span class="comment">  This structure holds the velocity loop configuration parameters </span><a name="l00154"></a>00154 <span class="comment">  specific to the Copley amplifier.</span><a name="l00155"></a>00155 <span class="comment"></span><a name="l00156"></a>00156 <span class="comment">  The velocity loop is one of three servo control loops used by the amplifier</span><a name="l00157"></a>00157 <span class="comment">  to control a motor.  The configuration parameters used by this control loop</span><a name="l00158"></a>00158 <span class="comment">  allow the servo performance to be 'tuned' for various motors and loads.</span><a name="l00159"></a>00159 <span class="comment"></span><a name="l00160"></a>00160 <span class="comment">  The amplifier member functions Amp::GetVelLoopConfig and Amp::SetVelLoopConfig</span><a name="l00161"></a>00161 <span class="comment">  are used to read and write this data to the amplifier.</span><a name="l00162"></a>00162 <span class="comment">  */</span><a name="l00163"></a>00163 <span class="comment">/***************************************************************************/</span><a name="l00164"></a><a class="code" href="structVelLoopConfig.html">00164</a> <span class="keyword">struct </span><a class="code" href="structVelLoopConfig.html">VelLoopConfig</a><a name="l00165"></a>00165 {<span class="comment"></span><a name="l00166"></a>00166 <span class="comment">   /// Proportional gain</span><a name="l00167"></a><a class="code" href="structVelLoopConfig.html#o0">00167</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structVelLoopConfig.html#o0">kp</a>;<a name="l00168"></a>00168 <span class="comment"></span><a name="l00169"></a>00169 <span class="comment">   /// Integral gain</span><a name="l00170"></a><a class="code" href="structVelLoopConfig.html#o1">00170</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structVelLoopConfig.html#o1">ki</a>;<a name="l00171"></a>00171 <span class="comment"></span><a name="l00172"></a>00172 <span class="comment">   /// Acceleration feed forward</span><a name="l00173"></a><a class="code" href="structVelLoopConfig.html#o2">00173</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structVelLoopConfig.html#o2">kaff</a>;<a name="l00174"></a>00174 <span class="comment"></span><a name="l00175"></a>00175 <span class="comment">   /// Output shift value.  The output of the loop is downshifted</span><a name="l00176"></a>00176 <span class="comment">   /// this many bits to get the current loop command</span><a name="l00177"></a><a class="code" href="structVelLoopConfig.html#o3">00177</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a7">int16</a> <a class="code" href="structVelLoopConfig.html#o3">shift</a>;<a name="l00178"></a>00178 <span class="comment"></span><a name="l00179"></a>00179 <span class="comment">   /// Maximum allowed velocity.</span><a name="l00180"></a>00180 <span class="comment">   /// This value is used to limit the velocity command before the</span><a name="l00181"></a>00181 <span class="comment">   /// velocity loop uses it to calculate output current.</span><a name="l00182"></a>00182 <span class="comment">   /// When running in a position mode (normal for CAN operation)</span><a name="l00183"></a>00183 <span class="comment">   /// The velocity command is the output from the position loop.</span><a name="l00184"></a>00184 <span class="comment">   /// This command is clipped by this value before it is passed</span><a name="l00185"></a>00185 <span class="comment">   /// to the velocity loop.</span><a name="l00186"></a>00186 <span class="comment">   ///</span><a name="l00187"></a>00187 <span class="comment">   /// This parameter is specified in "user units".  See </span><a name="l00188"></a>00188 <span class="comment">   /// Amp::SetCountsPerUnit for details.</span><a name="l00189"></a><a class="code" href="structVelLoopConfig.html#o4">00189</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a11">uunit</a> <a class="code" href="structVelLoopConfig.html#o4">maxVel</a>;<a name="l00190"></a>00190 <span class="comment"></span><a name="l00191"></a>00191 <span class="comment">   /// Maximum allowed acceleration</span><a name="l00192"></a>00192 <span class="comment">   ///</span><a name="l00193"></a>00193 <span class="comment">   /// This value limits the rate of change of the velocity command</span><a name="l00194"></a>00194 <span class="comment">   /// input to the velocity loop.  It is used when the magnitude of</span><a name="l00195"></a>00195 <span class="comment">   /// the command is increasing.</span><a name="l00196"></a>00196 <span class="comment">   ///</span><a name="l00197"></a>00197 <span class="comment">   /// Note that the acceleration &amp; deceleration limits are NOT used</span><a name="l00198"></a>00198 <span class="comment">   /// when the position loop is driving the velocity loop.</span><a name="l00199"></a>00199 <span class="comment">   ///</span><a name="l00200"></a>00200 <span class="comment">   /// This parameter is specified in "user units".  See </span><a name="l00201"></a>00201 <span class="comment">   /// Amp::SetCountsPerUnit for details.</span><a name="l00202"></a><a class="code" href="structVelLoopConfig.html#o5">00202</a> <span class="comment"></span>   <a class="code" href="CML__Utils_8h.html#a11">uunit</a> <a class="code" href="structVelLoopConfig.html#o5">maxAcc</a>;<a name="l00203"></a>00203 <span class="comment"></span><a name="l00204"></a>00204 <span class="comment">   /// Maximum allowed deceleration</span><a name="l00205"></a>00205 <span class="comment">   /// This value limits the rate of change of the velocity command</span><a name="l00206"></a>00206 <span class="comment">   /// input to the velocity loop.  It is used when the magnitude of</span><a name="l00207"></a>00207 <span class="comment">   /// the command is decreasing.</span>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?