WireBiter665 (Customer) asked a question.

DL 05 PID Loop not allowing SV and PV addresses to be modified properly.

I'm pretty sure I'm doing something wrong as this is my first time setting up a PID loop with a DirectLogics PLC. I went through the manual, help file, and a few places online to set up the loop. I'm using DirectSoft 6. I have an extremely simple ladder logic program. I am only using the PID loop as a speed trim value to maintain tension on a web which uses a 1-10v analog prox and a concentric cam.

 

First point: I do NOT have the ramp/soak enabled and, as was mentioned in many places, that is one of the things that could change those address values or not allow them to be changed.

 

Second point: These V addresses do NOT appear in the ladder logic anywhere else. I only have 8 rungs of logic total.

 

The PID loop is set at address V2100. (V2100-V2137).

 

Analog in are on V2000 and V2001. They work perfectly so no issues there. V2000 is main line speed and V2001 is prox feedback from the dancer (0V = too much tension, 10V = not enough tension). It's a 12 bit input and thus 0-4095 value. I want to set the PID SV to 2048 to maintain the dancer in the center of travel. So I put a rung in with a SP1 contact, then LD: K2048 and subrung with OUT V2102. When I had that configuration and opened up PID View to look at what the PID was doing, SP was 72 and would not and could not be changed. It would always revert to 72. I set the SP1 contact to a SP0 (first scan) and that seemed to work at setting the value to 2048. But now it's stuck at 2048 so I can't change it while the loop is operating. So the first main question is: How do you set the PID loop Setpoint Value in the ladder logic?

 

Next we have the PV. I added a rung with a SP1 contact and did LD: V2001 then OUT: V2103. In PID View, the PV is not even close to what both V2001 and V2103 are displaying. It seems to go closer to 0 when I move the dancer toward the center and then goes up on either side of that while both V2001 and V2103 start low with the dancer pulled down and go high when the dancer goes up. I also tried using the option to automatically retrieve from a V memory address but I got the same results. I tried this using both uni and bi polar. I prefer bipolar so I can just add the PID OUT to the Main Line Speed to give the slight offset needed to hold tension. So this is question #2: How do you input the PV into the loop?

 

FWIW, I have programmed PID loops in other PLCs (Allen Bradley, Productivity, Omron) with no issues whatsoever. I THOUGHT this would be straightforward but I have a feeling I'm missing something. I also hope I gave enough info.

 

PID Settings:

CONFIGURE

Position

Sample Rate I tried .05 and .5

Forward-Acting

Bumpless II

Common format

Bipolar data format

12-bit

 

SP/PV

Setpoint Variable shows the V2102.

Process Variable shows the V2103

Nothing else here selected.

 

OUTPUT

Address shows the V2105

Upper Limit +4095

Lower Limit -4095

Bipolar

12-bit

 

TUNING

Gain 1.00

Reset 12.00

Rate 1.50

 

R/S

Disabled


  • HOST_franji1 (HOST Engineering)

    I'm going to guess that LD K2048 needs to be binary (hex). Try LD K0800 (2048 in hex). 12 bit range then is K0000 thru K0FFF. Kx048 is 72 decimal (that's why I think K0800 will work).

    Selected as Best
  • HOST_franji1 (HOST Engineering)

    I'm going to guess that LD K2048 needs to be binary (hex). Try LD K0800 (2048 in hex). 12 bit range then is K0000 thru K0FFF. Kx048 is 72 decimal (that's why I think K0800 will work).

    Selected as Best
  • WireBiter665 (Customer)

    You are correct. When I look at the values in Data View, V2102 shows 0800 using the HEX option. 2048 in Decimal.

     

    Thank you for pointing that out.

  • WireBiter665 (Customer)

    On a hunch, I changed from 12 bit to 15 bit and now it seems to be mostly working. I'm able to set the setpoint and the PV matches the input. So that problem seems to be solved.

     

    And now I have a completely unrelated problem. The PLC seems to not want to do math instructions ever scan even with an SP1 contact on the rung. The math is completely separate from the PID since some of the values have nothing to do with the PID but I only see the correct values pop up maybe 1 second out of every 10. The rest of the time it's as if no math was done. (Adding and dividing).

    Expand Post
    • HOST_franji1 (HOST Engineering)

      I recommend you start a new topic regarding the unrelated problem since the original question has been labeled "answered". (Nobody will bother reading "answered" topics, especially on an unrelated secondary question).

       

      Just start a new topic with a new relevant title.

      • WireBiter665 (Customer)

        No worries. The other issue was quickly resolved. Data type mismatch which is what I suspected. I was just typing out my frustrations. One of those "We've all been here before. Solve one problem and another pops up." LOL