Hi @Wenlong,
Thanks for reaching out! To display the trajectory of your robotic arm's fingertip in Mechanics Explorer, you'll need to use a combination of the Transform Sensor block and the Spline block. Here's the approach:
1. Transform Sensor (Simscape > Multibody > Frames and Transforms) 2. PS-Simulink Converter blocks (Simscape > Utilities) - you'll need 3 of these 3. To Workspace blocks (Simulink > Sinks) - 3 blocks to capture X, Y, Z coordinates 4. Spline block (Simscape > Multibody > Body Elements)
And here are the setup steps
Add a Transform Sensor block to measure the fingertip position relative to the World Frame. Then, connect the base port (B) to your World Frame and the follower port (F) to the fingertip frame. In the Transform Sensor dialog, select Translation > X, Y, and Z to output all three coordinates.Connect each output through a PS-Simulink Converter (set units appropriately, e.g., "m" or "cm"). Use To Workspace blocks to save the trajectory data (name them x_traj, y_traj, z_traj). Add a Spline block and configure it to display the trajectory curve in Mechanics Explorer
Important Note: The trajectory will display as a complete curve throughout the simulation rather than drawing incrementally in real-time. You'll need to pass all the XYZ coordinate points to the Spline block.
Helpful Resources:
- Transform Sensor tutorial: https://www.mathworks.com/help/sm/ug/sense-double-pendulum-motion.html
- Transform Sensor reference: https://www.mathworks.com/help/sm/ref/transformsensor.html
- Mechanics Explorer overview: https://www.mathworks.com/help/sm/ref/mechanicsexplorer-app.html
Hope this helps!