% Quanser Consulting Inc. % Copyright April 2000 % function to compute the feedback gains of the table % DO NOT CHANGE THE VALUES HERE UNLESS YOU KNOW WHAT YOU ARE DOING % % % returns three gains Kp, Kd and Kf. Kf is acceleration feedback % requires and accelerometer mounted on the table % % Kt = 0.179; Pitch = 0.5*.0254; Imax = 12.5 ; Fmax = Kt*Imax*2*pi/Pitch; Load = 20; Accel = Fmax/Load; Gmax = Accel/9.8; Kf = Load*Pitch/2/pi/Kt; % TF is Kp Xd / (s^2 + Kd/(Kf+Ka) s + Kp/(Kf+Ka) ); fo = 25; wo = 2*pi*fo; zeta = 0.75; Ka = 2* Kf; tp = pi/wo/sqrt(1-zeta^2); Kp = (Kf+Ka)*wo*wo; %Amp per m Kd = (Kf+Ka)*2*zeta*wo; Kpm = Kp; Kdm = Kd; den = [1 2*zeta*wo wo^2]; roots(den); % Convert to amps per cm Kp = Kp/100; Kd = Kd/100; % Convert to amp/inch Kp = Kp*2.54; Kd = Kd*2.54; %filters ff = 30; wf = 2*pi*ff; fa = 20; wa = 2*pi*fa;