From: Thompson, Joe <jthompson@xxxxxxxx>
Sent: Wednesday, July 31, 2024 12:20 PM
To: volttron-dev@xxxxxxxxxxx
Cc: Smallwood, Seann <SSmallwood@xxxxxxxx>; Allwardt, Craig H <Craig.Allwardt@xxxxxxxx>; Raker, David M <david.raker@xxxxxxxx>; Niddodi, Shwetha <shwetha.niddodi@xxxxxxxx>
Subject: Volttron 8.1: How to Pause the handle_publish
Hello Volttron Team,
The Issue:
We are running into a challenge that we need help with. Please see the attached agent.py for reference. We have a little 5 second control loop for orchestrating the operation of an inverter with a battery energy storage system.
Every 5 seconds:
- the platform driver reads from the inverter and published its data
- via a subscription to the inverter’s topics, the handle_publish callback is fired
- our control logic is all contained within handle_publish
- one loop of the controller finished in well under 5 seconds, so the next iteration commences on the next handle_publish call
This has worked well for a long time until recently introducing some more complex controls. Essentially we have added a new control step that is called whenever the controller notrices that the battery’s contactor has opened up. This new
step / procedure, “close_contactor”, is called and is tasked with running through some steps to attempt to close the contactor again so that the controller can continue like normal.
But the “close_contactor” procedure is guaranteed to take around 70 seconds to complete due to some gevent.sleep() calls. During this time, there seems to be many other control threads that pop up every 5 seconds as the handle_publish callback
continues to be called in each subsequent 5 second interval.
Desired Behavior:
We are looking for a way to temporarily pause the execution of subsequent handle_publish callback calls while an existing thread is already running handle_publish. Is there a way to do this in Volttron? Or is our approach to this controller
fundamentally flawed and we will need to refactor our control algorithm?
Thank you for your time!
Joe Thompson
Technical Leader
Electric Power Research Institute
Energy Storage and Distributed Generation
(912) 663-3407
*** This email message is for the sole use of the intended recipient(s) and may contain information that is confidential, privileged or exempt from disclosure under applicable
law. Unless otherwise expressed in this message by the sender or except as may be allowed by separate written agreement between EPRI and recipient or recipient’s employer, any review, use, distribution or disclosure by others of this message is prohibited
and this message is not intended to be an electronic signature, instrument or anything that may form a legally binding agreement with EPRI. If you are not the intended recipient, please contact the sender by reply email and permanently delete all copies of
this message. Please be advised that the message and its contents may be disclosed, accessed and reviewed by the sender's email system administrator and/or provider. ***