Code covered by the BSD License  

Highlights from
Model-Based Design for Electrical Automobile Chassis Control

image thumbnail

Model-Based Design for Electrical Automobile Chassis Control

by

 

11 Dec 2008 (Updated )

You will be able to understand MBD process with Lego R/C car.

nxtGTHi_Ctrl_param.m
%%
% Parameters for NXT GT Hi controller characteristics
% Copyright (C)

%% 
% Ctrl sample rate [sec]
%
Tsctrl = 0.01;

%%
% Ctrl initial mode
%
Ctrl_init = 8;

%%
% Filter coefficient
%
% [num2,den2] = butter(4,0.12);
%
[AdC, BdC, CdC, DdC] = butter(4, 0.04);          % Gyro, Accel X, Accel Y
[AdTCS, BdTCS, CdTCS, DdTCS] = butter(4, 0.3);   % TCS
[AdEDC, BdEDC, CdEDC, DdEDC] = butter(4, 0.3);   % EDC
[AdESC, BdESC, CdESC, DdESC] = butter(4, 0.5);   % ESC
[AdSAC, BdSAC, CdSAC, DdSAC] = butter(4, 0.2);   % SAC
[AdCSC, BdCSC, CdCSC, DdCSC] = butter(4, 0.4);   % CSC
[AdPWM, BdPWM, CdPWM, DdPWM] = butter(4, 0.7);   % PWM

%%
% Base Steering PID Ctrler gain
%
BaseStrCtrl_Kd = single(1.0000e-006);
BaseStrCtrl_Ki = single(0.1);
BaseStrCtrl_Kp = single(0.9);

%%
% Feedback gain
%
%%
% TCS

% For nxtGTHi_ctrl_1.mdl
TCS_F = single([-26.6108026705561]);
TCS_F1 = single([7.77293383509711 1.12191966407866]);

% For nxtGTHi_ctrl_2.mdl 
load tcs1FB
tcs1Hi_A = single(tcs1HiA);
tcs1Hi_B = single(tcs1HiB);
tcs1Hi_C = single(tcs1HiC);
tcs1Hi_D = single(tcs1HiD);

% For nxtGTHi_ctrl_3.mdl 
load tcs2FB
tcs2Hi_A = single(tcs2HiA);
tcs2Hi_B = single(tcs2HiB);
tcs2Hi_C = single(tcs2HiC);
tcs2Hi_D = single(tcs2HiD);

%% 
% EDC
%
EDC_F  = single([-54.8556421946332]);
EDC_F1 = single([1.37138667928718 11.4247501455226]);

%%
% ESC
%
ESC_F_RL  = single([1.83163917865661]);
ESC_F1_RL = single([-0.228954708347323 -1.1362975478069]);
ESC_F_RR  = single([-1.83163917865661]);
ESC_F1_RR = single([0.228954708347323 1.1362975478069]);

%%
% SAC
%
SAC_F_RL  = single([5.92570897267921]);
SAC_F1_RL = single([-10.4581956711644 -6.26590254515182]);
SAC_F_RR  = single([-5.92570897267921]);
SAC_F1_RR = single([10.4581956711644 6.26590254515182]);

%%
% CSC
%
CSC_F  = single([-1.7320508075719]);
CSC_F1 = single([2.62661555387026 1.41425102728543]);

%%
%<EOF>

Contact us