smbDeleteDrive
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.1, Creation date: 2016-11-24, Last change: 2025-09-14
SimMechanics removes the drive block of a joint
See Also: smbDeleteUnconnectedLines
Example Illustration
Syntax
smbDeleteDrive(Joint)
Input Parameter
Joint: | | Name of joint; default is gcb |
Copyright 2016-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)
The function smbDeleteDrive is designed to remove the drive block associated with a joint in a SimMechanics model. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- Joint: This is the name of the joint from which the drive block will be removed. If no joint name is provided, the default is the current block (
gcb).
Algorithm Steps
- Check if the
Joint parameter is provided. If not, set Joint to the current block (gcb).
- Remove the system name from the joint name to get a simplified joint name (
SJoint).
- Construct the full joint path (
LJoint) by combining the current system name (gcs) with the simplified joint name.
- Attempt to retrieve the
MotionActuationMode parameter of the joint using get_param.
- If successful, set the joint's
MotionActuationMode to ComputedMotion and TorqueActuationMode to NoTorque using set_param.
- If an error occurs (e.g., the block is not a joint or drive), print an error message and exit the function.
- Delete the drive block associated with the joint by appending
_DRIVE to the joint path and using delete_block.
- Set the joint's
MotionActuationMode to ComputedMotion and TorqueActuationMode to NoTorque again to ensure the settings are applied.
- Call
smbDeleteUnconnectedLines to remove any unconnected lines in the model.
Algorithm explaination created using ChatGPT on 2025-08-18 22:58. (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