Skip to content

Commit

Permalink
remove airspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Nov 6, 2023
1 parent e6bfa87 commit 021b1c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion conf/modules/wing_rotation_controller_servo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<dl_setting MAX="90" MIN="0" STEP="1" VAR="wing_rotation_controller.wing_angle_deg_sp" shortname="wing_sp_deg"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="wing_rotation_controller.airspeed_scheduling" shortname="airspeed_sched"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="wing_rotation_controller.force_rotation_angle" shortname="force_skew"/>
<dl_setting MAX="18" MIN="14" STEP="0.1" VAR="wing_rotation_controller.forward_airspeed" shortname="forward_airspeed"/>
<dl_setting MAX="0.01" MIN="0" STEP="0.0001" VAR="wing_rotation_controller.wing_rotation_first_order_dynamics" shortname="first_dyn"/>
<dl_setting MAX="0.01" MIN="0" STEP="0.0001" VAR="wing_rotation_controller.wing_rotation_second_order_dynamics" shortname="second_dyn"/>
</dl_settings>
Expand All @@ -33,6 +32,7 @@
<configure name="ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION" default="ADC_5" case="lower|upper"/>
<define name="ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION" value="$(ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION_UPPER)"/>
<define name="USE_$(ADC_CHANNEL_WING_ROTATION_CONTROLLER_POSITION_UPPER)"/>
<define name="USE_WING_ROTATION_CONTROLLER_SERVO"/>
<file name="wing_rotation_controller_servo.c"/>
</makefile>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ void wing_rotation_init(void)
wing_rotation_controller.wing_angle_virtual_deg_sp = 45;
wing_rotation_controller.wing_rotation_first_order_dynamics = WING_ROTATION_CONTROLLER_FIRST_DYN;
wing_rotation_controller.wing_rotation_second_order_dynamics = WING_ROTATION_CONTROLLER_SECOND_DYN;
wing_rotation_controller.forward_airspeed = 18.;
}

void wing_rotation_periodic(void)
Expand All @@ -117,14 +116,6 @@ void wing_rotation_event(void)
}
#endif

if (guidance_h.mode == GUIDANCE_H_MODE_FORWARD) {
set_wing_rotation_scheduler(true);
} else if (guidance_h.mode == GUIDANCE_H_MODE_ATTITUDE) {
set_wing_rotation_scheduler(false);
} else if (guidance_h.mode == GUIDANCE_H_MODE_NAV) {
set_wing_rotation_scheduler(wing_rotation_controller.airspeed_scheduling_nav);
}

if (!wing_rotation_controller.airspeed_scheduling) {
wing_rotation_controller.transition_forward = false;
}
Expand Down Expand Up @@ -166,11 +157,15 @@ void wing_rotation_event(void)
void wing_rotation_adc_to_deg(void)
{
#if !USE_NPS
#if ROTWING_V3B
wing_rotation_controller.adc_wing_rotation = buf_wing_rot_pos.sum / buf_wing_rot_pos.av_nb_sample;

wing_rotation_controller.wing_angle_deg = 0.00247111 * (float)wing_rotation_controller.adc_wing_rotation - 25.635294;

#else
wing_rotation_controller.wing_angle_deg = 0;
#endif // ROTWING_V3B

#else // !USE_NPS
// Copy setpoint as actual angle in simulation
wing_rotation_controller.wing_angle_deg = wing_rotation_controller.wing_angle_virtual_deg_sp;
#endif
Expand Down Expand Up @@ -213,9 +208,3 @@ bool set_wing_rotation_scheduler(bool rotation_scheduler_on)
}
return false;
}

bool set_wing_rotation_scheduler_nav(bool rotation_scheduler_on)
{
wing_rotation_controller.airspeed_scheduling_nav = rotation_scheduler_on;
return false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ struct wing_rotation_controller_t {
bool initialized;
uint8_t init_loop_count;
bool airspeed_scheduling;
bool airspeed_scheduling_nav;
bool force_rotation_angle;
bool transition_forward;
float forward_airspeed;
};

extern struct wing_rotation_controller_t wing_rotation_controller;
Expand Down

0 comments on commit 021b1c6

Please sign in to comment.