Time delay for state-space block in simulink

3 views (last 30 days)
Dear all,
I'm currently training a Reinforcement Learning algorithm using a DDPG Agent. My goal is to improve some existing strategies for the control of time delay systems. For the moment I am focusing on SISO (Simple Input Simple Output) FOPDT (First Order Plus Dead-Time) systems.
I followed the good practices which indicate to randomely generate Initial conditions for State space. But given that I have a delay, I added a transport delay block. This block 'initialOutput' must be equal to the 'InitialConditions' of my statespace. The problem is that the parameter 'InitialOutput' of the delay block cannot be set during the simulation and I get this error :
Caused by:
Error using rl.env.SimulinkEnvWithAgent>localHandleSimoutErrors (line 681)
Cannot modify value of run-time parameter 2 ('InitialOutput') of 'RLcontroller/Delay' when the
simulation is running. This run-time parameter was registered as having const data and can be
initialized once at the start of simulation
I would have thought that for each new scenario for the RL Agent, the simulation stopped and restarted, but this error seems to say the contrary.
So I searched on matlab Documentation and I find that it is possible to set input delay with the ss() function. The problem is that, I need to use that delay on my state space block and I don't know how to do it, because there is no block parameters for delay in the StateSpace Simulink block.
For the moment, my solution is to use a state space block that i calculate with a Pade Approximation of the delay and which initialCndition is the same as my process state space block.
I wanted to know if there is a way to solve this problem in an order way with Simulink blocks? Thank you in advance for your answers.
Best Regards,
FALCONI Franco

Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!