A C++ console application that sizes and validates a single-link robotic arm: computes cross-sectional geometry, bending stress, and moment of inertia for a given payload and material, then selects and ranks matching motors and gearboxes from a built-in component database.
- Interactive Arm Specification — Enter custom arm length, payload mass, and angular acceleration, or use built-in default specs for a quick run
- Cross-Section Design — Supports both rectangular and circular cross-sections
- Material Selection — Choose from a material database used to compute stress limits
- Stress & Inertia Analysis — Calculates bending moment, moment of inertia, and maximum stress for the initial design, then optimizes the cross-section dimensions to meet stress requirements while minimizing mass
- Motor & Gearbox Matching — Cross-references a motor and gearbox database against the calculated bending moment requirements
- Component Sorting — Sorts and ranks candidate motor/gearbox combinations by suitability for the required torque
main.cpp— Program flow and user interactionArm_data— Arm geometry class (length, cross-section, mass, dimensions)Calculations— Stress and inertia analysis (stress_calcclass)Materials— Material property database and selectionMotor_database/Gearbox_database— Component librariesSorting— Ranks components against calculated requirementsGlobal_functions— Shared I/O and utility functions
- C++ (developed with Code::Blocks, MinGW)
- No external libraries — standard library only
- Open
link designer.cbpin Code::Blocks (or compile the.cppfiles directly with any C++ compiler) - Build and run
- Follow the prompts:
- Choose
newto input custom arm specs, ordeffor default values - Select a cross-section type (
rectangleorcircle) - Select a material from the list
- Choose
- The program outputs the optimized arm dimensions, final mass, max stress, and a ranked list of suitable motors/gearboxes
Eyad Ashraf Zaki — Mechatronics & Robotics Engineering, Ain Shams University