Connection port from global system to subsystem.

19 views (last 30 days)
Mr Beast
Mr Beast on 19 May 2023
Edited: Hari on 12 Sep 2023
Hello there, I am currently working on physical modeling in Simulink. I created a control system with a PID block and passed the output of PID to a subsystem for actuations that contains my physical modeling blocks. That is creating a problem. First I tried the connection ports method, but it required a simulink-PS converter to get attached to the connection port. And another PS-Simulink converter inside the subsystem to give value to the revolute joint inside the subsystem. That gave me an error as two converters cannot be attached serially (But it was required since I want to pass value in subsystem using connection port). Error is a Direct connection between one or more physical signal converters found. Direct connections between physical signal converters are not currently supported. Alternatively, I tried storing the value in 'To workspace on trigger' and used that value using the 'From Workspace' block. But that is also giving me a problem since saving to Workspace creates an output value of double 1x1x10000. While accessing those variables in the subsystem it creates a problem, since I have used a constant block to access them. So to conclude, my aim is to pass the output value somehow to the revolute joint inside subsystem in real time as PID calculates, but it gives me above errors. Please let me know if there is any solution for this.

Answers (1)

Hari
Hari on 30 Aug 2023
Edited: Hari on 12 Sep 2023
Hi,
I understand that you would like to pass the output of the PID Controller to a subsystem.
The error message "Direct connection between one or more physical signal converters found" can occur in various situations. Provide the relevant files pertaining to the issue you are facing in the first approach.
To resolve the issue related to the size of the output variable from the To Workspace block in your second approach, you can make the following modifications:
  1. Change the "Save format" parameter of the To Workspace block from "Time series" to "Array".
  2. Set the "Limit data points to last" parameter of the To Workspace block to "1".
By making these changes, the To Workspace block will store only the most recent value from the PID output, resulting in a scalar value. This scalar value can then be easily connected to the revolute joint inside the subsystem using the From Workspace block.
Refer to the documentation regarding logging data to workspace for more information.

Community Treasure Hunt

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

Start Hunting!