此示例演示如何使用Simscape™多体™模型查找稳态操作点findop
使用基于项目的优化器。仿真结果验证了该方法的有效性。
打开Simulin金宝appk模型。
mdl =“scdbackhoeTRIM”;open_system (mdl)
在创建操作点规范之前,将模型配置为使用模型初始条件。
set_param (mdl“LoadExternalInput”,“关闭”)set_param (mdl“LoadInitialState”,“关闭”)
创建默认的操作点规范对象。
行动= operspec (mdl);
对输出施加约束。
ops.Outputs (1)。1 = true(10日);ops.Outputs (1) .y (1) = 0;%斗角ops.Outputs (1) .y (3) = 50;%上角ops.Outputs (1) .y (5) = -50;%降低角ops.Outputs (1) .y (7) = 0;%底角ops.Outputs (1) .y (9) = -45;%的金宝app支持角度
配置修剪优化器选项。设置“OptimizerType”
选项“graddescent-proj”
,这是一个基于项目的修剪优化器,强制模型物理状态的一致性。若要显示修剪进度,请设置“DisplayReport”
选项“通路”
。
选择= findopOptions (“OptimizerType”,“graddescent-proj”,…“DisplayReport”,“通路”);opt.OptimizationOptions。MaxFunEvals = 20000;
找到满足这些条件的稳态工作点。下面的命令需要几分钟。
(op, rpt) = findop (mdl、行动、选择);
优化以求解所有期望DX / DT = 0,X(K + 1)-x(K)= 0,并且Y =欧登塞艾茨。(最大误差)块---------------------------------------------------------(4.50000e + 01)scdbackhoeTRIM /输出1(3.88972e + 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂右/回转关节臂(3.25130e金宝app00)scdbackhoeTRIM /工厂/挖土臂/臂 - 铲斗接头(2.92756e + 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂向左/回转关节臂(2.90835e + 00)scdbackhoeTRIM /工厂金宝app/安装组件/安装底座和支撑臂/支撑臂向左/回转关节臂(2.87033e +金宝app 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂向左/回转关节臂(2.88039e + 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂向左/回转关节臂(2.75915e + 00金宝app)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂向左/回转关节臂(2.82770e + 00)scdbackhoeTRIM /工厂/安装组件/安装底座和支撑臂/支撑臂左/金宝app转动关节臂(2.83204e + 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂向左/回转关节臂(2.77134e + 00)scdbackhoeT金宝appRIM /植物/安装/装配安装底座和支撑臂/支撑臂左/回转关节臂(2.77170e + 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂左/回转关节臂(2.66093e + 00)scdbackhoeTRIM 金宝app/植物/安装/装配安装底座和支撑臂/金宝app支撑臂左/回转关节臂(1.91196e + 00)scdbackhoeTRIM /植物/安装/装配安装底座和支撑臂/支撑臂向左/回转关节臂(1.48418e + 00)scdbackhoeTRIM /工厂/气缸底座在安装板(1.48194E + 00)scdbackhoeTRIM /工厂/气缸底座在安装板(1.92844e + 00)scdbackhoeTRIM /输出1(1.47015e + 00)scdbackhoeTRIM /工厂/气缸底座在安装板(1.46951e + 00)scdbackhoeTRIM /工厂/气缸底座到安装板(1.47048e + 00)scdbackhoeTRIM /工厂/气缸底座在安装板(1.47087e + 00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47081e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47072e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47065e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47067e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47062e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47044e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47049e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47044e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47035e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.47009e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.46945e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.46915e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.46650e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.45218e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.43599e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.39092e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.32192e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.32141e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34505e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34732e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34643e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34590e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34577e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34579e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34598e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34609e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34550e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.34208e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.33732e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (1.21415e+00) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (5.03874e-01) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (5.04915e-01) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (3.02028e-01) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (2.00116e-01) scdbackhoeTRIM/Out1 (2.80354e-01) scdbackhoeTRIM/Out1 (8.41676e-02) scdbackhoeTRIM/Plant/Lower Arm to Mounting Assembly (9.96485e-02) scdbackhoeTRIM/Plant/Lower Arm to Mounting Assembly (1.04079e-01) scdbackhoeTRIM/Plant/Lower Arm to Mounting Assembly (9.08181e-02) scdbackhoeTRIM/Out1 (8.72986e-02) scdbackhoeTRIM/Out1 (2.96463e-02) scdbackhoeTRIM/Plant/Backhoe Arm/Upper-Lower Arm Joint (9.04872e-03) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support Arm Left/Revolute Joint Arm (2.39393e-03) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support Arm Right/Revolute Joint Arm (1.28775e-03) scdbackhoeTRIM/Plant/Backhoe Arm/Hydraulic Actuator Lower - Upper Arm/Prismatic Joint (1.61736e-04) scdbackhoeTRIM/Plant/Mounting Assembly/Mounting Base and Support Arms/Support Arm Left/Revolute Joint Arm (1.59106e-04) scdbackhoeTRIM/Plant/Hydraulic Actuator Mounting - Lower Arm/Prismatic Joint (1.70351e-05) scdbackhoeTRIM/Plant/Cylinder Base to Mounting Plate (2.39957e-05) scdbackhoeTRIM/Plant/Hydraulic Actuator Mounting - Lower Arm/Prismatic Joint (1.49012e-05) scdbackhoeTRIM/Plant/Hydraulic Actuator Mounting - Lower Arm/Hydraulic Actuator/Simulink-PS Converter1 (7.45058e-06) scdbackhoeTRIM/Plant/Backhoe Arm/Hydraulic Actuator Lower - Upper Arm/Hydraulic Actuator/Simulink-PS Converter1 (7.45058e-06) scdbackhoeTRIM/Plant/Backhoe Arm/Hydraulic Actuator Lower - Upper Arm/Hydraulic Actuator/Simulink-PS Converter1 Operating point specifications were successfully met.
从计算的稳态出发,对模型进行仿真。
set_param (mdl“LoadExternalInput”,“上”)set_param (mdl“ExternalInput”,“getinputstruct (op) ')set_param (mdl“LoadInitialState”,“上”)set_param (mdl“InitialState”,“getstatestruct (op) ')sim (mdl)
打开检查结果的范围。
(mdl open_system (,' /关节角轨迹”])
仿真结果表明,五种角度均被切至其期望值,但由于数值噪声和不稳定性,轨迹随时间略有偏差。你可以使用反馈控制器来稳定角度。
bdclose (mdl)