From 796d64256383f66b05ac9a11d05209009c0d0004 Mon Sep 17 00:00:00 2001 From: user_gly Date: Sun, 6 Jul 2025 23:07:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9missions=20and=20controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- missions/alpha/alpha.moos | 37 ++- missions/alpha/alpha_shoreside.moos | 7 +- missions/alpha/alpha_vehicle.moos | 22 +- missions/alpha/gly_1.bhv | 74 +++++ src/pAUV150/Controler/Controler.cpp | 350 ++++++++-------------- src/pAUV150/Controler/Controler.h | 310 ++++++++----------- src/pAUV150/Controler/Controler_data.cpp | 42 +-- src/pAUV150/Controler/Controler_private.h | 4 +- src/pAUV150/Controler/Controler_types.h | 4 +- src/pAUV150/Controler/rtGetNaN.cpp | 4 +- src/pAUV150/Controler/rtGetNaN.h | 4 +- src/pAUV150/Controler/rt_nonfinite.cpp | 4 +- src/pAUV150/Controler/rt_nonfinite.h | 4 +- src/pAUV150/Controler/rtwtypes.h | 4 +- 14 files changed, 398 insertions(+), 472 deletions(-) create mode 100644 missions/alpha/gly_1.bhv diff --git a/missions/alpha/alpha.moos b/missions/alpha/alpha.moos index 3d7f09e..141db7c 100644 --- a/missions/alpha/alpha.moos +++ b/missions/alpha/alpha.moos @@ -5,7 +5,7 @@ Community = alder MOOSTimeWarp = 1 LatOrigin = 43.825300 -LongOrigin = -70.330400 +LongOrigin = -70.330400 //------------------------------------------ // Antler config block @@ -16,7 +16,7 @@ ProcessConfig = ANTLER Run = MOOSDB @ NewConsole = false //Run = uSimMarineV22 @ NewConsole = false Run = pNodeReporter @ NewConsole = false - //Run = pLogger @ NewConsole = false + //Run = pLogger @ NewConsole = false Run = pMarineViewer @ NewConsole = false Run = uProcessWatch @ NewConsole = false Run = pHelmIvP @ NewConsole = false @@ -24,6 +24,9 @@ ProcessConfig = ANTLER Run = pShare @ NewConsole = false } +//------------------------------------------ +// pShare config block + ProcessConfig = pShare { AppTick = 10 @@ -31,7 +34,7 @@ ProcessConfig = pShare //UUV 信息 //output = src_name = NODE_REPORT*, route = 192.168.137.7:8085 //App 信息 - output = src_name = APPCAST*, route = 192.168.137.7:8085 + //output = src_name = APPCAST*, route = 192.168.137.7:8085 //路径点信息 //output = src_name = VIEW*, route = 192.168.137.7:8085 @@ -81,10 +84,11 @@ ProcessConfig = pHelmIvP AppTick = 4 CommsTick = 4 - Behaviors = alpha.bhv + Behaviors = gly_1.bhv Verbose = quiet Domain = course:0:359:360 Domain = speed:0:4:21 + Domain = depth:0:100:101 //IVP_BEHAVIOR_DIR = ../../lib @@ -135,12 +139,12 @@ ProcessConfig = pMarineViewer TIFF_FILE = forrest19.tif set_pan_x = -90 set_pan_y = -280 - zoom = 0.65 + zoom = 1 vehicle_shape_scale = 1.5 hash_delta = 50 hash_shade = 0.4 hash_viewable = true - + VName = abc scope = ODOMETRY_DIST // Appcast configuration @@ -172,6 +176,9 @@ ProcessConfig = pNodeReporter //vessel_type = auv } +//------------------------------------------ +// pAUV150 config block + ProcessConfig = pAUV150 { AppTick = 10 @@ -180,15 +187,20 @@ ProcessConfig = pAUV150 //server_host = 10.127.0.18 //server_host = 127.0.0.1 //server_host = 192.168.137.1 - //server_host = 192.168.220.1 - server_host = 192.168.43.131 - LatOrigin = 43.825300 - LongOrigin = -70.330400 + server_host = 192.168.220.1 + //server_host = 192.168.43.131 + //LatOrigin = 43.825300 + //LongOrigin = -70.330400 + + LatOrigin = 43.825750 + LongOrigin = -70.329158 ControlFrequency = 10 - } +//------------------------------------------ +// pMotionControler config block + ProcessConfig = pMotionControler { AppTick = 10 @@ -196,6 +208,9 @@ ProcessConfig = pMotionControler config_file = /home/zjk/project/moos-ivp-extend/missions/alder/ControlParam.json } +//------------------------------------------ +// pLogger config block + ProcessConfig = pLogger { AppTick = 10 diff --git a/missions/alpha/alpha_shoreside.moos b/missions/alpha/alpha_shoreside.moos index b7682c2..5ce3247 100644 --- a/missions/alpha/alpha_shoreside.moos +++ b/missions/alpha/alpha_shoreside.moos @@ -22,6 +22,7 @@ ProcessConfig = ANTLER //------------------------------------------ // pShare config block + ProcessConfig = pShare { AppTick = 10 @@ -41,6 +42,7 @@ ProcessConfig = pShare //------------------------------------------ // uProcessWatch config block + ProcessConfig = uProcessWatch { AppTick = 4 @@ -67,7 +69,7 @@ ProcessConfig = pMarineViewer TIFF_FILE = forrest19.tif set_pan_x = -90 set_pan_y = -280 - zoom = 0.65 + zoom = 1 vehicle_shape_scale = 1.5 hash_delta = 50 hash_shade = 0.4 @@ -89,7 +91,8 @@ ProcessConfig = pMarineViewer BUTTON_TWO = RETURN # RETURN=true } - +//------------------------------------------ +// pLogger config block ProcessConfig = pLogger { diff --git a/missions/alpha/alpha_vehicle.moos b/missions/alpha/alpha_vehicle.moos index 52c61ed..2cbe55f 100644 --- a/missions/alpha/alpha_vehicle.moos +++ b/missions/alpha/alpha_vehicle.moos @@ -22,6 +22,9 @@ ProcessConfig = ANTLER Run = pShare @ NewConsole = false } +//------------------------------------------ +// pShare config block + ProcessConfig = pShare { AppTick = 10 @@ -64,10 +67,11 @@ ProcessConfig = pHelmIvP AppTick = 4 CommsTick = 4 - Behaviors = alpha.bhv + Behaviors = gly_1.bhv Verbose = quiet Domain = course:0:359:360 Domain = speed:0:4:21 + Domain = depth:0:100:101 //IVP_BEHAVIOR_DIR = ../../lib @@ -83,13 +87,16 @@ ProcessConfig = pNodeReporter AppTick = 2 CommsTick = 2 - platform_length = 1.5 // meters + platform_length = 2 // meters //platform_beam = 0.2 // meters platform_type = auv platform_color = dodger_blue //vessel_type = auv } +//------------------------------------------ +// pAUV150 config block + ProcessConfig = pAUV150 { AppTick = 10 @@ -98,13 +105,18 @@ ProcessConfig = pAUV150 //server_host = 10.127.0.18 //server_host = 127.0.0.1 server_host = 192.168.137.1 - LatOrigin = 43.825300 - LongOrigin = -70.330400 + //LatOrigin = 43.825300 + //LongOrigin = -70.330400 + + LatOrigin = 43.825750 + LongOrigin = -70.329158 ControlFrequency = 10 - } +//------------------------------------------ +// pLogger config block + ProcessConfig = pLogger { AppTick = 10 diff --git a/missions/alpha/gly_1.bhv b/missions/alpha/gly_1.bhv new file mode 100644 index 0000000..1c1865f --- /dev/null +++ b/missions/alpha/gly_1.bhv @@ -0,0 +1,74 @@ +//-------- FILE: gly_1.bhv ------------- + +initialize DEPLOY = false +initialize RETURN = false + +//---------------------------------------------- +Behavior = BHV_Waypoint +{ + name = waypt_survey + pwt = 100 + condition = RETURN = false + condition = DEPLOY = true + //endflag = RETURN = true + endflag = MISSION = complete + + configflag = CRUISE_SPD = $[SPEED] + //configflag = OSPOS = $[OSX],$[OSY] + + activeflag = INFO=$[OWNSHIP] + activeflag = INFO=$[BHVNAME] + activeflag = INFO=$[BHVTYPE] + + cycleflag = CINFO=$[OSX],$[OSY] + + wptflag = PREV=$(PX),$(PY) + wptflag = NEXT=$(NX),$(NY) + wptflag = TEST=$(X),$(Y) + wptflag = OSPOS=$(OSX),$(OSY) + wptflag_on_start = true + + updates = WPT_UPDATE + // perpetual = true + + speed_alt = 1.2 + use_alt_speed = true + lead = 8 + lead_damper = 1 + lead_to_start = true + speed = 2 // meters per second + capture_line = true + capture_radius = 5.0 + slip_radius = 15.0 + efficiency_measure = all + + // points = pts={107.5,-53.5:112,-43.8:112,-46.1:111.7,-49.3:108.3,-52.7:107.7,-53.3} + // polygon = -50,-100: -50,-300: 25, -300: 25, -100: 100, -100: 100, -300: 175, -300: 175, -100 + polygon = -50,-100: 0,-300: 50, -287.5: 0, -87.5: 50, -75: 100, -275: 150, -262.5: 100, -62.5 + // polygon = -50,-100: -50,-170.71: 0,-220.71: 70.71,-220.71: 120.71,-170.71: 120.71,-100: 70.71,-50: 0,-50: -50,-100 + // polygon = -50,-100: -50,-300 + order = normal + repeat = 0 + + visual_hints = nextpt_color=yellow + visual_hints = nextpt_vertex_size=8 + visual_hints = nextpt_lcolor=gray70 + visual_hints = vertex_color=dodger_blue, edge_color=white + visual_hints = vertex_size=5, edge_size=1 +} + +//---------------------------------------------- +Behavior = BHV_ConstantDepth +{ + name = bhv_const_depth + pwt = 100 + condition = DEPLOY = true + perpetual = true + updates = DEPTH_VALUE + + depth = 2 + duration = no-time-limit + peakwidth = 8 + basewidth = 12 + summitdelta = 10 +} \ No newline at end of file diff --git a/src/pAUV150/Controler/Controler.cpp b/src/pAUV150/Controler/Controler.cpp index 6f8de9d..e289d1e 100644 --- a/src/pAUV150/Controler/Controler.cpp +++ b/src/pAUV150/Controler/Controler.cpp @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) @@ -27,18 +27,16 @@ void Controler::step() { real_T mod_error; + real_T rtb_DeadZone; real_T rtb_FilterCoefficient; real_T rtb_FilterCoefficient_a; - real_T rtb_FilterCoefficient_lc; - real_T rtb_Filter_b; real_T rtb_IntegralGain; real_T rtb_Integrator_l; - real_T rtb_Integrator_p; real_T rtb_Sum; real_T rtb_Switch; real_T rtb_depth_error; - int8_T rtb_Switch1; int8_T tmp; + int8_T tmp_0; boolean_T rtb_RelationalOperator; boolean_T rtb_fixforDTpropagationissue; @@ -69,48 +67,48 @@ void Controler::step() // End of MATLAB Function: '/MATLAB Function1' - // Gain: '/Filter Coefficient' incorporates: - // DiscreteIntegrator: '/Filter' - // Gain: '/Derivative Gain' - // Sum: '/SumD' + // Gain: '/Filter Coefficient' incorporates: + // DiscreteIntegrator: '/Filter' + // Gain: '/Derivative Gain' + // Sum: '/SumD' rtb_FilterCoefficient = (rtP.pid_heading.D * mod_error - rtDW.Filter_DSTATE) * rtP.pid_heading.N; - // Sum: '/Sum' incorporates: - // DiscreteIntegrator: '/Integrator' - // Gain: '/Proportional Gain' + // Sum: '/Sum' incorporates: + // DiscreteIntegrator: '/Integrator' + // Gain: '/Proportional Gain' rtb_Integrator_l = (rtP.pid_heading.P * mod_error + rtDW.Integrator_DSTATE) + rtb_FilterCoefficient; - // DeadZone: '/DeadZone' + // DeadZone: '/DeadZone' if (rtb_Integrator_l > 35.0) { - rtb_Sum = rtb_Integrator_l - 35.0; + rtb_IntegralGain = rtb_Integrator_l - 35.0; } else if (rtb_Integrator_l >= -35.0) { - rtb_Sum = 0.0; + rtb_IntegralGain = 0.0; } else { - rtb_Sum = rtb_Integrator_l - -35.0; + rtb_IntegralGain = rtb_Integrator_l - -35.0; } - // End of DeadZone: '/DeadZone' + // End of DeadZone: '/DeadZone' - // RelationalOperator: '/Relational Operator' incorporates: - // Constant: '/Clamping_zero' + // RelationalOperator: '/Relational Operator' incorporates: + // Constant: '/Clamping_zero' - rtb_RelationalOperator = (rtb_Sum != 0.0); + rtb_RelationalOperator = (rtb_IntegralGain != 0.0); - // RelationalOperator: '/fix for DT propagation issue' incorporates: - // Constant: '/Clamping_zero' + // RelationalOperator: '/fix for DT propagation issue' incorporates: + // Constant: '/Clamping_zero' - rtb_fixforDTpropagationissue = (rtb_Sum > 0.0); + rtb_fixforDTpropagationissue = (rtb_IntegralGain > 0.0); - // Gain: '/Integral Gain' - rtb_Sum = rtP.pid_heading.I * mod_error; + // Gain: '/Integral Gain' + rtb_IntegralGain = rtP.pid_heading.I * mod_error; - // Switch: '/Switch1' incorporates: - // Constant: '/Constant' - // Constant: '/Constant2' + // Switch: '/Switch1' incorporates: + // Constant: '/Constant' + // Constant: '/Constant2' if (rtb_fixforDTpropagationissue) { tmp = 1; @@ -118,189 +116,87 @@ void Controler::step() tmp = -1; } - // Switch: '/Switch2' incorporates: - // Constant: '/Clamping_zero' - // Constant: '/Constant3' - // Constant: '/Constant4' - // RelationalOperator: '/fix for DT propagation issue1' + // Switch: '/Switch2' incorporates: + // Constant: '/Clamping_zero' + // Constant: '/Constant3' + // Constant: '/Constant4' + // RelationalOperator: '/fix for DT propagation issue1' - if (rtb_Sum > 0.0) { - rtb_Switch1 = 1; + if (rtb_IntegralGain > 0.0) { + tmp_0 = 1; } else { - rtb_Switch1 = -1; + tmp_0 = -1; } - // Switch: '/Switch' incorporates: - // Constant: '/Constant1' - // Logic: '/AND3' - // RelationalOperator: '/Equal1' - // Switch: '/Switch1' - // Switch: '/Switch2' + // Switch: '/Switch' incorporates: + // Constant: '/Constant1' + // Logic: '/AND3' + // RelationalOperator: '/Equal1' + // Switch: '/Switch1' + // Switch: '/Switch2' - if (rtb_RelationalOperator && (tmp == rtb_Switch1)) { + if (rtb_RelationalOperator && (tmp == tmp_0)) { rtb_Switch = 0.0; } else { - rtb_Switch = rtb_Sum; + rtb_Switch = rtb_IntegralGain; } - // End of Switch: '/Switch' + // End of Switch: '/Switch' - // Saturate: '/Saturation' + // Saturate: '/Saturation' if (rtb_Integrator_l > 35.0) { rtb_Integrator_l = 35.0; } else if (rtb_Integrator_l < -35.0) { rtb_Integrator_l = -35.0; } - // End of Saturate: '/Saturation' + // End of Saturate: '/Saturation' // Sum: '/Sum1' incorporates: // Inport: '/depth_cmd' // Inport: '/z' - rtb_depth_error = rtU.z - rtU.depth_cmd; + rtb_depth_error = rtU.depth_cmd - rtU.z; - // Gain: '/Integral Gain' - rtb_Sum = rtP.pid_depth.I * rtb_depth_error; + // Gain: '/Integral Gain' + rtb_IntegralGain = rtP.pid_depth.I * rtb_depth_error; - // Gain: '/Filter Coefficient' incorporates: - // DiscreteIntegrator: '/Filter' - // Gain: '/Derivative Gain' - // Sum: '/SumD' + // Gain: '/Filter Coefficient' incorporates: + // DiscreteIntegrator: '/Filter' + // Gain: '/Derivative Gain' + // Sum: '/SumD' - rtb_FilterCoefficient_lc = (rtP.pid_depth.D * rtb_depth_error - + rtb_FilterCoefficient_a = (rtP.pid_depth.D * rtb_depth_error - rtDW.Filter_DSTATE_m) * rtP.pid_depth.N; - // Sum: '/Sum' incorporates: - // DiscreteIntegrator: '/Integrator' - // Gain: '/Proportional Gain' + // Sum: '/Sum' incorporates: + // DiscreteIntegrator: '/Integrator' + // Gain: '/Proportional Gain' - rtb_Filter_b = (rtP.pid_depth.P * rtb_depth_error + rtDW.Integrator_DSTATE_o) - + rtb_FilterCoefficient_lc; - - // DeadZone: '/DeadZone' - if (rtb_Filter_b > 30.0) { - rtb_Integrator_p = rtb_Filter_b - 30.0; - - // Switch: '/Switch1' incorporates: - // Constant: '/Constant' - - tmp = 1; - } else { - if (rtb_Filter_b >= -30.0) { - rtb_Integrator_p = 0.0; - } else { - rtb_Integrator_p = rtb_Filter_b - -30.0; - } - - // Switch: '/Switch1' incorporates: - // Constant: '/Constant2' - - tmp = -1; - } - - // End of DeadZone: '/DeadZone' - - // Switch: '/Switch2' incorporates: - // Constant: '/Clamping_zero' - // Constant: '/Constant3' - // Constant: '/Constant4' - // RelationalOperator: '/fix for DT propagation issue1' - - if (rtb_Sum > 0.0) { - rtb_Switch1 = 1; - } else { - rtb_Switch1 = -1; - } - - // Switch: '/Switch' incorporates: - // Constant: '/Clamping_zero' - // Constant: '/Constant1' - // Logic: '/AND3' - // RelationalOperator: '/Equal1' - // RelationalOperator: '/Relational Operator' - // Switch: '/Switch1' - // Switch: '/Switch2' - - if ((rtb_Integrator_p != 0.0) && (tmp == rtb_Switch1)) { - rtb_Integrator_p = 0.0; - } else { - rtb_Integrator_p = rtb_Sum; - } - - // End of Switch: '/Switch' - - // Saturate: '/Saturation' - if (rtb_Filter_b > 30.0) { - rtb_Filter_b = 30.0; - } else if (rtb_Filter_b < -30.0) { - rtb_Filter_b = -30.0; - } - - // Sum: '/Sum2' incorporates: - // Inport: '/theta' - // Saturate: '/Saturation' - - rtb_Filter_b = rtU.theta - rtb_Filter_b; - - // Gain: '/Filter Coefficient' incorporates: - // DiscreteIntegrator: '/Filter' - // Gain: '/Derivative Gain' - // Sum: '/SumD' - - rtb_FilterCoefficient_a = (rtP.pid_pitch.D * rtb_Filter_b - - rtDW.Filter_DSTATE_l) * rtP.pid_pitch.N; - - // Sum: '/Sum' incorporates: - // DiscreteIntegrator: '/Integrator' - // Gain: '/Proportional Gain' - - rtb_Sum = (rtP.pid_pitch.P * rtb_Filter_b + rtDW.Integrator_DSTATE_f) + + rtb_Sum = (rtP.pid_depth.P * rtb_depth_error + rtDW.Integrator_DSTATE_o) + rtb_FilterCoefficient_a; - // DeadZone: '/DeadZone' - if (rtb_Sum > 35.0) { - rtb_IntegralGain = rtb_Sum - 35.0; - } else if (rtb_Sum >= -35.0) { - rtb_IntegralGain = 0.0; + // DeadZone: '/DeadZone' incorporates: + // Saturate: '/Saturation' + + if (rtb_Sum > 30.0) { + rtb_DeadZone = rtb_Sum - 30.0; + rtb_Sum = 30.0; } else { - rtb_IntegralGain = rtb_Sum - -35.0; + if (rtb_Sum >= -30.0) { + rtb_DeadZone = 0.0; + } else { + rtb_DeadZone = rtb_Sum - -30.0; + } + + if (rtb_Sum < -30.0) { + rtb_Sum = -30.0; + } } - // End of DeadZone: '/DeadZone' + // End of DeadZone: '/DeadZone' - // RelationalOperator: '/Relational Operator' incorporates: - // Constant: '/Clamping_zero' - - rtb_RelationalOperator = (rtb_IntegralGain != 0.0); - - // Switch: '/Switch1' incorporates: - // Constant: '/Clamping_zero' - // Constant: '/Constant' - // Constant: '/Constant2' - // RelationalOperator: '/fix for DT propagation issue' - - if (rtb_IntegralGain > 0.0) { - rtb_Switch1 = 1; - } else { - rtb_Switch1 = -1; - } - - // End of Switch: '/Switch1' - - // Gain: '/Integral Gain' - rtb_IntegralGain = rtP.pid_pitch.I * rtb_Filter_b; - - // Saturate: '/Saturation' - if (rtb_Sum > 35.0) { - rtb_Sum = 35.0; - } else if (rtb_Sum < -35.0) { - rtb_Sum = -35.0; - } - - // End of Saturate: '/Saturation' - - // Update for DiscreteIntegrator: '/Integrator' + // Update for DiscreteIntegrator: '/Integrator' rtDW.Integrator_DSTATE += rtb_Switch; if (rtDW.Integrator_DSTATE > 15.0) { rtDW.Integrator_DSTATE = 15.0; @@ -308,60 +204,62 @@ void Controler::step() rtDW.Integrator_DSTATE = -15.0; } - // End of Update for DiscreteIntegrator: '/Integrator' + // End of Update for DiscreteIntegrator: '/Integrator' - // Update for DiscreteIntegrator: '/Filter' + // Update for DiscreteIntegrator: '/Filter' rtDW.Filter_DSTATE += 0.1 * rtb_FilterCoefficient; - // Update for DiscreteIntegrator: '/Integrator' - rtDW.Integrator_DSTATE_o += rtb_Integrator_p; + // Switch: '/Switch1' incorporates: + // Constant: '/Clamping_zero' + // Constant: '/Constant' + // Constant: '/Constant2' + // RelationalOperator: '/fix for DT propagation issue' + + if (rtb_DeadZone > 0.0) { + tmp = 1; + } else { + tmp = -1; + } + + // Switch: '/Switch2' incorporates: + // Constant: '/Clamping_zero' + // Constant: '/Constant3' + // Constant: '/Constant4' + // RelationalOperator: '/fix for DT propagation issue1' + + if (rtb_IntegralGain > 0.0) { + tmp_0 = 1; + } else { + tmp_0 = -1; + } + + // Switch: '/Switch' incorporates: + // Constant: '/Clamping_zero' + // Constant: '/Constant1' + // Logic: '/AND3' + // RelationalOperator: '/Equal1' + // RelationalOperator: '/Relational Operator' + // Switch: '/Switch1' + // Switch: '/Switch2' + + if ((rtb_DeadZone != 0.0) && (tmp == tmp_0)) { + rtb_IntegralGain = 0.0; + } + + // Update for DiscreteIntegrator: '/Integrator' incorporates: + // Switch: '/Switch' + + rtDW.Integrator_DSTATE_o += rtb_IntegralGain; if (rtDW.Integrator_DSTATE_o > 10.0) { rtDW.Integrator_DSTATE_o = 10.0; } else if (rtDW.Integrator_DSTATE_o < -10.0) { rtDW.Integrator_DSTATE_o = -10.0; } - // End of Update for DiscreteIntegrator: '/Integrator' + // End of Update for DiscreteIntegrator: '/Integrator' - // Update for DiscreteIntegrator: '/Filter' - rtDW.Filter_DSTATE_m += 0.1 * rtb_FilterCoefficient_lc; - - // Switch: '/Switch2' incorporates: - // Constant: '/Clamping_zero' - // Constant: '/Constant3' - // Constant: '/Constant4' - // RelationalOperator: '/fix for DT propagation issue1' - - if (rtb_IntegralGain > 0.0) { - tmp = 1; - } else { - tmp = -1; - } - - // Switch: '/Switch' incorporates: - // Constant: '/Constant1' - // Logic: '/AND3' - // RelationalOperator: '/Equal1' - // Switch: '/Switch2' - - if (rtb_RelationalOperator && (rtb_Switch1 == tmp)) { - rtb_IntegralGain = 0.0; - } - - // Update for DiscreteIntegrator: '/Integrator' incorporates: - // Switch: '/Switch' - - rtDW.Integrator_DSTATE_f += rtb_IntegralGain; - if (rtDW.Integrator_DSTATE_f > 15.0) { - rtDW.Integrator_DSTATE_f = 15.0; - } else if (rtDW.Integrator_DSTATE_f < -15.0) { - rtDW.Integrator_DSTATE_f = -15.0; - } - - // End of Update for DiscreteIntegrator: '/Integrator' - - // Update for DiscreteIntegrator: '/Filter' - rtDW.Filter_DSTATE_l += 0.1 * rtb_FilterCoefficient_a; + // Update for DiscreteIntegrator: '/Filter' + rtDW.Filter_DSTATE_m += 0.1 * rtb_FilterCoefficient_a; // End of Outputs for SubSystem: '/Controler' @@ -385,8 +283,10 @@ void Controler::step() // Outport: '/heading_error' rtY.heading_error = mod_error; - // Outport: '/pitch_error' - rtY.pitch_error = rtb_Filter_b; + // Outport: '/pitch_error' incorporates: + // Constant: '/Constant' + + rtY.pitch_error = 0.0; // Outport: '/depth_error' rtY.depth_error = rtb_depth_error; diff --git a/src/pAUV150/Controler/Controler.h b/src/pAUV150/Controler/Controler.h index becc9c8..1f8dc36 100644 --- a/src/pAUV150/Controler/Controler.h +++ b/src/pAUV150/Controler/Controler.h @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) @@ -39,12 +39,10 @@ class Controler final public: // Block signals and states (default storage) for system '' struct DW { - real_T Integrator_DSTATE; // '/Integrator' - real_T Filter_DSTATE; // '/Filter' - real_T Integrator_DSTATE_o; // '/Integrator' - real_T Filter_DSTATE_m; // '/Filter' - real_T Integrator_DSTATE_f; // '/Integrator' - real_T Filter_DSTATE_l; // '/Filter' + real_T Integrator_DSTATE; // '/Integrator' + real_T Filter_DSTATE; // '/Filter' + real_T Integrator_DSTATE_o; // '/Integrator' + real_T Filter_DSTATE_m; // '/Filter' }; // External inputs (root inport signals with default storage) @@ -86,24 +84,17 @@ class Controler final struct P { struct_n3jlyiLoC0PV1TieyhpPwD pid_depth;// Variable: pid_depth // Referenced by: - // '/Derivative Gain' - // '/Integral Gain' - // '/Filter Coefficient' - // '/Proportional Gain' + // '/Derivative Gain' + // '/Integral Gain' + // '/Filter Coefficient' + // '/Proportional Gain' struct_n3jlyiLoC0PV1TieyhpPwD pid_heading;// Variable: pid_heading // Referenced by: - // '/Derivative Gain' - // '/Integral Gain' - // '/Filter Coefficient' - // '/Proportional Gain' - - struct_n3jlyiLoC0PV1TieyhpPwD pid_pitch;// Variable: pid_pitch - // Referenced by: - // '/Derivative Gain' - // '/Integral Gain' - // '/Filter Coefficient' - // '/Proportional Gain' + // '/Derivative Gain' + // '/Integral Gain' + // '/Filter Coefficient' + // '/Proportional Gain' }; @@ -187,170 +178,115 @@ class Controler final // '' : 'SimModel0621_S3/Controler' // '' : 'SimModel0621_S3/Controler/MATLAB Function1' // '' : 'SimModel0621_S3/Controler/PID Controller1' -// '' : 'SimModel0621_S3/Controler/PID Controller2' -// '' : 'SimModel0621_S3/Controler/PID Controller3' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup' -// '' : 'SimModel0621_S3/Controler/PID Controller1/D Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller1/External Derivative' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter ICs' -// '' : 'SimModel0621_S3/Controler/PID Controller1/I Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator ICs' -// '' : 'SimModel0621_S3/Controler/PID Controller1/N Copy' -// '' : 'SimModel0621_S3/Controler/PID Controller1/N Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller1/P Copy' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Parallel P Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Reset Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode Sum' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Integral' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Ngain' -// '' : 'SimModel0621_S3/Controler/PID Controller1/postSat Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller1/preInt Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller1/preSat Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel/Dead Zone' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/D Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller1/External Derivative/Error' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter/Disc. Forward Euler Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter ICs/Internal IC - Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller1/I Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator/Discrete' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator ICs/Internal IC' -// '' : 'SimModel0621_S3/Controler/PID Controller1/N Copy/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/N Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller1/P Copy/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Parallel P Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Reset Signal/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation/Enabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum/Sum_PID' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode Sum/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Integral/TsSignalSpecification' -// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Ngain/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller1/postSat Signal/Forward_Path' -// '' : 'SimModel0621_S3/Controler/PID Controller1/preInt Signal/Internal PreInt' -// '' : 'SimModel0621_S3/Controler/PID Controller1/preSat Signal/Forward_Path' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Anti-windup' -// '' : 'SimModel0621_S3/Controler/PID Controller2/D Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller2/External Derivative' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Filter ICs' -// '' : 'SimModel0621_S3/Controler/PID Controller2/I Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Ideal P Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Ideal P Gain Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Integrator' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Integrator ICs' -// '' : 'SimModel0621_S3/Controler/PID Controller2/N Copy' -// '' : 'SimModel0621_S3/Controler/PID Controller2/N Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller2/P Copy' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Parallel P Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Reset Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Saturation' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Saturation Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Sum' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Sum Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tracking Mode' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tracking Mode Sum' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tsamp - Integral' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tsamp - Ngain' -// '' : 'SimModel0621_S3/Controler/PID Controller2/postSat Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller2/preInt Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller2/preSat Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Anti-windup/Disc. Clamping Parallel' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Anti-windup/Disc. Clamping Parallel/Dead Zone' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/D Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller2/External Derivative/Error' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Filter/Disc. Forward Euler Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Filter ICs/Internal IC - Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller2/I Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Ideal P Gain/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Ideal P Gain Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Integrator/Discrete' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Integrator ICs/Internal IC' -// '' : 'SimModel0621_S3/Controler/PID Controller2/N Copy/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/N Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller2/P Copy/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Parallel P Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Reset Signal/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Saturation/Enabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Saturation Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Sum/Sum_PID' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Sum Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tracking Mode/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tracking Mode Sum/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tsamp - Integral/TsSignalSpecification' -// '' : 'SimModel0621_S3/Controler/PID Controller2/Tsamp - Ngain/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller2/postSat Signal/Forward_Path' -// '' : 'SimModel0621_S3/Controler/PID Controller2/preInt Signal/Internal PreInt' -// '' : 'SimModel0621_S3/Controler/PID Controller2/preSat Signal/Forward_Path' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup' -// '' : 'SimModel0621_S3/Controler/PID Controller3/D Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller3/External Derivative' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter ICs' -// '' : 'SimModel0621_S3/Controler/PID Controller3/I Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator ICs' -// '' : 'SimModel0621_S3/Controler/PID Controller3/N Copy' -// '' : 'SimModel0621_S3/Controler/PID Controller3/N Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller3/P Copy' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Parallel P Gain' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Reset Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum Fdbk' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode Sum' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Integral' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Ngain' -// '' : 'SimModel0621_S3/Controler/PID Controller3/postSat Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller3/preInt Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller3/preSat Signal' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel/Dead Zone' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/D Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller3/External Derivative/Error' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter/Disc. Forward Euler Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter ICs/Internal IC - Filter' -// '' : 'SimModel0621_S3/Controler/PID Controller3/I Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator/Discrete' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator ICs/Internal IC' -// '' : 'SimModel0621_S3/Controler/PID Controller3/N Copy/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/N Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller3/P Copy/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Parallel P Gain/Internal Parameters' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Reset Signal/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation/Enabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum/Sum_PID' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum Fdbk/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode/Disabled' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode Sum/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Integral/TsSignalSpecification' -// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Ngain/Passthrough' -// '' : 'SimModel0621_S3/Controler/PID Controller3/postSat Signal/Forward_Path' -// '' : 'SimModel0621_S3/Controler/PID Controller3/preInt Signal/Internal PreInt' -// '' : 'SimModel0621_S3/Controler/PID Controller3/preSat Signal/Forward_Path' +// '' : 'SimModel0621_S3/Controler/PID Controller3' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup' +// '' : 'SimModel0621_S3/Controler/PID Controller1/D Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller1/External Derivative' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter ICs' +// '' : 'SimModel0621_S3/Controler/PID Controller1/I Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain Fdbk' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator ICs' +// '' : 'SimModel0621_S3/Controler/PID Controller1/N Copy' +// '' : 'SimModel0621_S3/Controler/PID Controller1/N Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller1/P Copy' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Parallel P Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Reset Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation Fdbk' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum Fdbk' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode Sum' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Integral' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Ngain' +// '' : 'SimModel0621_S3/Controler/PID Controller1/postSat Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller1/preInt Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller1/preSat Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel/Dead Zone' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/D Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller1/External Derivative/Error' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter/Disc. Forward Euler Filter' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Filter ICs/Internal IC - Filter' +// '' : 'SimModel0621_S3/Controler/PID Controller1/I Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain/Passthrough' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Ideal P Gain Fdbk/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator/Discrete' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Integrator ICs/Internal IC' +// '' : 'SimModel0621_S3/Controler/PID Controller1/N Copy/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/N Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller1/P Copy/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Parallel P Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Reset Signal/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation/Enabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Saturation Fdbk/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum/Sum_PID' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Sum Fdbk/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tracking Mode Sum/Passthrough' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Integral/TsSignalSpecification' +// '' : 'SimModel0621_S3/Controler/PID Controller1/Tsamp - Ngain/Passthrough' +// '' : 'SimModel0621_S3/Controler/PID Controller1/postSat Signal/Forward_Path' +// '' : 'SimModel0621_S3/Controler/PID Controller1/preInt Signal/Internal PreInt' +// '' : 'SimModel0621_S3/Controler/PID Controller1/preSat Signal/Forward_Path' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup' +// '' : 'SimModel0621_S3/Controler/PID Controller3/D Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller3/External Derivative' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter ICs' +// '' : 'SimModel0621_S3/Controler/PID Controller3/I Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain Fdbk' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator ICs' +// '' : 'SimModel0621_S3/Controler/PID Controller3/N Copy' +// '' : 'SimModel0621_S3/Controler/PID Controller3/N Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller3/P Copy' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Parallel P Gain' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Reset Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation Fdbk' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum Fdbk' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode Sum' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Integral' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Ngain' +// '' : 'SimModel0621_S3/Controler/PID Controller3/postSat Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller3/preInt Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller3/preSat Signal' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel/Dead Zone' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/D Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller3/External Derivative/Error' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter/Disc. Forward Euler Filter' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Filter ICs/Internal IC - Filter' +// '' : 'SimModel0621_S3/Controler/PID Controller3/I Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain/Passthrough' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Ideal P Gain Fdbk/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator/Discrete' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Integrator ICs/Internal IC' +// '' : 'SimModel0621_S3/Controler/PID Controller3/N Copy/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/N Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller3/P Copy/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Parallel P Gain/Internal Parameters' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Reset Signal/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation/Enabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Saturation Fdbk/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum/Sum_PID' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Sum Fdbk/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode/Disabled' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tracking Mode Sum/Passthrough' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Integral/TsSignalSpecification' +// '' : 'SimModel0621_S3/Controler/PID Controller3/Tsamp - Ngain/Passthrough' +// '' : 'SimModel0621_S3/Controler/PID Controller3/postSat Signal/Forward_Path' +// '' : 'SimModel0621_S3/Controler/PID Controller3/preInt Signal/Internal PreInt' +// '' : 'SimModel0621_S3/Controler/PID Controller3/preSat Signal/Forward_Path' #endif // Controler_h_ diff --git a/src/pAUV150/Controler/Controler_data.cpp b/src/pAUV150/Controler/Controler_data.cpp index c795973..d813643 100644 --- a/src/pAUV150/Controler/Controler_data.cpp +++ b/src/pAUV150/Controler/Controler_data.cpp @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) @@ -24,41 +24,27 @@ Controler::P Controler::rtP{ // Variable: pid_depth // Referenced by: - // '/Derivative Gain' - // '/Integral Gain' - // '/Filter Coefficient' - // '/Proportional Gain' - - { - 10.0, - 0.1, - 0.1, - 10.0 - }, - - // Variable: pid_heading - // Referenced by: - // '/Derivative Gain' - // '/Integral Gain' - // '/Filter Coefficient' - // '/Proportional Gain' + // '/Derivative Gain' + // '/Integral Gain' + // '/Filter Coefficient' + // '/Proportional Gain' { 1, 0.01, - 0.1, - 10.0 + 3, + 5.0 }, - // Variable: pid_pitch + // Variable: pid_heading // Referenced by: - // '/Derivative Gain' - // '/Integral Gain' - // '/Filter Coefficient' - // '/Proportional Gain' + // '/Derivative Gain' + // '/Integral Gain' + // '/Filter Coefficient' + // '/Proportional Gain' { - 10.0, + 0.5, 0.01, 0.1, 10.0 diff --git a/src/pAUV150/Controler/Controler_private.h b/src/pAUV150/Controler/Controler_private.h index 9e37c98..2191a71 100644 --- a/src/pAUV150/Controler/Controler_private.h +++ b/src/pAUV150/Controler/Controler_private.h @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) diff --git a/src/pAUV150/Controler/Controler_types.h b/src/pAUV150/Controler/Controler_types.h index cde007a..f4cf45d 100644 --- a/src/pAUV150/Controler/Controler_types.h +++ b/src/pAUV150/Controler/Controler_types.h @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) diff --git a/src/pAUV150/Controler/rtGetNaN.cpp b/src/pAUV150/Controler/rtGetNaN.cpp index 03691d9..4e38dda 100644 --- a/src/pAUV150/Controler/rtGetNaN.cpp +++ b/src/pAUV150/Controler/rtGetNaN.cpp @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) diff --git a/src/pAUV150/Controler/rtGetNaN.h b/src/pAUV150/Controler/rtGetNaN.h index a6b8249..f32d095 100644 --- a/src/pAUV150/Controler/rtGetNaN.h +++ b/src/pAUV150/Controler/rtGetNaN.h @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) diff --git a/src/pAUV150/Controler/rt_nonfinite.cpp b/src/pAUV150/Controler/rt_nonfinite.cpp index 91c0cbb..30ec920 100644 --- a/src/pAUV150/Controler/rt_nonfinite.cpp +++ b/src/pAUV150/Controler/rt_nonfinite.cpp @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) diff --git a/src/pAUV150/Controler/rt_nonfinite.h b/src/pAUV150/Controler/rt_nonfinite.h index 765697d..066834b 100644 --- a/src/pAUV150/Controler/rt_nonfinite.h +++ b/src/pAUV150/Controler/rt_nonfinite.h @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64) diff --git a/src/pAUV150/Controler/rtwtypes.h b/src/pAUV150/Controler/rtwtypes.h index cd90efa..3382459 100644 --- a/src/pAUV150/Controler/rtwtypes.h +++ b/src/pAUV150/Controler/rtwtypes.h @@ -7,9 +7,9 @@ // // Code generated for Simulink model 'Controler'. // -// Model version : 5.95 +// Model version : 5.105 // Simulink Coder version : 24.2 (R2024b) 21-Jun-2024 -// C/C++ source code generated on : Tue Jul 1 15:26:11 2025 +// C/C++ source code generated on : Thu Jul 3 16:12:45 2025 // // Target selection: ert.tlc // Embedded hardware selection: Intel->x86-64 (Linux 64)