How to transfer (send) data from m-file to the Simulink if they are running at the same time?

1 view (last 30 days)
Main task: to implement the controller which allows robotArm to play with the ping-pong ball in vertical direction with height 0,6..1,0 m. Implementation is done by dividing the task on two parts: a vision system and a robotArm controller. The vision system identifies the ball and makes prediction of impact of the ball with the paddle. The robotArm controller moves paddle to the calculated point. The vision system is implemented in Matlab script (m-file). The robotArm controller is implemented in Simulink with QuaRC.
At the first I am running the robotArm controller (Simulink) and then the Vision System (m-file). The Simulink file consumes 16% of CPU power and the m-file 40% of CPU.
Question: My question is how can I transfer (send) data from m-file to the Simulink model? I want to send predicted coordinates of the contact of the ball-paddle system with time. So, 4 numbers. What kind of blocks/functions I can use in Simulink? Note, data which I want to send is calculating every cycle, so it is on-line mode (not the precalculated data). The period of sending data is about 0,5..0,8 sec.
  7 Comments
snow John
snow John on 13 Jul 2023
Hello sir, is there some more new details for your project after years ago
Did you implement your work by using the matlab for robot control and image processing at the same time ?
Thanks,
-jian
Walter Roberson
Walter Roberson on 13 Jul 2023
Looking back, I wonder why I did not suggest re-implementing the vision portion using the vision Simulink blocks, so that everything was inside Simulink?

Sign in to comment.

Answers (0)

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!