how to build in an characteristic map for the derivative constant (PID, Simulink)

C
Charlie · Sep 22, 2020 · 2K views
Question
i have a problem with my control. i want to use a pid controler with constant parameters for the proportional and the integral parts. The derivative part is prepared in an lookup-table. i have no idea how to connect the output of the lookuptable und the pid-controler. do i have to build up the pid-controler on my own or can i use the given one and just change some properties to get another input-channel.
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Sep 9, 2026







Build a Characteristic Map for the Derivative Constant (Kd) in Simulink


A characteristic map (gain-scheduled lookup table) varies the derivative gain \(K_d\) dynamically according to operating states such as error magnitude, system speed, or temperature. This prevents derivative noise spikes near steady state while providing strong damping during large transients.

Method 1: PID Controller Block with External Gain Port (Recommended)

Step 1: Configure the PID Controller Block



  1. Double-click your PID Controller block in Simulink.

  2. Set the Source parameter from internal to external.

  3. Notice that Simulink exposes input ports P, I, D, and N on the block.

Step 2: Add and Connect the 1-D Lookup Table



  1. Open the Simulink Library Browser and insert a 1-D Lookup Table block.

  2. Connect your scheduling signal (such as |error| or Process Variable) to the lookup table input.

  3. Connect the lookup table output to the D port of the PID Controller block.

  4. Connect constant blocks or fixed lookup tables to the remaining P and I ports.

Method 2: MATLAB Initialization Script for the Characteristic Map


Run this script before starting the simulation to populate the breakpoint coordinates and derivative gain values in the workspace.

% 1. Define scheduling variable breakpoints (e.g. absolute error in RPM)
error_breakpoints = [0, 50, 100, 250, 500, 1000];

% 2. Define corresponding derivative gain Kd map values
% Low Kd near zero error reduces noise chatter; high Kd at large errors adds damping
Kd_table_data = [0.01, 0.05, 0.12, 0.28, 0.45, 0.60];

% 3. Define fixed proportional, integral, and filter coefficients
Kp_val = 1.2;
Ki_val = 0.5;
N_filter = 100; % Derivative filter coefficient (rad/s)

% 4. Assign to 1-D Lookup Table block parameters:
% Table data: Kd_table_data
% Breakpoints 1: error_breakpoints

Method 3: 2-D Characteristic Map (Speed vs. Error)


If the derivative gain must adapt to two independent variables simultaneously (e.g. vehicle speed and tracking error), use a 2-D Lookup Table.

% Row breakpoints: Vehicle Speed (km/h)
speed_grid = [0, 30, 60, 100, 140];

% Column breakpoints: Tracking Error (meters)
error_grid = [0.0, 0.2, 0.5, 1.0, 2.0];

% 2D Gain Surface (Speed x Error)
Kd_2D_map = [
    0.02,  0.05,  0.10,  0.15,  0.20;   % 0 km/h
    0.04,  0.08,  0.14,  0.22,  0.30;   % 30 km/h
    0.06,  0.12,  0.20,  0.30,  0.42;   % 60 km/h
    0.10,  0.18,  0.28,  0.40,  0.55;   % 100 km/h
    0.15,  0.25,  0.38,  0.52,  0.70    % 140 km/h
];

% Configure 2-D Lookup Table block:
% Table data: Kd_2D_map
% Breakpoints 1: speed_grid
% Breakpoints 2: error_grid

Block Parameter Settings Checklist













BlockParameterRecommended Value
PID ControllerGain Sourceexternal
PID ControllerFilter coefficient (N)100 (filters high-frequency noise)
1-D Lookup TableInterpolation MethodLinear point-slope
1-D Lookup TableExtrapolation MethodClip to boundary (Nearest)
Abs BlockInput to Lookup TableUse abs(error) for symmetric gain response


Best Practice: Always use a derivative filter coefficient \(N\) (typically between \(50\) and \(200\)) inside the PID block. Pure derivative action amplifies measurement noise; the low-pass filter ensures that gain scheduling does not introduce instability.




100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!