MeasureForce
Overview
Section titled “Overview”The MeasureForce component measures forces and torques acting on Unity joints, providing real-time monitoring of mechanical loads in your simulation. This component reads force and torque values from a joint component and outputs them through PLC signals, making it essential for load monitoring, force-based control systems, and mechanical stress analysis.
MeasureForce automatically extracts force and torque data from Unity’s joint physics system and converts them into both readable properties and PLC signal outputs for external system integration.
[Screenshot: MeasureForce component in Inspector showing force/torque readings and PLC signal assignments]
Properties
Section titled “Properties”Force Measurements
Section titled “Force Measurements”Force (Vector3, read-only) Current force vector in Newtons acting on the joint. Displays the X, Y, and Z components of the force being applied to the joint. These values update in real-time during physics simulation and reflect the actual loads on the mechanical connection.
AbsForce (float, read-only) Absolute magnitude of the force vector in Newtons. This single value represents the total force regardless of direction, useful for load monitoring applications where the direction is less important than the total magnitude.
Torque Measurements
Section titled “Torque Measurements”Torque (Vector3, read-only) Current torque vector in Newton-meters acting on the joint. Shows the rotational forces around the X, Y, and Z axes, providing insight into rotational loads and moments acting on the joint connection.
AbsTorque (float, read-only) Absolute magnitude of the torque vector in Newton-meters. Represents the total rotational load magnitude, useful for applications requiring overall torque monitoring without directional considerations.
PLC Signal Outputs - Force
Section titled “PLC Signal Outputs - Force”ForceX (PLCInputFloat) PLC signal output for force X component in Newtons. Connect to external systems to monitor horizontal force along the X-axis, useful for detecting side loads or lateral forces in mechanical systems.
ForceY (PLCInputFloat) PLC signal output for force Y component in Newtons. Provides vertical force monitoring along the Y-axis, essential for weight measurement applications and vertical load monitoring.
ForceZ (PLCInputFloat) PLC signal output for force Z component in Newtons. Monitors force along the Z-axis for depth-related loads and forward/backward force analysis in mechanical assemblies.
ForceAbs (PLCInputFloat) PLC signal output for absolute force magnitude in Newtons. Provides a single force value representing total load regardless of direction, ideal for overload protection and general load monitoring applications.
PLC Signal Outputs - Torque
Section titled “PLC Signal Outputs - Torque”TorqueX (PLCInputFloat) PLC signal output for torque X component in Newton-meters. Monitors rotational loads around the X-axis, useful for detecting twisting forces and rotational stress in mechanical joints.
TorqueY (PLCInputFloat) PLC signal output for torque Y component in Newton-meters. Provides torque monitoring around the Y-axis for applications requiring rotational load analysis and moment measurement.
TorqueZ (PLCInputFloat) PLC signal output for torque Z component in Newton-meters. Monitors torque around the Z-axis for rotational applications and moment analysis in vertical rotation systems.
TorqueAbs (PLCInputFloat) PLC signal output for absolute torque magnitude in Newton-meters. Single value representing total rotational load regardless of axis, perfect for general torque monitoring and overload protection.
Usage Examples
Section titled “Usage Examples”Load Monitoring Setup
Section titled “Load Monitoring Setup”- Joint Requirement: Ensure your GameObject has a Unity Joint component (HingeJoint, FixedJoint, etc.)
- Add Component: Attach MeasureForce to the same GameObject as the joint
- Monitor Values: Observe Force and Torque properties in the Inspector during play mode
- Check Magnitudes: Use AbsForce and AbsTorque for simplified load monitoring
PLC Integration Example
Section titled “PLC Integration Example”- Connect Signals: Assign PLCInputFloat components to desired force/torque outputs
- Interface Setup: Connect PLC signals to your chosen interface (OPC-UA, S7, etc.)
- Threshold Monitoring: Use external PLC logic to monitor force/torque thresholds
- Safety Systems: Implement overload protection based on force magnitude readings
Mechanical Analysis Application
Section titled “Mechanical Analysis Application”- Critical Joint Monitoring: Place MeasureForce on joints subject to high loads
- Real-time Analysis: Monitor force vectors during different operating conditions
- Load Distribution: Use multiple MeasureForce components to analyze load paths
- Performance Optimization: Identify areas of excessive mechanical stress
Integration Notes
Section titled “Integration Notes”Joint Compatibility
Section titled “Joint Compatibility”- Required Component: Unity Joint component must be present on the same GameObject
- Joint Types: Compatible with all Unity joint types (HingeJoint, FixedJoint, SpringJoint, etc.)
- Physics Dependency: Requires active physics simulation for accurate force measurement
- Real-time Updates: Force values update during FixedUpdate for physics consistency
Performance Considerations
Section titled “Performance Considerations”- Component automatically caches null checks during initialization for optimal performance
- Updates occur in FixedUpdate to synchronize with Unity’s physics timestep
- Only connected PLC signals are processed to minimize computational overhead
- Force calculations use Unity’s built-in joint force measurement system
Measurement Accuracy
Section titled “Measurement Accuracy”- Forces reflect actual physics simulation loads based on joint constraints
- Accuracy depends on Unity physics settings and timestep configuration
- Joint breaking forces and limits affect the measurement range
- Consider joint damping and spring settings for measurement stability
Troubleshooting
Section titled “Troubleshooting”No Force Readings
Section titled “No Force Readings”- Verify that a Unity Joint component is attached to the same GameObject
- Ensure physics simulation is running and the joint is under load
- Check that joint breaking force limits are not exceeded
Inconsistent Values
Section titled “Inconsistent Values”- Verify Fixed Timestep settings in Unity’s Time settings
- Check joint configuration for stability issues
- Consider joint damping settings for smoother readings
PLC Signal Issues
Section titled “PLC Signal Issues”- Confirm PLCInputFloat components are properly assigned
- Test interface connection and signal flow
- Verify signal scaling and units match external system expectations
Performance Impact
Section titled “Performance Impact”- Use only necessary PLC signal outputs to minimize processing
- Consider update frequency requirements for your application
- Monitor physics performance impact in complex scenes with many joints
See Also
Section titled “See Also”- Sensor - Basic sensor components and configuration
- Measure - Distance and position measurement
- Interfaces - PLC signal integration options
- Joint - Unity joint configuration and setup
© 2025 realvirtual GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.