Skip to content

Commit

Permalink
Small grammar changes and corrected green arrow cn
Browse files Browse the repository at this point in the history
The size of the green 3D arrow now should match the passive cn instead of the total cn.
  • Loading branch information
GuidodiPasquo committed Apr 10, 2021
1 parent 9eaa398 commit a043c70
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Binary file modified Model Rocket PID Tuner - Technical Documentation - V1.1.pdf
Binary file not shown.
11 changes: 7 additions & 4 deletions rocket_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ def __init__(self):
self.fin_cn = [0,0]
self.cn_alpha_ctrl_fin_3d_arrow = 0
self.cp_w_o_ctrl_fin = 0
self.passive_cn = 0

def update_rocket(self, l0, xcg):
"""
Expand Down Expand Up @@ -656,16 +657,16 @@ def _calculate_aoa(self, v_tan):
def _calculate_total_cn(self):
self.cn = 0
self.__sign_correction()
self._compute_dynamic_pressure_scale()
self._barrowman_cn()
self._body_cn()
if self.use_fins is True:
self._fin_cn()
self._compute_dynamic_pressure_scale()
for i in range(len(self.component_cn)):
self.cn += self.component_cn[i] * self.v_sq_over_v_tot_sq_body[i]
self.cn += self.component_cn[i]
if self.use_fins is True:
for i in range(2):
self.cn += self.fin_cn[i] * self.v_sq_over_v_tot_sq_fin[i]
self.cn += self.fin_cn[i]
return self.cn

def __sign_correction(self):
Expand All @@ -688,7 +689,7 @@ def _barrowman_cn(self):
aoa = abs(self.component_aoa[i])
cn = np.sin(aoa) * self._barrowman_const[i]
cn *= self._sign_correction[i]
self.component_cn[i] = cn
self.component_cn[i] = cn * self.v_sq_over_v_tot_sq_body[i]

def _body_cn(self):
cn = [0]*len(self.component_plan_area)
Expand Down Expand Up @@ -748,6 +749,7 @@ def _compute_fin_cn(self):
for i in range(2):
self.fin_cn[i] = self.cn_alpha_fin[i] * abs(self.fin_aoa[i])
self.fin_cn[i] *= self._sign_correction_fin[i]
self.fin_cn[i] *= self.v_sq_over_v_tot_sq_fin[i]

def _correct_ctrl_fin_coeff_for_actuator_angle(self):
ctrl_fin_cn = self.fin_cn[1]# Still normal to the fin
Expand Down Expand Up @@ -782,6 +784,7 @@ def _calculate_cp_position(self):
b += self.fin_cn[0]
if b != 0:
self.cp_w_o_ctrl_fin = a / b # For the 3D Cn Arrow
self.passive_cn = b
else:
self.cp_w_o_ctrl_fin = self.component_centroid[0]
if self.use_fins is True:
Expand Down
2 changes: 1 addition & 1 deletion zpc_pid_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def simulation():
position_3d.append(position_global)
xa_3d.append(rocket.cp_w_o_ctrl_fin)
thrust_3d.append(thrust)
cn_3d.append(cn*S*q)
cn_3d.append(rocket.passive_cn*S*q)
fin_force_3d.append(fin_force)
aoa_3d.append(aoa)
setpoint_3d.append(setpoint)
Expand Down

0 comments on commit a043c70

Please sign in to comment.