smbSetJointInputTorque

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.3, Creation date: 2017-01-08, Last change: 2025-09-14

smb changes a joint actuation to InputTorque

Example Illustration

 missing image of smbSetJointInputTorque(Joint,InpPS)

Syntax

smbSetJointInputTorque(Joint,[InpPS])

Input Parameter

Joint: Unique(!) Joint name 'R1' or 'R1.J'
InpPS:




Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, smbSetJointInputTorque, is designed to change the actuation mode of a joint in a SimMechanics model to "InputTorque". Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Algorithm Steps

  1. The function checks if the second argument, InpPS, is provided. If it is, InpPS is set to the value of the second argument; otherwise, it remains an empty string.
  2. If no arguments are provided, the function retrieves the full name of the current block using getfullname(gcb) and prints a message indicating the joint being processed.
  3. The original joint name is stored in OJ, and the function attempts to find the joint using smbWhich by appending '.J' to the original joint name.
  4. If the joint is not found with the appended '.J', the function tries to find it using the original joint name.
  5. The function sets the joint's torque actuation mode to 'InputTorque' using set_param. This changes the joint's behavior to accept an input torque.
  6. The motion actuation mode of the joint is set to 'ComputedMotion', indicating that the motion is computed based on the input torque.
  7. Finally, the function calls smbshow to display the joint's configuration or status.
Algorithm explaination created using ChatGPT on 2025-08-18 22:59. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21