├── Latex report of DC motor simulation.zip ├── Project ├── DC_Motor_Simulation_Report.pdf ├── requirment.pdf └── simulation model │ ├── DCdualLoop.slx │ ├── DCdualLoop_SinlgeLoop_Comparasion.slx │ ├── DCmotor_single_loop.slx │ ├── Results_Analysis_comparasion.m │ ├── Results_Analysis_dualloop.m │ ├── Results_Analysis_dualloop_current_loop.m │ └── Results_Analysis_singleloop.m ├── README.assets ├── dual loop simulink-1689597088139.png ├── dual-loop-simulink.png ├── image-20230508131739964.png ├── image-20230508131801519.png ├── image-20230508131824825.png ├── image-20230508131939032.png ├── image-20230508132652972.png ├── image-20230508132753952.png ├── image-20230508162051558.png ├── image-20230508162201496.png ├── image-20230603170309791.png ├── image-20230603170322520.png ├── image-20230608225910470.png ├── image-20231205233353345.png ├── image-20231205233411322.png ├── image-20231205233422444.png ├── single simulink-1689597063995.png └── single-simulink.png └── README.md /Latex report of DC motor simulation.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/Latex report of DC motor simulation.zip -------------------------------------------------------------------------------- /Project/DC_Motor_Simulation_Report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/Project/DC_Motor_Simulation_Report.pdf -------------------------------------------------------------------------------- /Project/requirment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/Project/requirment.pdf -------------------------------------------------------------------------------- /Project/simulation model/DCdualLoop.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/Project/simulation model/DCdualLoop.slx -------------------------------------------------------------------------------- /Project/simulation model/DCdualLoop_SinlgeLoop_Comparasion.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/Project/simulation model/DCdualLoop_SinlgeLoop_Comparasion.slx -------------------------------------------------------------------------------- /Project/simulation model/DCmotor_single_loop.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/Project/simulation model/DCmotor_single_loop.slx -------------------------------------------------------------------------------- /Project/simulation model/Results_Analysis_comparasion.m: -------------------------------------------------------------------------------- 1 | time=out.tout; 2 | Ia_dual=out.yout{1}.Values.iA.Data; 3 | n_dual=9.55*out.yout{1}.Values.w.Data; 4 | Torque_out_dual=out.yout{1}.Values.Te.Data; 5 | Torque_ref_dual=out.yout{2}.Values.Data; 6 | n_ref_dual=out.yout{3}.Values.Data; 7 | Ia_single=out.yout{5}.Values.iA.Data; 8 | n_single=9.55*out.yout{5}.Values.w.Data; 9 | Torque_out_single=out.yout{5}.Values.Te.Data; 10 | Torque_ref_single=out.yout{6}.Values.Data; 11 | n_ref_single=out.yout{7}.Values.Data; 12 | figure; 13 | % Plot the dual speed 14 | plot(time, n_dual, 'b', 'LineWidth', 1); 15 | hold on; 16 | % Plot the reference speed 17 | plot(time, n_ref_dual, 'r', 'LineWidth', 1); 18 | hold on; 19 | plot(time, n_single, 'g', 'LineWidth', 1); 20 | hold off; 21 | xlabel('Time (s)'); 22 | ylabel('Speed (rpm)'); 23 | title('Speed responce comparasion'); 24 | legend('Dual loop', 'Reference Speed','Single loop'); 25 | figure; 26 | plot(time, Ia_dual,'b','LineWidth',1); 27 | hold on; 28 | plot(time, Ia_single,'g','LineWidth',1); 29 | xlabel('Time (s)'); 30 | ylabel('Amature Current (A)'); 31 | title('Amature current responce comparasion'); 32 | legend('Dual loop','Single loop'); 33 | figure; 34 | plot(time, Torque_out_dual,'b','LineWidth',1); 35 | hold on; 36 | plot(time, Torque_out_single,'r','LineWidth',1); 37 | hold on; 38 | plot(time, Torque_ref_single,'g','LineWidth',1); 39 | xlabel('Time (s)'); 40 | ylabel('Electric Torque ($N\cdot M$)','Interpreter','latex'); 41 | title('Step disturbance in loads'); 42 | legend('Dual loop','Single loop','Reference value'); -------------------------------------------------------------------------------- /Project/simulation model/Results_Analysis_dualloop.m: -------------------------------------------------------------------------------- 1 | time=out.tout; 2 | Ia=out.yout{1}.Values.iA.Data; 3 | n=9.55*out.yout{1}.Values.w.Data; 4 | Torque_out=out.yout{1}.Values.Te.Data; 5 | Torque_ref=out.yout{2}.Values.Data; 6 | n_ref=out.yout{3}.Values.Data; 7 | n_error=n-n_ref; 8 | figure; 9 | % Plot the real speed 10 | plot(time, n, 'b', 'LineWidth', 1); 11 | hold on; 12 | % Plot the reference speed 13 | plot(time, n_ref, 'r', 'LineWidth', 1); 14 | hold on; 15 | %plot speed error 16 | % plot(time, n_error, 'g', 'LineWidth', 1); 17 | % hold off; 18 | % Add labels and title 19 | xlabel('Time (s)'); 20 | ylabel('Speed (rpm)'); 21 | title('Real Speed vs Reference Speed'); 22 | legend('Real Speed', 'Reference Speed','Speed Error'); 23 | %calculate overshoot in speed responce 24 | n_max=max(n); 25 | overshoot_n=(n_max-n_ref(5,1))/n_ref(5,1) 26 | % Create a new figure 27 | figure; 28 | % Plot the output torque 29 | plot(time, Torque_out, 'b', 'LineWidth', 1); 30 | hold on; 31 | % Plot the reference torque 32 | plot(time, Torque_ref, 'r', 'LineWidth', 1); 33 | hold off; 34 | % Add labels and title 35 | xlabel('Time (s)'); 36 | ylabel('Torque ($N\cdot m$)','Interpreter','latex'); 37 | title('Output Torque vs Reference Torque'); 38 | legend('Output Torque', 'Reference Torque'); 39 | figure; 40 | plot(time, Ia,'LineWidth',1); 41 | xlabel('Time (s)'); 42 | ylabel('Amature Current (A)'); 43 | title('Amature current'); -------------------------------------------------------------------------------- /Project/simulation model/Results_Analysis_dualloop_current_loop.m: -------------------------------------------------------------------------------- 1 | time=out.tout; 2 | Ia=out.yout{1}.Values.iA.Data; 3 | n=9.55*out.yout{1}.Values.w.Data; 4 | Torque_out=out.yout{1}.Values.Te.Data; 5 | Torque_ref=out.yout{2}.Values.Data; 6 | n_ref=out.yout{3}.Values.Data; 7 | I_ref=out.yout{4}.Values.Data; 8 | % figure; 9 | % % Plot the real speed 10 | % plot(time, n, 'b', 'LineWidth', 1); 11 | % hold on; 12 | % % Plot the reference speed 13 | % plot(time, n_ref, 'r', 'LineWidth', 1); 14 | % hold off; 15 | % % Add labels and title 16 | % xlabel('Time (s)'); 17 | % ylabel('Speed (rpm)'); 18 | % title('Real Speed vs Reference Speed'); 19 | % legend('Real Speed', 'Reference Speed'); 20 | % %calculate overshoot in speed responce 21 | % n_max=max(n); 22 | % overshoot_n=(n_max-n_ref(5,1))/n_ref(5,1) 23 | % % Create a new figure 24 | % figure; 25 | % % Plot the output torque 26 | % plot(time, Torque_out, 'b', 'LineWidth', 1); 27 | % hold on; 28 | % % Plot the reference torque 29 | % plot(time, Torque_ref, 'r', 'LineWidth', 1); 30 | % hold off; 31 | % % Add labels and title 32 | % xlabel('Time (s)'); 33 | % ylabel('Torque ($N\cdot m$)','Interpreter','latex'); 34 | % title('Output Torque vs Reference Torque'); 35 | % legend('Output Torque', 'Reference Torque'); 36 | figure; 37 | plot(time, Ia,'b','LineWidth',1); 38 | hold on; 39 | plot(time, I_ref,'r','LineWidth',1); 40 | xlabel('Time (s)'); 41 | ylabel('Amature Current (A)'); 42 | title('Amature current'); 43 | legend('Real current', 'Reference current'); 44 | I_max=max(Ia); 45 | overshoot_I=(I_max-I_ref(5,1))/I_ref(5,1) -------------------------------------------------------------------------------- /Project/simulation model/Results_Analysis_singleloop.m: -------------------------------------------------------------------------------- 1 | time=out.tout; 2 | Ia=out.yout{1}.Values.iA.Data; 3 | n=9.55*out.yout{1}.Values.w.Data; 4 | Torque_out=out.yout{1}.Values.Te.Data; 5 | Torque_ref=out.yout{2}.Values.Data; 6 | n_ref=out.yout{3}.Values.Data; 7 | n_error=n-n_ref; 8 | figure; 9 | % Plot the real speed 10 | plot(time, n, 'b', 'LineWidth', 1); 11 | hold on; 12 | % Plot the reference speed 13 | plot(time, n_ref, 'r', 'LineWidth', 1); 14 | hold on; 15 | %plot speed error 16 | % plot(time, n_error, 'g', 'LineWidth', 1); 17 | % hold off; 18 | % Add labels and title 19 | xlabel('Time (s)'); 20 | ylabel('Speed (rpm)'); 21 | title('Real Speed vs Reference Speed'); 22 | legend('Real Speed', 'Reference Speed','Speed Error'); 23 | %calculate overshoot in speed responce 24 | n_max=max(n); 25 | overshoot_n=(n_max-n_ref(5,1))/n_ref(5,1) 26 | % Create a new figure 27 | figure; 28 | % Plot the output torque 29 | plot(time, Torque_out, 'b', 'LineWidth', 1); 30 | hold on; 31 | % Plot the reference torque 32 | plot(time, Torque_ref, 'r', 'LineWidth', 1); 33 | hold off; 34 | % Add labels and title 35 | xlabel('Time (s)'); 36 | ylabel('Torque ($N\cdot m$)','Interpreter','latex'); 37 | title('Output Torque vs Reference Torque'); 38 | legend('Output Torque', 'Reference Torque'); 39 | figure; 40 | plot(time, Ia,'LineWidth',1); 41 | xlabel('Time (s)'); 42 | ylabel('Amature Current (A)'); 43 | title('Amature current'); -------------------------------------------------------------------------------- /README.assets/dual loop simulink-1689597088139.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/dual loop simulink-1689597088139.png -------------------------------------------------------------------------------- /README.assets/dual-loop-simulink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/dual-loop-simulink.png -------------------------------------------------------------------------------- /README.assets/image-20230508131739964.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508131739964.png -------------------------------------------------------------------------------- /README.assets/image-20230508131801519.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508131801519.png -------------------------------------------------------------------------------- /README.assets/image-20230508131824825.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508131824825.png -------------------------------------------------------------------------------- /README.assets/image-20230508131939032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508131939032.png -------------------------------------------------------------------------------- /README.assets/image-20230508132652972.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508132652972.png -------------------------------------------------------------------------------- /README.assets/image-20230508132753952.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508132753952.png -------------------------------------------------------------------------------- /README.assets/image-20230508162051558.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508162051558.png -------------------------------------------------------------------------------- /README.assets/image-20230508162201496.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230508162201496.png -------------------------------------------------------------------------------- /README.assets/image-20230603170309791.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230603170309791.png -------------------------------------------------------------------------------- /README.assets/image-20230603170322520.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230603170322520.png -------------------------------------------------------------------------------- /README.assets/image-20230608225910470.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20230608225910470.png -------------------------------------------------------------------------------- /README.assets/image-20231205233353345.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20231205233353345.png -------------------------------------------------------------------------------- /README.assets/image-20231205233411322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20231205233411322.png -------------------------------------------------------------------------------- /README.assets/image-20231205233422444.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/image-20231205233422444.png -------------------------------------------------------------------------------- /README.assets/single simulink-1689597063995.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/single simulink-1689597063995.png -------------------------------------------------------------------------------- /README.assets/single-simulink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/labourer-Lucas/DC-Motor-Control-Simulation/0dd12e498074f576da148c2dbdefc0a26f36416c/README.assets/single-simulink.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DC-Motor-Simulation 2 | 3 | This is a collection of DC motor speed control simulation, including single(speed) loop and Dual(speed and current) loop speed control. 4 | 5 | ## Requirement for matlab 6 | 7 | Matlab/Simulink 2023b 8 | 9 | ## Project review 10 | 11 | This Project investigates DC motor drive systems, focusing on single-loop and dual-loop speed control systems, and simulates their behavior using Matlab Simulink. Our aim is to analyze and compare the performance of these two types of DC motor drive systems. 12 | 13 | ### Requirment 14 | 15 | ![image-20230603170309791](README.assets/image-20230603170309791.png) 16 | 17 | ![image-20230603170322520](README.assets/image-20230603170322520.png) 18 | 19 | ### Motor parameters 20 | 21 | Dc motor: 22 | 23 | | Un | In | nN | Ra | $\lambda$ | 24 | | ---- | ---- | ------- | ------ | :-------: | 25 | | 220V | 136A | 1460rpm | 0.2ohm | 1.5 | 26 | 27 | PWM source: 28 | 29 | | Ts | Ks | 30 | | -------- | ---- | 31 | | 0.00167s | 40 | 32 | 33 | Armature circuit: 34 | 35 | | R | L | 36 | | ------ | ---- | 37 | | 0.5ohm | 15mH | 38 | 39 | $GD^2=22.5N\cdot m^2$ and $J=m\rho^2=\frac{GD^2}{4g}$ 40 | 41 | Current feedback coefficient: β=0.05V/A; 42 | 43 | Speed feedback coefficient: α=0.007V/rpm; 44 | 45 | Time constants of filters: Toi=0.002s, Ton=0.01s. 46 | 47 | ### Block diagram 48 | 49 | ![image-20230608225910470](README.assets/image-20230608225910470.png) 50 | 51 | ### Simulink model for single-loop control 52 | ![single simulink](README.assets/single-simulink.png) 53 | 54 | ### Simulink model for dual-loop control 55 | ![dual loop simulink](README.assets/dual-loop-simulink.png) 56 | 57 | 58 | 59 | `Results_Analysis_singleloop.m` is used to analyze the results after running `DCmotor_single_loop.slx`. 60 | 61 | `Results_Analysis_comparasion.m` is used to analyze the results after running `DCdualLoop_SinlgeLoop_Comparasion.slx`. 62 | 63 | `Results_Analysis_dualloop.m` is used to analyze the results after running `DCdualLoop.slx`. 64 | 65 | ## Report Overview 66 | 67 | ![image-20231205233353345](README.assets/image-20231205233353345.png) 68 | 69 | ![image-20231205233411322](README.assets/image-20231205233411322.png) 70 | 71 | ![image-20231205233422444](README.assets/image-20231205233422444.png) 72 | --------------------------------------------------------------------------------