News:

  • July 03, 2026, 04:00:08 PM

Login with username, password and session length

Author Topic: Cascaded PID loops on a Do-More  (Read 17162 times)

Scot

  • Sr. Member
  • ****
  • Posts: 78
Cascaded PID loops on a Do-More
« on: August 21, 2015, 01:20:54 PM »
I've installed my first Do-More and it's such an improvement over the DL260s that I've been using that I'm considering migrating some of my existing DL260 CPUs to Do-More.

During migration, I've started to read about the differences in PID loops in the Do-More vs the DL260. But I haven't been able to find anything about Cascade mode.

With the DL260, a PID loop can be placed in Cascade mode and run inside another PID loop, which I need to do.

With the Do-More, since it has only Auto and Manual modes (no Cascade mode), I'm not sure how I would programmatically change the SP variable pointer in the PID loop structure when I need to change it from Auto mode to a Cascade mode. So in Auto, the loop SP could be V1000 for example but in Cascade the SP needs to change to read from V2000.

Scot

  • Sr. Member
  • ****
  • Posts: 78
Re: Cascaded PID loops on a Do-More
« Reply #1 on: August 21, 2015, 01:42:16 PM »
I think I may have figured out my own question. The SP doesn't appear to be configured during the PID setup. It looks like I Move a value to the PID.SP every scan and just change which variable is moved there depending on the mode I want the loop to be in. In fact, it looks like I have to update that .SP for any PID loop in the program every scan. I just have to be careful to avoid a bump during the change-over.

Sounds like I need to play with the simulator.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Cascaded PID loops on a Do-More
« Reply #2 on: August 21, 2015, 01:46:38 PM »
You will need to use ladder logic to move the .Output of the "outer" loop to the .SP of the "inner" loop via MOVE.

Have the "inner" PID instruction's Auto/Manual mode state (this is the input power-flow logic to the PID instruction) be driven by the .Mode bit of the "outer" PID structure, i.e. the "inner" loop mode follows the "outer" loop mode.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Cascaded PID loops on a Do-More
« Reply #3 on: August 21, 2015, 01:48:36 PM »
I think I may have figured out my own question. The SP doesn't appear to be configured during the PID setup. It looks like I Move a value to the PID.SP every scan and just change which variable is moved there depending on the mode I want the loop to be in. In fact, it looks like I have to update that .SP for any PID loop in the program every scan. I just have to be careful to avoid a bump during the change-over.
Yes.

Quote
Sounds like I need to play with the simulator.
Yes.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Cascaded PID loops on a Do-More
« Reply #4 on: August 21, 2015, 01:53:02 PM »
SP doesn't need to be written every scan, only on change.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Scot

  • Sr. Member
  • ****
  • Posts: 78
Re: Cascaded PID loops on a Do-More
« Reply #5 on: August 21, 2015, 03:36:01 PM »
I was able to get it to work in the simulator. When the inner loop is in Auto you're right, I only have to update the SP if it changes (or hopefully allow it to be changed directly from a C-More. I have not figured out a way to do that yet without using an intermediary real number storage location and copying that continuously to the SP). When I need the inner loop to be in Cascade I do have to update the SP of the inner loop each scan with the output of the outer loop.
It was pretty simple to prevent the outer loop from switching to Auto if the inner loop was in manual and also easy to get rid of the bump when switching to a cascade setup. (Of course, these X inputs would have to be discrete C bits but I was using the simulator here.)
Overall, not as bad as I feared it would be. Picture attached.

The reason I'm considering switching is that particular DL260 has 7 PID loops and 424 rungs of code with a scan time of 32ms. There are 4 C-mores, 4 DL260 based PLCs, and 1 Do-more PLC on the network (the remote racks are on their own dedicated networks). I will be adding 2 more C-mores and 4 more Do-more PLCs to the same network this winter. They will each be publishing a Peerlink block.

All the other DL260s (through their ECom-100s) are currently handling 30+ communications/sec according to DSLaunch but this particular PLC is only providing 6 comms/sec (0 retries and 0 errors). First I'll do some network testing from that one PLC during the next shutdown and maybe try a different ECom-100. If I find no problems there, I am hoping a Do-More upgrade would fix that.
« Last Edit: August 21, 2015, 03:48:06 PM by Scot »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Cascaded PID loops on a Do-More
« Reply #6 on: August 21, 2015, 04:09:09 PM »
I would expect Do-more to be less than 5ms, and comms should be dramatically more responsive.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Scot

  • Sr. Member
  • ****
  • Posts: 78
Re: Cascaded PID loops on a Do-More
« Reply #7 on: August 25, 2015, 11:01:08 AM »
I've run into another issue with Do-More PIDs.

With the DL260, the PID's SP, PV, and Output were all in V memory locations which could be shown on a C-More screen. With the Do-More I have not been able to find a way to access the SP value directly on the C-More.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Cascaded PID loops on a Do-More
« Reply #8 on: August 25, 2015, 11:04:21 AM »
I've run into another issue with Do-More PIDs.

With the DL260, the PID's SP, PV, and Output were all in V memory locations which could be shown on a C-More screen. With the Do-More I have not been able to find a way to access the SP value directly on the C-More.


It's all available, but unfortunately the C-more team isn't taking advantage of it. You'll have to move it in/out from memory that C-more will access.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Cascaded PID loops on a Do-More
« Reply #9 on: August 25, 2015, 11:12:17 AM »
I've run into another issue with Do-More PIDs.

With the DL260, the PID's SP, PV, and Output were all in V memory locations which could be shown on a C-More screen. With the Do-More I have not been able to find a way to access the SP value directly on the C-More.

Sadly, C-more does not support user defined data-blocks or heap-items.  However, you can utilize native R memory, and move those values into/out of your PID structure.  C-more supports native R memory.

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 265
    • Host Engineering, Inc.
Re: Cascaded PID loops on a Do-More
« Reply #10 on: August 25, 2015, 12:55:36 PM »
the INIT - Initialize Data is a handy instruction for moving several pieces of data at one time. It makes the ladder code very readable as well.
Good design costs a lot. Bad design costs even more.