ezeio2:scriptref:pid_new

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revisionBoth sides next revision
ezeio2:scriptref:pid_new [2022-03-30 23:25] andrehezeio2:scriptref:pid_new [2022-03-30 23:40] andreh
Line 5: Line 5:
 === Description === === Description ===
  
-<code>PID_new( pid[], Float:in, Float:out )</code>+<code>PID_new( pid[], Float:set, Float:out )</code>
 <code>PID_dir( pid[], direction )</code> <code>PID_dir( pid[], direction )</code>
 <code>PID_set( pid[], Float:set )</code> <code>PID_set( pid[], Float:set )</code>
Line 14: Line 14:
 === Parameters === === Parameters ===
  
-| ''in''Feedback value |+| ''set''setpoint / target |
 | ''out'' | Initial output value | | ''out'' | Initial output value |
 | ''direction'' | 1 (normal) or -1 (reverse) | | ''direction'' | 1 (normal) or -1 (reverse) |
-| ''set'' | setpoint / target | 
 | ''Kp'' | Proportional component | | ''Kp'' | Proportional component |
 | ''Ki'' | Integral response component | | ''Ki'' | Integral response component |
Line 36: Line 35:
    main()     main() 
    {    {
-      // Initialize the PID with mid range input and no output+      // Initialize the PID with target and no output
       PID_new(p, 50.0, 0.0);       PID_new(p, 50.0, 0.0);
              
Line 44: Line 43:
       // Set the tuning parameters        // Set the tuning parameters 
       PID_tune(p, 0.2, 0.04, 0.01);       PID_tune(p, 0.2, 0.04, 0.01);
-       
-      // Set setpoint (target pressure) 
-      PID_set(p, 40.0); 
              
       // Set update speed to 100ms       // Set update speed to 100ms
  • ezeio2/scriptref/pid_new.txt
  • Last modified: 2022-03-30 23:44
  • by andreh