mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:49:51 +08:00
Added deamon example, reworked / merged multirotor attitude control. Ready for AR.Drone interface changes and integration tests
This commit is contained in:
@@ -43,7 +43,8 @@ CSRCS = err.c \
|
||||
# XXX this really should be a CONFIG_* test
|
||||
#
|
||||
ifeq ($(TARGET),px4fmu)
|
||||
CSRCS += systemlib.c
|
||||
CSRCS += systemlib.c \
|
||||
pid/pid.c
|
||||
endif
|
||||
|
||||
include $(APPDIR)/mk/app.mk
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
#include "pid.h"
|
||||
|
||||
void pid_init(PID_t *pid, float kp, float ki, float kd, float intmax,
|
||||
__EXPORT void pid_init(PID_t *pid, float kp, float ki, float kd, float intmax,
|
||||
uint8_t mode, uint8_t plot_i)
|
||||
{
|
||||
pid->kp = kp;
|
||||
@@ -57,7 +57,7 @@ void pid_init(PID_t *pid, float kp, float ki, float kd, float intmax,
|
||||
pid->error_previous = 0;
|
||||
pid->integral = 0;
|
||||
}
|
||||
void pid_set_parameters(PID_t *pid, float kp, float ki, float kd, float intmax)
|
||||
__EXPORT void pid_set_parameters(PID_t *pid, float kp, float ki, float kd, float intmax)
|
||||
{
|
||||
pid->kp = kp;
|
||||
pid->ki = ki;
|
||||
@@ -84,7 +84,7 @@ void pid_set_parameters(PID_t *pid, float kp, float ki, float kd, float intmax)
|
||||
* @param dt
|
||||
* @return
|
||||
*/
|
||||
float pid_calculate(PID_t *pid, float sp, float val, float val_dot, float dt)
|
||||
__EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, float dt)
|
||||
{
|
||||
/* error = setpoint - actual_position
|
||||
integral = integral + (error*dt)
|
||||
|
||||
@@ -64,10 +64,10 @@ typedef struct {
|
||||
uint8_t saturated;
|
||||
} PID_t;
|
||||
|
||||
void pid_init(PID_t *pid, float kp, float ki, float kd, float intmax, uint8_t mode, uint8_t plot_i);
|
||||
void pid_set_parameters(PID_t *pid, float kp, float ki, float kd, float intmax);
|
||||
__EXPORT void pid_init(PID_t *pid, float kp, float ki, float kd, float intmax, uint8_t mode, uint8_t plot_i);
|
||||
__EXPORT void pid_set_parameters(PID_t *pid, float kp, float ki, float kd, float intmax);
|
||||
//void pid_set(PID_t *pid, float sp);
|
||||
float pid_calculate(PID_t *pid, float sp, float val, float val_dot, float dt);
|
||||
__EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, float dt);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user