DC Motor Speed Regulation operation

Source: Internet
Author: User

DC Motor Speed Regulation

?

for a given model, just modify the Controller part of the simulation purposes can be achieved, the previous code only proportional link, no integral and differential links, so need to increase these two links, here set kp=8 , Ki=1 , kd=60 , the resulting simulation waveform is

It can be seen that the acceleration and deceleration time is very short, rapid reaction, the overshoot is not small, the speed curve has a very low deviation.

The specific code is as follows:

Block Controller

?

InPort command (n=1);

?

InPort feedback (n=1);

?

OutPort OutPort (n=1);

?

Real error;

?

Real Errori;

?

Real Errord;

?

Real pout;

?

Parameter Real kp=8;

?

Parameter Real ki=1;

?

Parameter Real kd=60;

?

Parameter Real Max_output_pos = 10;

?

Parameter Real Max_output_neg =-10;

?

Algorithm

?

Error: = command.signal[1]-feedback.signal[1];

?

Errori:=errori+error;

?

Errord:=error-pre (Error);

?

Pout: = Kp * Error+ki*errori+kd*errord;

?

If pout > Max_output_pos Then

?

OUTPORT.SIGNAL[1]: = Max_output_pos;

?

ElseIf Pout < Max_output_neg Then

?

OUTPORT.SIGNAL[1]: = Max_output_neg;

?

Else

?

OUTPORT.SIGNAL[1]: = pout;

?

End If;

?

End Controller;

?

?

?

?

DC Motor Speed Regulation operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.