검색결과 리스트
분류 전체보기에 해당되는 글 15건
- 2012.11.21 [디지털 실험 실습] Segment Decoder VDHL
- 2012.11.17 운항관리 11.17
- 2012.11.16 Flight Control Algorithm
- 2012.11.16 PID control algorithm -c language
- 2012.11.15 eve-online
Jeppesen's Airway Manual chart
-->
airport chart
: 위치고도 기본정보 공학의 다이어그램 표시, 기상조건,활주로 정보, 대체공항이용시
approach chart (완전중요)
:목적지 공항의 접근절차, 최초접근절차 등,
sid & star chart
en-route and area chart
:지역별로 상세히 명시된 차트
기상
지도
고도
속도
=> 비행시간(연료) fuel planning 이 비행계획의 가장 중요 key point
*과제 :
#ifndef PID_H_ #define PID_H_ #include //Define parameter #define epsilon 0.01 #define dt 0.01 //100ms loop time #define MAX 4 //For Current Saturation #define MIN -4 #define Kp 0.1 #define Kd 0.01 #define Ki 0.005 float PIDcal(float setpoint,float actual_position) { static float pre_error = 0; static float integral = 0; float error; float derivative; float output; //Caculate P,I,D error = setpoint - actual_position; //In case of error too small then stop intergration if(abs(error) > epsilon) { integral = integral + error*dt; } derivative = (error - pre_error)/dt; output = Kp*error + Ki*integral + Kd*derivative; //Saturation Filter if(output > MAX) { output = MAX; } else if(output < MIN) { output = MIN; } //Update error pre_error = error; return output; } #endif /*PID_H_*/
[smartads] [smartads]
The Matlab simulation of the PID algorithm to control the DC motor
and then embedded PID code:
function output = fcn(error) %Declare static value persistent pre_error; if isempty(pre_error) pre_error = 0; end persistent integral; if isempty(integral) integral = 0; end %Constant Value epsilon = 0.01; dt = 0.01; Kp = 5; Kd = 3; Ki = 0.01; if(abs(error) > epsilon) integral = integral + error*dt; end derivative = (error - pre_error)/dt; output = Kp*error + Ki*integral + Kd*derivative; pre_error = error;
And result for the simulation
The complete code can be download here:
http://www.mediafire.com/?kati3avzw8b17d9
source from http://www.embeddedheaven.com/pid-control-algorithm-c-language.htm.
How can get Kp,Ki,Kd??
Ans)
effective PID parameters are a long story.Manually, you select Kp, first and let's Kd, Ki small.You increase Kp until you get expected setting-time and steady-state error, the more Kp smaller steady-state error and the shorter setting-time.However the more Kp also lead to more overshoot in order to reduce overshoot you increase Kd.Of course, you have to trade-off between Kp and Kd, or setting-time and steady-state versus overshoot.
After all, slightly increase Ki ...
RECENT COMMENT