<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title> – Controllers</title>
    <link>/docs/applications/configure_application/axes_control/pid_controllers/</link>
    <description>Recent content in Controllers on </description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/docs/applications/configure_application/axes_control/pid_controllers/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Position controller</title>
      <link>/docs/applications/configure_application/axes_control/pid_controllers/position-controller/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/applications/configure_application/axes_control/pid_controllers/position-controller/</guid>
      <description>
        
        
        &lt;p&gt;The position controller works on &lt;code&gt;actuatorPositionError&lt;/code&gt;, the position target minus the actual position. Its output goes one of two ways, set by &lt;code&gt;actuatorControlLoopNN/positionController/usePositionControlForTorque&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;usePositionControlForTorque&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Use with&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0&lt;/code&gt; (default)&lt;/td&gt;
&lt;td&gt;A velocity, added to the velocity target&lt;/td&gt;
&lt;td&gt;CSV, or CST together with the velocity controller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A torque, added to the torque target. The velocity controller&amp;rsquo;s output is then not used&lt;/td&gt;
&lt;td&gt;CST without a velocity loop&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id=&#34;tune-it&#34;&gt;Tune it&lt;/h4&gt;
&lt;p&gt;Follow &lt;a href=&#34;/docs/applications/configure_application/axes_control/pid_controllers/tuning/&#34;&gt;Tune the controllers&lt;/a&gt;, after the velocity controller if you use it. For the position controller:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;controlOutputMin&lt;/code&gt; and &lt;code&gt;controlOutputMax&lt;/code&gt; are in rad/s or m/s, or in Nm with &lt;code&gt;usePositionControlForTorque&lt;/code&gt; at &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Watch &lt;code&gt;actuatorPositionError&lt;/code&gt; and &lt;code&gt;positionController/output/controllerOutput&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;compensate-for-delay&#34;&gt;Compensate for delay&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;positionController/delayForControlError/numberOfSamplesTarget&lt;/code&gt; and &lt;code&gt;numberOfSamplesActual&lt;/code&gt; delay the target or the actual by up to 10 cycles before the controller forms the error. Use them when the actual position lags the target by a fixed number of cycles, so that the controller compares values from the same moment.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Velocity controller</title>
      <link>/docs/applications/configure_application/axes_control/pid_controllers/velocity-controller/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/applications/configure_application/axes_control/pid_controllers/velocity-controller/</guid>
      <description>
        
        
        &lt;p&gt;The velocity controller works on &lt;code&gt;actuatorVelocityError&lt;/code&gt;, the velocity target minus the actual velocity. Its output is a torque in Nm, added to the torque target, so it only makes sense when the drive runs CST. The velocity target is the setpoint&amp;rsquo;s velocity plus the position controller&amp;rsquo;s output, if that is on.&lt;/p&gt;
&lt;h4 id=&#34;tune-it&#34;&gt;Tune it&lt;/h4&gt;
&lt;p&gt;Tune the velocity controller first when you use both: the position loop can only be as good as the velocity loop inside it. Follow &lt;a href=&#34;/docs/applications/configure_application/axes_control/pid_controllers/tuning/&#34;&gt;Tune the controllers&lt;/a&gt;. For the velocity controller:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;controlOutputMin&lt;/code&gt; and &lt;code&gt;controlOutputMax&lt;/code&gt; are the torque the motor may deliver, in Nm at the load.&lt;/li&gt;
&lt;li&gt;Watch &lt;code&gt;actuatorVelocityError&lt;/code&gt; and &lt;code&gt;velocityController/output/controllerOutput&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Tune the controllers</title>
      <link>/docs/applications/configure_application/axes_control/pid_controllers/tuning/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/applications/configure_application/axes_control/pid_controllers/tuning/</guid>
      <description>
        
        
        &lt;p&gt;Tuning sets the gains of the &lt;a href=&#34;/docs/applications/configure_application/axes_control/pid_controllers/&#34;&gt;controllers&lt;/a&gt; so that an axis follows its target quickly, without overshoot or oscillation. You make the same small move again and again, watch the plot in Motorcortex Desk, and change one gain at a time until the response looks like the middle one:&lt;/p&gt;
&lt;div class=&#34;mcx-svg mcx-axis&#34; role=&#34;group&#34; aria-label=&#34;Three responses to a step in the target, dashed. Gain too low: the actual value rises slowly and lags behind. About right: it rises fast with a little overshoot and settles. Gain too high: it overshoots and rings before it settles.&#34;&gt;
&lt;svg xmlns=&#34;http://www.w3.org/2000/svg&#34; viewBox=&#34;0 0 760 210&#34; width=&#34;100%&#34;&gt;
  &lt;g class=&#34;mcx-ax-plain&#34;&gt;&lt;rect x=&#34;14&#34; y=&#34;10&#34; width=&#34;230&#34; height=&#34;190&#34; rx=&#34;12&#34;/&gt;&lt;/g&gt;
  &lt;text class=&#34;mcx-ax-title&#34; x=&#34;129.0&#34; y=&#34;34&#34;&gt;Gain too low&lt;/text&gt;
  &lt;text class=&#34;mcx-ax-sub&#34; x=&#34;129.0&#34; y=&#34;52&#34;&gt;slow, lags behind&lt;/text&gt;
  &lt;line class=&#34;mcx-ax-axis&#34; x1=&#34;34&#34; y1=&#34;180&#34; x2=&#34;224&#34; y2=&#34;180&#34;/&gt;
  &lt;path class=&#34;mcx-ax-input&#34; d=&#34;M34 180 H56.8 V105 H224&#34;/&gt;
  &lt;path class=&#34;mcx-ax-output&#34; d=&#34;M34 180 H56.8 L56.8 180.0 L57.8 178.4 L58.9 176.7 L59.9 175.2 L61.0 173.6 L62.0 172.1 L63.1 170.6 L64.1 169.2 L65.2 167.8 L66.2 166.4 L67.2 165.1 L68.3 163.7 L69.3 162.4 L70.4 161.2 L71.4 159.9 L72.5 158.7 L73.5 157.6 L74.6 156.4 L75.6 155.3 L76.7 154.2 L77.7 153.1 L78.7 152.0 L79.8 151.0 L80.8 150.0 L81.9 149.0 L82.9 148.0 L84.0 147.1 L85.0 146.2 L86.1 145.3 L87.1 144.4 L88.2 143.5 L89.2 142.7 L90.2 141.8 L91.3 141.0 L92.3 140.2 L93.4 139.5 L94.4 138.7 L95.5 138.0 L96.5 137.2 L97.6 136.5 L98.6 135.8 L99.6 135.2 L100.7 134.5 L101.7 133.8 L102.8 133.2 L103.8 132.6 L104.9 132.0 L105.9 131.4 L107.0 130.8 L108.0 130.2 L109.0 129.7 L110.1 129.1 L111.1 128.6 L112.2 128.1 L113.2 127.6 L114.3 127.1 L115.3 126.6 L116.4 126.1 L117.4 125.7 L118.5 125.2 L119.5 124.8 L120.5 124.3 L121.6 123.9 L122.6 123.5 L123.7 123.1 L124.7 122.7 L125.8 122.3 L126.8 121.9 L127.9 121.5 L128.9 121.2 L129.9 120.8 L131.0 120.5 L132.0 120.1 L133.1 119.8 L134.1 119.5 L135.2 119.2 L136.2 118.9 L137.3 118.5 L138.3 118.3 L139.4 118.0 L140.4 117.7 L141.4 117.4 L142.5 117.1 L143.5 116.9 L144.6 116.6 L145.6 116.3 L146.7 116.1 L147.7 115.8 L148.8 115.6 L149.8 115.4 L150.8 115.2 L151.9 114.9 L152.9 114.7 L154.0 114.5 L155.0 114.3 L156.1 114.1 L157.1 113.9 L158.2 113.7 L159.2 113.5 L160.3 113.3 L161.3 113.1 L162.3 112.9 L163.4 112.8 L164.4 112.6 L165.5 112.4 L166.5 112.3 L167.6 112.1 L168.6 112.0 L169.7 111.8 L170.7 111.7 L171.8 111.5 L172.8 111.4 L173.8 111.2 L174.9 111.1 L175.9 111.0 L177.0 110.8 L178.0 110.7 L179.1 110.6 L180.1 110.4 L181.2 110.3 L182.2 110.2 L183.2 110.1 L184.3 110.0 L185.3 109.9 L186.4 109.8 L187.4 109.7 L188.5 109.6 L189.5 109.5 L190.6 109.4 L191.6 109.3 L192.6 109.2 L193.7 109.1 L194.7 109.0 L195.8 108.9 L196.8 108.8 L197.9 108.7 L198.9 108.7 L200.0 108.6 L201.0 108.5 L202.1 108.4 L203.1 108.3 L204.1 108.3 L205.2 108.2 L206.2 108.1 L207.3 108.1 L208.3 108.0 L209.4 107.9 L210.4 107.9 L211.5 107.8 L212.5 107.7 L213.6 107.7 L214.6 107.6 L215.6 107.6 L216.7 107.5 L217.7 107.4 L218.8 107.4 L219.8 107.3 L220.9 107.3 L221.9 107.2 L223.0 107.2 L224.0 107.1&#34;/&gt;
  &lt;g class=&#34;mcx-ax-ok&#34;&gt;&lt;rect x=&#34;264&#34; y=&#34;10&#34; width=&#34;230&#34; height=&#34;190&#34; rx=&#34;12&#34;/&gt;&lt;/g&gt;
  &lt;text class=&#34;mcx-ax-title&#34; x=&#34;379.0&#34; y=&#34;34&#34;&gt;About right&lt;/text&gt;
  &lt;text class=&#34;mcx-ax-sub&#34; x=&#34;379.0&#34; y=&#34;52&#34;&gt;fast, little overshoot&lt;/text&gt;
  &lt;line class=&#34;mcx-ax-axis&#34; x1=&#34;284&#34; y1=&#34;180&#34; x2=&#34;474&#34; y2=&#34;180&#34;/&gt;
  &lt;path class=&#34;mcx-ax-input&#34; d=&#34;M284 180 H306.8 V105 H474&#34;/&gt;
  &lt;path class=&#34;mcx-ax-output&#34; d=&#34;M284 180 H306.8 L306.8 180.0 L307.8 181.2 L308.9 181.1 L309.9 180.0 L311.0 178.0 L312.0 175.3 L313.1 172.1 L314.1 168.4 L315.2 164.4 L316.2 160.2 L317.2 155.9 L318.3 151.5 L319.3 147.2 L320.4 143.0 L321.4 138.8 L322.5 134.9 L323.5 131.1 L324.6 127.6 L325.6 124.2 L326.7 121.2 L327.7 118.3 L328.7 115.8 L329.8 113.4 L330.8 111.3 L331.9 109.5 L332.9 107.9 L334.0 106.4 L335.0 105.2 L336.1 104.2 L337.1 103.3 L338.2 102.6 L339.2 102.0 L340.2 101.6 L341.3 101.3 L342.3 101.0 L343.4 100.9 L344.4 100.8 L345.5 100.9 L346.5 100.9 L347.6 101.0 L348.6 101.2 L349.6 101.4 L350.7 101.6 L351.7 101.8 L352.8 102.0 L353.8 102.2 L354.9 102.5 L355.9 102.7 L357.0 103.0 L358.0 103.2 L359.1 103.4 L360.1 103.6 L361.1 103.8 L362.2 104.0 L363.2 104.1 L364.3 104.3 L365.3 104.4 L366.4 104.6 L367.4 104.7 L368.5 104.8 L369.5 104.9 L370.5 104.9 L371.6 105.0 L372.6 105.1 L373.7 105.1 L374.7 105.1 L375.8 105.2 L376.8 105.2 L377.9 105.2 L378.9 105.2 L380.0 105.2 L381.0 105.2 L382.0 105.2 L383.1 105.2 L384.1 105.2 L385.2 105.2 L386.2 105.2 L387.3 105.2 L388.3 105.2 L389.4 105.2 L390.4 105.1 L391.4 105.1 L392.5 105.1 L393.5 105.1 L394.6 105.1 L395.6 105.1 L396.7 105.1 L397.7 105.1 L398.8 105.1 L399.8 105.0 L400.9 105.0 L401.9 105.0 L402.9 105.0 L404.0 105.0 L405.0 105.0 L406.1 105.0 L407.1 105.0 L408.2 105.0 L409.2 105.0 L410.3 105.0 L411.3 105.0 L412.3 105.0 L413.4 105.0 L414.4 105.0 L415.5 105.0 L416.5 105.0 L417.6 105.0 L418.6 105.0 L419.7 105.0 L420.7 105.0 L421.8 105.0 L422.8 105.0 L423.8 105.0 L424.9 105.0 L425.9 105.0 L427.0 105.0 L428.0 105.0 L429.1 105.0 L430.1 105.0 L431.2 105.0 L432.2 105.0 L433.2 105.0 L434.3 105.0 L435.3 105.0 L436.4 105.0 L437.4 105.0 L438.5 105.0 L439.5 105.0 L440.6 105.0 L441.6 105.0 L442.6 105.0 L443.7 105.0 L444.7 105.0 L445.8 105.0 L446.8 105.0 L447.9 105.0 L448.9 105.0 L450.0 105.0 L451.0 105.0 L452.1 105.0 L453.1 105.0 L454.1 105.0 L455.2 105.0 L456.2 105.0 L457.3 105.0 L458.3 105.0 L459.4 105.0 L460.4 105.0 L461.5 105.0 L462.5 105.0 L463.6 105.0 L464.6 105.0 L465.6 105.0 L466.7 105.0 L467.7 105.0 L468.8 105.0 L469.8 105.0 L470.9 105.0 L471.9 105.0 L473.0 105.0 L474.0 105.0&#34;/&gt;
  &lt;g class=&#34;mcx-ax-plain&#34;&gt;&lt;rect x=&#34;514&#34; y=&#34;10&#34; width=&#34;230&#34; height=&#34;190&#34; rx=&#34;12&#34;/&gt;&lt;/g&gt;
  &lt;text class=&#34;mcx-ax-title&#34; x=&#34;629.0&#34; y=&#34;34&#34;&gt;Gain too high&lt;/text&gt;
  &lt;text class=&#34;mcx-ax-sub&#34; x=&#34;629.0&#34; y=&#34;52&#34;&gt;overshoots and rings&lt;/text&gt;
  &lt;line class=&#34;mcx-ax-axis&#34; x1=&#34;534&#34; y1=&#34;180&#34; x2=&#34;724&#34; y2=&#34;180&#34;/&gt;
  &lt;path class=&#34;mcx-ax-input&#34; d=&#34;M534 180 H556.8 V105 H724&#34;/&gt;
  &lt;path class=&#34;mcx-ax-output&#34; d=&#34;M534 180 H556.8 L556.8 180.0 L557.8 152.1 L558.9 130.8 L559.9 114.5 L561.0 102.1 L562.0 93.0 L563.1 86.7 L564.1 82.7 L565.2 80.7 L566.2 80.4 L567.2 81.7 L568.3 84.2 L569.3 87.7 L570.4 92.0 L571.4 96.8 L572.5 101.8 L573.5 106.9 L574.6 111.8 L575.6 116.3 L576.7 120.2 L577.7 123.4 L578.7 125.8 L579.8 127.3 L580.8 127.9 L581.9 127.6 L582.9 126.4 L584.0 124.3 L585.0 121.6 L586.1 118.4 L587.1 114.7 L588.1 110.7 L589.2 106.7 L590.2 102.7 L591.3 98.9 L592.3 95.5 L593.4 92.6 L594.4 90.3 L595.5 88.6 L596.5 87.7 L597.6 87.4 L598.6 87.9 L599.6 89.0 L600.7 90.7 L601.7 92.9 L602.8 95.5 L603.8 98.4 L604.9 101.5 L605.9 104.6 L607.0 107.6 L608.0 110.5 L609.0 113.0 L610.1 115.1 L611.1 116.7 L612.2 117.9 L613.2 118.5 L614.3 118.5 L615.3 118.0 L616.4 117.0 L617.4 115.6 L618.5 113.8 L619.5 111.7 L620.5 109.4 L621.6 107.0 L622.6 104.6 L623.7 102.3 L624.7 100.2 L625.8 98.3 L626.8 96.8 L627.9 95.7 L628.9 94.9 L629.9 94.6 L631.0 94.7 L632.0 95.2 L633.1 96.1 L634.1 97.2 L635.2 98.7 L636.2 100.4 L637.3 102.2 L638.3 104.0 L639.4 105.8 L640.4 107.6 L641.4 109.1 L642.5 110.5 L643.5 111.6 L644.6 112.4 L645.6 112.9 L646.7 113.0 L647.7 112.9 L648.8 112.4 L649.8 111.6 L650.9 110.7 L651.9 109.5 L652.9 108.2 L654.0 106.8 L655.0 105.3 L656.1 104.0 L657.1 102.7 L658.2 101.5 L659.2 100.5 L660.3 99.7 L661.3 99.2 L662.3 98.9 L663.4 98.8 L664.4 99.0 L665.5 99.5 L666.5 100.1 L667.6 100.9 L668.6 101.8 L669.7 102.9 L670.7 104.0 L671.8 105.0 L672.8 106.1 L673.8 107.1 L674.9 107.9 L675.9 108.7 L677.0 109.2 L678.0 109.6 L679.1 109.7 L680.1 109.7 L681.2 109.5 L682.2 109.1 L683.2 108.6 L684.3 108.0 L685.3 107.2 L686.4 106.4 L687.4 105.6 L688.5 104.7 L689.5 103.9 L690.6 103.2 L691.6 102.6 L692.6 102.1 L693.7 101.7 L694.7 101.4 L695.8 101.3 L696.8 101.4 L697.9 101.6 L698.9 101.9 L700.0 102.4 L701.0 102.9 L702.1 103.5 L703.1 104.1 L704.1 104.8 L705.2 105.4 L706.2 106.0 L707.3 106.5 L708.3 107.0 L709.4 107.4 L710.4 107.6 L711.5 107.8 L712.5 107.8 L713.5 107.7 L714.6 107.6 L715.6 107.3 L716.7 106.9 L717.7 106.5 L718.8 106.0 L719.8 105.5 L720.9 105.0 L721.9 104.6 L723.0 104.1 L724.0 103.7&#34;/&gt;
