Define three tunable discrete-time PID blocks and their I/Os for d-axis current control, q-
axis current control, and speed control.
Cd = tunablePID('Cd','pi',4e-6);
Cd.u = 'Id_e';
Cd.y = 'Vd';
Cq = tunablePID('Cq','pi',4e-6);
Cq.u = 'Iq_e';
Cq.y = 'Vq';
Cspeed = tunablePID('Cspeed','pi',4e-6);
Cspeed.u = 'speed_e';
Cspeed.y = 'Iq_ref';
Create three summing junctions for the inner and out feedback loops.
sum_speed = sumblk('speed_e = speed_ref - speed');
sum_id = sumblk('Id_e = Id_ref - Id');
sum_iq = sumblk('Iq_e = Iq_ref - Iq');
Define inputs, outputs, and analysis points for controller tuning.
input = {'Id_ref','speed_ref'};
output = {'Id','Iq','speed'};
APs = {'Iq_ref','Vd','Vq','Id','Iq','speed'};
Finally, assemble the complete control system, ST0, using these components.
ST0 = connect(sys_singletune,Cd,Cq,Cspeed,sum_speed,sum_id,sum_iq,input,output,APs);
13 Control System Tuning Examples