Hi @Abolfazl ,
I first tried to understand error messages mentioned in your comments.
FFAdaptationExp Model 2024 Rotation/Reaching center-out and FFAdaptationExp Model 2024 Rotation/Target/Simulation 3D Generic Actor.
Analysis of first error message: The first error indicates a sample time mismatch between two blocks:
The sample times must be integer multiples of one another for successful data transfer. Your current configuration does not meet this requirement.
Analysis of second error message: The second error relates to setting the Translation property of the Simulation 3D Generic Actor. It must be a matrix with three columns (representing x, y, z coordinates).
So, after going through documentations listed at the links below
https://www.mathworks.com/help/sl3d/simulation3dactor.html
https://www.mathworks.com/help/rtw/ug/rate-transitions-and-data-transfers.html
Here are my suggestions listed below.
Resolving Sample Time Issues
Check Sample Times: Ensure that both blocks have sample times set as integer multiples. For instance, if one block is set to 0.05 seconds, the other should ideally be set to 0.1 seconds (2x) or 0.025 seconds (0.5x).
Using Rate Transition Block: If you already tried using a Rate Transition block and it did not resolve the issue, double-check that:
- The parameter “Ensure deterministic data transfer” is unchecked if you want to allow for more flexibility in data transfer.
- Both blocks connected through the Rate Transition are configured correctly with their respective sample times.
Setting Up the Simulation 3D Actor
- Translation Property: Verify that you are setting the Translation property correctly. It should be defined as a vector of size [1,3]. For example, [x,y,z], where each value represents a coordinate in meters.
- If you are passing dynamic values, ensure they are being formatted correctly before assignment.
Debugging Steps
- Simplify your model by isolating problematic blocks and testing them independently to confirm they work as expected.
- Use debugging tools available in Simulink to step through your model execution and identify where errors arise.
If issues persist after adjusting settings, consider checking for updates or patches for your MATLAB version as sometimes bugs can lead to simulation issues. Consult MATLAB’s documentation on Rate Transition Blocks and Simulation 3D Actors links provided above, which can provide further insights into proper configurations and common pitfalls.
Always maintain clarity in sample time management across your entire Simulink model; mismatched sample rates can lead to cascading errors. For complex simulations involving multiple components, consider implementing unit tests on smaller subsystems before integrating them into larger models.
By following these steps, you should be able to resolve the errors encountered in your Simulink model and successfully run your simulation with the 3D actor configuration.
If further issues arise, providing specific error messages can help narrow down solutions more effectively.
Hope this helps.
Please let me know if you still have any further questions.