Skip to content

Commit

Permalink
BF: Basics of closed-loop control #1046
Browse files Browse the repository at this point in the history
  • Loading branch information
detlefarend committed Nov 15, 2024
1 parent bf00318 commit f9b0332
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/mlpro/bf/control/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
## -- - new helper functions get_ctrl_data(), replace_ctrl_data()
## -- 2024-11-11 0.15.0 DA Implementation of custom method ControlWorkflow._on_event()
## -- 2024-11-14 0.16.0 DA Introduction of time management
## -- 2024-11-15 1.0.0 DA Various corrections
## -------------------------------------------------------------------------------------------------

"""
Ver. 0.16.0 (2024-11-14)
Ver. 1.0.0 (2024-11-15)
This module provides basic classes around the topic closed-loop control.
Expand Down Expand Up @@ -396,7 +397,10 @@ def _run(self, p_inst: InstDict):
self._last_update = tstamp_after
self.log(Log.C_LOG_TYPE_I, 'Computation finished')
else:
self.log(Log.C_LOG_TYPE_I, 'Computation skipped')
self._current_ctrl_var = self._current_ctrl_var.copy()
self._current_ctrl_var.id = so.get_next_inst_id()
self._current_ctrl_var.tstamp = so.get_tstamp()
self.log(Log.C_LOG_TYPE_I, 'Computation skipped. Last action duplicated.')


# 4 Complete and store new control variable
Expand Down Expand Up @@ -728,7 +732,9 @@ def init( self,

self._ctrlled_var_space = p_ctrlled_var_space
self._ctrl_var_space = p_ctrl_var_space
self._timer = Timer( p_mode = p_mode )

mode_timer = 1 - p_mode
self._timer = Timer( p_mode = mode_timer )

if ( self.latency is None ) or ( p_latency < self.latency ):
self.latency = p_latency
Expand Down

0 comments on commit f9b0332

Please sign in to comment.