Simulink Real-Time TCP strange delay effect of launching models to Speedgoat

11 visualizaciones (últimos 30 días)
I have connected two Speedgoats and wish to send data between them. Right now, I sample a sine wave with sampling time 0.01 and send that data via TCP to the other Speedgoat, which sends it back after some small processing (added an accumulator for debugging purposes). This is the Simulink setup:
Server:
Client:
I start the client later than the server.
start(server);
pause(30);
start(client);
pause(50);
stop(server);
stop(client);
This is the output of the client:
This shows that the integrator has been accumulating for around 30 seconds (the pause between starting the server and client), whereas I would expect the output to start at zero and slowly go up without this sudden jump. Note that this example is somewhat artificial, as what I am really trying to do is design a control system over TCP, but I was facing similar issues of strange effects in the feedback loop. If I remove the accumulator, the output of the client should mimic the sine wave with minimal delay, starting from the data point where it was at (since we have added a delay of 30 seconds + the delay of starting up the systems). Instead, the output is that of the sine wave starting at t=0.
How could I address this erroneous behaviour?

Respuestas (0)

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by