Skip to content

Commit 05fb0ff

Browse files
committed
[PitchGain.m] Tidied up several segments of the code
1 parent 6cd5c1c commit 05fb0ff

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

subfunctions/PitchGain.m

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -799,16 +799,23 @@ function EnableDisableButtons(handles, state)
799799
for i = 1:length(handles.SelectedListboxContents)
800800
selIndex = findnearest(str2double(handles.SelectedListboxContents{i}), handles.Control.Pitch.ScheduledPitchAngles*180/pi);
801801
if handles.Control.Pitch.LowPassOrder == 1
802-
Controller(1,i) = Controller(1,i)*tf(handles.Control.Pitch.LowPassCutOffFreqGS(selIndex),[1 handles.Control.Pitch.LowPassCutOffFreqGS(selIndex)]);
802+
Controller(1,i) = Controller(1,i)...
803+
*tf(handles.Control.Pitch.LowPassCutOffFreqGS(selIndex),...
804+
[1 handles.Control.Pitch.LowPassCutOffFreqGS(selIndex)]);
803805
else
804-
Controller(1,i) = Controller(1,i)*tf(handles.Control.Pitch.LowPassCutOffFreqGS(selIndex)^2,[1 2/sqrt(2)*handles.Control.Pitch.LowPassCutOffFreqGS(selIndex) handles.Control.Pitch.LowPassCutOffFreqGS(selIndex)^2]);
806+
Controller(1,i) = Controller(1,i)...
807+
*tf(handles.Control.Pitch.LowPassCutOffFreqGS(selIndex)^2,...
808+
[1 2/sqrt(2)*handles.Control.Pitch.LowPassCutOffFreqGS(selIndex) handles.Control.Pitch.LowPassCutOffFreqGS(selIndex)^2]);
805809
end
806810
end
807811
else
808812
if handles.Control.Pitch.LowPassOrder == 1
809-
Controller(1,:) = Controller(1,:)*tf(handles.Control.Pitch.LowPassCutOffFreq,[1 handles.Control.Pitch.LowPassCutOffFreq]);
813+
Controller(1,:) = Controller(1,:)...
814+
*tf(handles.Control.Pitch.LowPassCutOffFreq,[1 handles.Control.Pitch.LowPassCutOffFreq]);
810815
else
811-
Controller(1,:) = Controller(1,:)*tf(handles.Control.Pitch.LowPassCutOffFreq^2,[1 2/sqrt(2)*handles.Control.Pitch.LowPassCutOffFreq handles.Control.Pitch.LowPassCutOffFreq^2]);
816+
Controller(1,:) = Controller(1,:)...
817+
*tf(handles.Control.Pitch.LowPassCutOffFreq^2,...
818+
[1 2/sqrt(2)*handles.Control.Pitch.LowPassCutOffFreq handles.Control.Pitch.LowPassCutOffFreq^2]);
812819
end
813820
end
814821
end
@@ -819,14 +826,16 @@ function EnableDisableButtons(handles, state)
819826
if all([handles.Control.Pitch.KpGS(selIndex) handles.Control.Pitch.KiGS(selIndex)] == 0)
820827
Controller(1,i) = Controller(1,i);
821828
else
822-
Controller(1,i) = Controller(1,i)*tf([handles.Control.Pitch.KpGS(selIndex) handles.Control.Pitch.KiGS(selIndex)], [1 0]);
829+
Controller(1,i) = Controller(1,i)...
830+
*tf([handles.Control.Pitch.KpGS(selIndex) handles.Control.Pitch.KiGS(selIndex)], [1 0]);
823831
end
824832
end
825833
else
826834
if all([handles.Control.Pitch.Kp handles.Control.Pitch.Ki] == 0)
827835
Controller(1,i) = Controller(1,i);
828836
else
829-
Controller(1,:) = Controller(1,:)*tf([handles.Control.Pitch.Kp handles.Control.Pitch.Ki], [1 0]);
837+
Controller(1,:) = Controller(1,:)...
838+
*tf([handles.Control.Pitch.Kp handles.Control.Pitch.Ki], [1 0]);
830839
end
831840
end
832841
end
@@ -839,8 +848,10 @@ function EnableDisableButtons(handles, state)
839848
Controller(1,i) = Controller(1,i);
840849
else
841850
Controller(1,i) = Controller(1,i)...
842-
*tf([1 2*handles.Control.Pitch.Notch_beta1GS(selIndex)*handles.Control.Pitch.Notch_wnGS(selIndex) handles.Control.Pitch.Notch_wnGS(selIndex)^2], [1 2*handles.Control.Pitch.Notch_beta2GS(selIndex)*handles.Control.Pitch.Notch_wnGS(selIndex) handles.Control.Pitch.Notch_wnGS(selIndex)^2])...
843-
*tf([1 2*handles.Control.Pitch.Notch2_beta1GS(selIndex)*handles.Control.Pitch.Notch2_wnGS(selIndex) handles.Control.Pitch.Notch2_wnGS(selIndex)^2], [1 2*handles.Control.Pitch.Notch2_beta2GS(selIndex)*handles.Control.Pitch.Notch2_wnGS(selIndex) handles.Control.Pitch.Notch2_wnGS(selIndex)^2]);
851+
*tf([1 2*handles.Control.Pitch.Notch_beta1GS(selIndex)*handles.Control.Pitch.Notch_wnGS(selIndex) handles.Control.Pitch.Notch_wnGS(selIndex)^2],...
852+
[1 2*handles.Control.Pitch.Notch_beta2GS(selIndex)*handles.Control.Pitch.Notch_wnGS(selIndex) handles.Control.Pitch.Notch_wnGS(selIndex)^2])...
853+
*tf([1 2*handles.Control.Pitch.Notch2_beta1GS(selIndex)*handles.Control.Pitch.Notch2_wnGS(selIndex) handles.Control.Pitch.Notch2_wnGS(selIndex)^2],...
854+
[1 2*handles.Control.Pitch.Notch2_beta2GS(selIndex)*handles.Control.Pitch.Notch2_wnGS(selIndex) handles.Control.Pitch.Notch2_wnGS(selIndex)^2]);
844855
end
845856
end
846857
else
@@ -849,8 +860,10 @@ function EnableDisableButtons(handles, state)
849860
Controller(1,:) = Controller(1,:);
850861
else
851862
Controller(1,:) = Controller(1,:)...
852-
*tf([1 2*handles.Control.Pitch.Notch_beta1*handles.Control.Pitch.Notch_wn handles.Control.Pitch.Notch_wn^2], [1 2*handles.Control.Pitch.Notch_beta2*handles.Control.Pitch.Notch_wn handles.Control.Pitch.Notch_wn^2])...
853-
*tf([1 2*handles.Control.Pitch.Notch2_beta1*handles.Control.Pitch.Notch2_wn handles.Control.Pitch.Notch2_wn^2], [1 2*handles.Control.Pitch.Notch2_beta2*handles.Control.Pitch.Notch2_wn handles.Control.Pitch.Notch2_wn^2]);
863+
*tf([1 2*handles.Control.Pitch.Notch_beta1*handles.Control.Pitch.Notch_wn handles.Control.Pitch.Notch_wn^2], ...
864+
[1 2*handles.Control.Pitch.Notch_beta2*handles.Control.Pitch.Notch_wn handles.Control.Pitch.Notch_wn^2])...
865+
*tf([1 2*handles.Control.Pitch.Notch2_beta1*handles.Control.Pitch.Notch2_wn handles.Control.Pitch.Notch2_wn^2], ...
866+
[1 2*handles.Control.Pitch.Notch2_beta2*handles.Control.Pitch.Notch2_wn handles.Control.Pitch.Notch2_wn^2]);
854867
end
855868
end
856869
end

0 commit comments

Comments
 (0)