&lt;/svg&gt;

&lt;/div&gt;

&lt;p&gt;Work from the inside out: when you use both controllers, tune the velocity controller first. The position loop can only be as good as the velocity loop inside it.&lt;/p&gt;



 
 




 



&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;&lt;h4 class=&#34;alert-heading&#34;&gt;Warning&lt;/h4&gt;
 &lt;p&gt;A wrong gain or a wrong sign makes the axis oscillate or run away. Tune with the axis free to move, a low velocityLimit on the limiter, and a hand on the emergency stop.&lt;/p&gt;
&lt;/div&gt;


&lt;h2 id=&#34;before-you-start&#34;&gt;Before you start&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Check the settings in simulation.&lt;/strong&gt; Switch the controllers you need on, as in the &lt;a href=&#34;/docs/applications/configure_application/axes_control/pid_controllers/#which-controllers-to-switch-on&#34;&gt;table&lt;/a&gt;, and check that the axis moves the right way. Then tune the gains on the real machine, with its real load and friction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Limit the output.&lt;/strong&gt; Set &lt;code&gt;controlOutputMin&lt;/code&gt; and &lt;code&gt;controlOutputMax&lt;/code&gt; to the largest correction you allow: a velocity in rad/s or m/s, or a torque in Nm.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start from P only.&lt;/strong&gt; Set &lt;code&gt;proportionalGain&lt;/code&gt; small, &lt;code&gt;integratorGain&lt;/code&gt; and &lt;code&gt;derivativeGain&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt;, and leave &lt;code&gt;controlIntegrationMin&lt;/code&gt; and &lt;code&gt;controlIntegrationMax&lt;/code&gt; at &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pick a test move&lt;/strong&gt; you can repeat: jog the axis a short distance back and forth at low speed.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;what-to-plot&#34;&gt;What to plot&lt;/h2&gt;
&lt;p&gt;Plot these in Desk, for the axis you tune. They are under &lt;code&gt;root/AxesControl/actuatorControlLoops/actuatorControlLoopNN/&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plot&lt;/th&gt;
&lt;th&gt;Shows&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;actuatorVelocityTarget&lt;/code&gt; and &lt;code&gt;actuatorVelocityActual&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;How well the velocity follows. Plot them on the same axis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;actuatorPositionTarget&lt;/code&gt; and &lt;code&gt;actuatorPositionActual&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;How well the position follows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;actuatorVelocityError&lt;/code&gt;, &lt;code&gt;actuatorPositionError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The error the controller works on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;velocityController/output/controllerOutput&lt;/code&gt;, &lt;code&gt;positionController/output/controllerOutput&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;What the controller adds. Flat at a limit means it is saturated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;…/output/integratorOutput&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The integral part on its own&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;tune-a-controller&#34;&gt;Tune a controller&lt;/h2&gt;
&lt;p&gt;Use the same steps for each controller, starting with the velocity controller:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Raise the P gain.&lt;/strong&gt; Double &lt;code&gt;proportionalGain&lt;/code&gt; after every test move, until the axis starts to hum, vibrate or overshoot. Then halve it. That is your P gain.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remove a steady error.&lt;/strong&gt; If a small error remains when the axis stands still or moves at a constant speed, allow the integral part: set &lt;code&gt;controlIntegrationMin&lt;/code&gt; and &lt;code&gt;controlIntegrationMax&lt;/code&gt; to a small part of the output range, for example ±20 %. Then raise &lt;code&gt;integratorGain&lt;/code&gt; from a small value until the error goes away without extra overshoot.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Damp if needed.&lt;/strong&gt; A derivative part is rarely needed. If the position loop still overshoots, add a small &lt;code&gt;derivativeGain&lt;/code&gt; and keep &lt;code&gt;derivativeFilter&lt;/code&gt; low, see below.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check faster moves.&lt;/strong&gt; Jog faster, and look for saturation: an output that sits flat at &lt;code&gt;controlOutputMin&lt;/code&gt; or &lt;code&gt;controlOutputMax&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Save the parameter tree.&lt;/strong&gt; Every axis has its own gains; tune each one.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;read-the-plot&#34;&gt;Read the plot&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What you see&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;th&gt;What to change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The actual value lags behind, more at higher speed&lt;/td&gt;
&lt;td&gt;P gain too low&lt;/td&gt;
&lt;td&gt;Raise &lt;code&gt;proportionalGain&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overshoot, then ringing&lt;/td&gt;
&lt;td&gt;P gain too high&lt;/td&gt;
&lt;td&gt;Lower &lt;code&gt;proportionalGain&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Humming, or a noisy &lt;code&gt;controllerOutput&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;P or D gain too high for the noise on the actual value&lt;/td&gt;
&lt;td&gt;Lower &lt;code&gt;proportionalGain&lt;/code&gt; or &lt;code&gt;derivativeGain&lt;/code&gt;, lower &lt;code&gt;derivativeFilter&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A small error that stays&lt;/td&gt;
&lt;td&gt;No integral part&lt;/td&gt;
&lt;td&gt;Widen &lt;code&gt;controlIntegrationMin&lt;/code&gt; and &lt;code&gt;controlIntegrationMax&lt;/code&gt;, raise &lt;code&gt;integratorGain&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A slow, large overshoot after a long move&lt;/td&gt;
&lt;td&gt;The integral part built up too far&lt;/td&gt;
&lt;td&gt;Narrow the integration range, lower &lt;code&gt;integratorGain&lt;/code&gt;, or raise &lt;code&gt;backCalculationGain&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;controllerOutput&lt;/code&gt; flat at a limit&lt;/td&gt;
&lt;td&gt;The output is saturated&lt;/td&gt;
&lt;td&gt;Move slower, or widen &lt;code&gt;controlOutputMin&lt;/code&gt; and &lt;code&gt;controlOutputMax&lt;/code&gt; if the axis can take it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The error keeps growing and the axis runs away&lt;/td&gt;
&lt;td&gt;Wrong sign&lt;/td&gt;
&lt;td&gt;Stop, and check the direction of the &lt;a href=&#34;/docs/applications/configure_application/axes_control/transformation/&#34;&gt;transformations&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;details style=&#34;border:1px solid #f5f5f5; border-radius:0px; background:#f6f6f7; padding:0.7em 1em 0.7em 1em; margin:1em 0;&#34;&gt;
  &lt;summary style=&#34;font-weight:600; cursor:pointer; color:#1976d2; padding:0.2em 0;&#34;&gt;
    How the three parts are calculated
  &lt;/summary&gt;
  &lt;div style=&#34;margin-top:0.7em;&#34;&gt;
    &lt;p&gt;Every control cycle, with &lt;code&gt;e&lt;/code&gt; the control error and &lt;code&gt;dt&lt;/code&gt; the cycle time:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;P:&lt;/strong&gt; &lt;code&gt;proportionalGain × e&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I:&lt;/strong&gt; adds &lt;code&gt;integratorGain × e × dt&lt;/code&gt; each cycle, and is held between &lt;code&gt;controlIntegrationMin&lt;/code&gt; and &lt;code&gt;controlIntegrationMax&lt;/code&gt;. These limits are in the output&amp;rsquo;s unit, so at &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; the integral part stays &lt;code&gt;0&lt;/code&gt;. Errors smaller than &lt;code&gt;controlErrorDeadBand&lt;/code&gt; are not integrated. While the output is at a limit, the integral part does not grow further in that direction, and &lt;code&gt;backCalculationGain&lt;/code&gt; pulls it back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;D:&lt;/strong&gt; &lt;code&gt;derivativeGain&lt;/code&gt; times the change of &lt;code&gt;e&lt;/code&gt; per second, smoothed by a low-pass filter. &lt;code&gt;derivativeFilter&lt;/code&gt; is the filter&amp;rsquo;s corner frequency in rad/s: a lower value smooths more. At &lt;code&gt;0&lt;/code&gt; the derivative part does nothing. Keep it well below &lt;code&gt;1/dt&lt;/code&gt;, for example below &lt;code&gt;1000&lt;/code&gt; at a 1 ms cycle.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The sum of the three is limited to &lt;code&gt;controlOutputMin&lt;/code&gt; and &lt;code&gt;controlOutputMax&lt;/code&gt;.&lt;/p&gt;

  &lt;/div&gt;
&lt;/details&gt;


&lt;div class=&#34;pageinfo pageinfo-primary&#34;&gt;
&lt;p&gt;Next: &lt;span class=&#34;fas fa-arrow-alt-circle-right&#34;  aria-hidden=&#34;true&#34;&gt;&lt;/span&gt;
&lt;a href=&#34;/docs/applications/configure_application/robot/&#34;&gt;Step 4: set up the mechanism&lt;/a&gt;.&lt;/p&gt;

&lt;/div&gt;


      </description>
    </item>
    
  </channel>
</rss>
