No announcement yet.

PID to Control Pressure

  • Filter
  • Time
  • Show
Clear All
new posts

  • PID to Control Pressure

    My objective is to create a pressure control for a syringe pump. The linear motion for the syringe is a ball screw which is turning using stepper motor. I am using a P2000 and a P2-HSO to control the stepper motor drive. I have programmed using the PID function and tuned the system to be able to get to my pressure setpoint and level off quickly. However when it is sitting at the setpoint my output is cycling back and forth continually. I was wondering if there was a way to setup a deadband so the output would be 0 when I am within the deadband and then have the output of the PID start again when out of the deadband. I have tried inserting coils to disable the PID or put it in manual mode when in the deadband, but the output winds up to max and when the system goes out of the deadband the motor starts at max velocity.

    The deadband option in the PID holds the output at the last value, therefore output may not necessarily be at zero and the motor continually runs in one direction. My PID is setup to output from -2000 to 2000 and when at the setpoint the output is continually cycling +/-30, which is a small amount but I don't what to wear out parts by continually cycling.

    Any suggestions would be appreciated.

  • #2
    I try to understand how your pid output value turns into a high speed incremental command to the stepper

    i guess your pid output represents a +/- 2000 x ( max incremental speed of the stepper). The +/- gives you direction.
    then the pid output falls within +/- 30, which turns into a shaft wobble at the stepper.

    If thatís what it is, then donít use the pid output as a measure of stepper speed.

    If your stepper increments at max speed when the pid outputs +/-2000, use math: if abs(pid)<50 then speed out =0, else speed out=(2000-abs(pid)), dir out = sgn(pid).


    • #3

      Maybe I should explain a little more how my system and pid is setup. In the P2-HSO I have setup my channel to have scaling than represents Flow rate, ml/hr, which is Max of 2000.

      The process variable of my pid is my pressure reading which is 0 to 3000 psi. The Output is the flow rate and the range is -2000 to 2000 and the sign of the output is the direction. I am using this output as the velocity value in a Velocity Move function. I have the system tuned with the following values

      Gain = 90
      Integral = 2.25
      Derivative = .345
      Sample rate = 20 ms

      This was done by trial and error until I was able to achieve a system that was not cycling. The autotuned came up with a gain of 3.75, but this would not stop cycling around the setpoint, around +/- 300 psi.

      In your suggestion, is the abs(pid) the absolute of the output from my pid? If so when my output winds up to 2000, using you math would make the speed out = 0? Maybe its the way I have my PID tuned to work with this but I feel that if I was to fix the PV and the SP at the same value the output would continue to increase until there is a change. Is there something I can to do correct this.