Skip to content
Snippets Groups Projects
Commit 67d7c4c3 authored by Marco Luigi Gaibotti's avatar Marco Luigi Gaibotti
Browse files

[bugfix][ballistic] Fixed control

parent 4a175f33
Branches
Tags
1 merge request!4Bugfixes
......@@ -267,22 +267,22 @@ else
dAngle = 0;
if isControlActive && ~isAngleSaturated
angleRef = control.angleRef;
angleRefVec = control.angleRef;
if ~rocket.airbrakes.identification
% set velocity of servo (air brakes)
if length(angleRef) == 2 % for the recallOdeFunction
if theta < control.timeChangeRef
angleRef = angleRef(1);
if length(angleRefVec) == 2 % for the recallOdeFunction
if t < control.timeChangeRef
angleRef = angleRefVec(1);
else
angleRef = angleRef(2);
angleRef = angleRefVec(2);
end
else
[~,idxAirbrake] = min(control.partialTime - theta);
angleRef = angleRef(idxAirbrake); % don't delete this unless you change how the recall ode works.
[~,idxAirbrake] = min(control.partialTime - t);
angleRef = angleRefVec(idxAirbrake); % don't delete this unless you change how the recall ode works.
end
else
[~,idxAirbrake] = min(abs(theta-angleRef(:,1))); % if we are trying to identify we need to have the same input of the flight
angleRef = angleRef(idxAirbrake,2);
[~,idxAirbrake] = min(abs(t-angleRefVec(:,1))); % if we are trying to identify we need to have the same input of the flight
angleRef = angleRefVec(idxAirbrake,2);
end
dAngle = (angleRef-angle)/rocket.airbrakes.servoTau;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment