User Tools

Site Tools


mycnc:closed_loop_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mycnc:closed_loop_configuration [2018/10/09 14:03] skirillovmycnc:closed_loop_configuration [2019/11/05 08:54] (current) ivan
Line 1: Line 1:
 ===== MyCNC closed loop configuration ===== ===== MyCNC closed loop configuration =====
  
-A proportional–integral–derivative controller (PID controller) is a control loop feedback mechanism widely used in industrial control systems and a variety of other applications requiring continuously modulated control. A PID controller continuously calculates an error value E(t) as the difference between the desired setpoint position (POS) and a real position measured by encoders (ENC) and applies a correction based on proportional, integral, and derivative terms (denoted P, I, and D respectively). +A proportional–integral–derivative controller (PID controller) is a control loop feedback mechanism widely used in industrial control systems and a variety of other applications requiring continuously modulated control. A PID controller continuously calculates an error value E(t) as the difference between the desired setpoint position (POS) and a real position measured by [[mycnc:rotary_encoder_connection_and_setup|encoders]] (ENC) and applies a correction based on proportional, integral, and derivative terms (denoted P, I, and D respectively). 
  
  
Line 42: Line 42:
   * Adjust DAC offset ratio to get "0V" value on DAC output for each channel. Theoretical DAC value for 0V is the middle of 12bits range \\ 4096/2=**2048**. \\ A real value may vary +/-5%. \\ {{mycnc:closed-loop:mycnc-closed-loop-003.png}}   * Adjust DAC offset ratio to get "0V" value on DAC output for each channel. Theoretical DAC value for 0V is the middle of 12bits range \\ 4096/2=**2048**. \\ A real value may vary +/-5%. \\ {{mycnc:closed-loop:mycnc-closed-loop-003.png}}
   * Fill Encoder channel for each PID (Motor#). \\ {{mycnc:closed-loop:mycnc-closed-loop-004.png}}    * Fill Encoder channel for each PID (Motor#). \\ {{mycnc:closed-loop:mycnc-closed-loop-004.png}} 
-  * To test selected channel, check "Enable" checkbox for the channel and enter initial value of "50" for Proportional P-ratio of PID controller. Press "Enter" to save the changes. We test PID#5 (motor channel #5) on the screenshot below. \\ {{mycnc:closed-loop:mycnc-closed-loop-005.png}}  +  * To test selected channel, check "Enable" checkbox for the channel and enter initial value of "50" for Proportional P-ratio of PID controller. Press "Savebutton to save the changes. We test PID#5 (motor channel #5) on the screenshot below. \\ {{mycnc:closed-loop:mycnc-closed-loop-005.png}}  
-  * Click on "Servo-ON" button to reset & enable selected PID and turn ON "Servo-ON" signal. Servo-On procedure +  * Click on "Servo-ON" button to reset & enable selected PID and turn ON "Servo-ON" signal. Servo-On procedure will ... 
     * Reset position error registers - **E(t)** and its Integral value.     * Reset position error registers - **E(t)** and its Integral value.
     * Turn ON Servo-ON output to enable a servo driver     * Turn ON Servo-ON output to enable a servo driver
-    * Turn ON PID all "Enabled" controllers (Checkboxes "Enable" are checked)+    * Turn ON all "Enabled" PID controllers (Checkboxes "Enable" are checked).
   * Select the channel for a scope widget to control and tune PID controller ratios. \\ {{mycnc:closed-loop:mycnc-closed-loop-006.png}}    * Select the channel for a scope widget to control and tune PID controller ratios. \\ {{mycnc:closed-loop:mycnc-closed-loop-006.png}} 
   * Check which Axis the PID controller attached to (Y axis for the screenshot below). \\ {{mycnc:closed-loop:mycnc-closed-loop-007.png}}   * Check which Axis the PID controller attached to (Y axis for the screenshot below). \\ {{mycnc:closed-loop:mycnc-closed-loop-007.png}}
-  * Jog buttons can be used to move the axis and tune PID coefficients. \\ {{mycnc:closed-loop:mycnc-closed-loop-008.png}} +  * Jog buttons can be used to move the axis while testing and tuning the PID coefficients. \\ {{mycnc:closed-loop:mycnc-closed-loop-008.png}} 
-  * An analogue servo driver normally has a linear function of rotation speed depends on input voltage. A linear coefficient of this function depends on Servo driver and motor, gears, ball-screw. PID **K** value represent this coefficient. \\ {{mycnc:closed-loop:mycnc-closed-loop-009.png}} \\ The value can be tuned manually. If rotate a motor shaft with speed more than 20 turn/sec, the controller calculates real Speed/Voltage coefficient and print it on the configuration widget. You can use this value as information to tune the PID **K** ratio. A button **<<** to the right of **PID K** input line can be used to copy the measured **K** ratio to **PID K**. \\ {{mycnc:closed-loop:mycnc-closed-loop-010.png}}+  * An analogue servo driver normally has a linear function of rotation speed depends on input voltage. A linear coefficient of this function depends on Servo driver and motor, gears, ball-screw etc\\ PID **K** value represent this coefficient. \\ {{mycnc:closed-loop:mycnc-closed-loop-009.png}} \\ The value can be tuned manually. If rotate a motor shaft with speed more than 20 turns/sec, the controller calculates real Speed/Voltage coefficient and print it on the configuration widget. You can use this value as information to tune the PID **K** ratio. A button **<<** to the right of **PID K** input line can be used to copy the measured **K** ratio to **PID K**. \\ {{mycnc:closed-loop:mycnc-closed-loop-010.png}}
  
 ==== Servo ON handling ==== ==== Servo ON handling ====
Line 97: Line 97:
   * Write "1" to register number **60000** will turn ON Motor closed-loop control PIDs   * Write "1" to register number **60000** will turn ON Motor closed-loop control PIDs
   * Write "1" to register number **60001** will turn OFF Motor closed-loop control PIDs   * Write "1" to register number **60001** will turn OFF Motor closed-loop control PIDs
-Reading this registers has no effect and return zero value.+Reading this registers has no effect and return zero value. Read more about Servo ON/Servo OFF commands in this short manual: [[mycnc:servo_on_off|Servo ON/OFF]].
  
 3. Automatic Servo ON/OFF. There are 2 handler procedures in Software PLC can be used to automatic PID ON/OFF. 3. Automatic Servo ON/OFF. There are 2 handler procedures in Software PLC can be used to automatic PID ON/OFF.
mycnc/closed_loop_configuration.txt · Last modified: 2019/11/05 08:54 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki