MATLAB Answers

jhusy
0

Training an agent of reinforcement learning as a motor's controller, but Matlab doesn't not do training at all?

Asked by jhusy
on 12 Sep 2019
Latest activity Edited by Emmanouil Tzorakoleftherakis on 16 Sep 2019 at 16:14
Hi, I'm trying to use reinforcement learning to train an agent as a controller of a motor.
My motor's transfer function is:
% The input and output of this transfer function are current and speed, respectively.
69.4/(s+69.4)
After reading this example, I only made some minor modifications:
1. Replace the watertank model with my motor's transfer function like below:
1.png
2. Set the sample time Ts and simulation time Tf to 1/8000 and 10, respectively.
2.png
However, the result is:
3.png
It doesn't work :(
The reward is always zero, and I don't know why.
Could anybody give me advices on how to deal with this problem?
Very thankful in advance.

  0 Comments

Sign in to comment.

1 Answer

Answer by Emmanouil Tzorakoleftherakis on 16 Sep 2019 at 16:13
Edited by Emmanouil Tzorakoleftherakis on 16 Sep 2019 at 16:14

Hello,
It is hard to pinpoint the problem exactly without a repro model, but sounds like training stops prematurely. Can you remove the "Stop Simulation" subsystem from your model? I suspect that this flag is always set to true for the new plant.

  0 Comments

Sign in to comment.