2 ******************************************************************************
3 * @addtogroup OpenPilotModules OpenPilot Modules
5 * @addtogroup PathFollower CONTROL interface class
6 * @brief PID Controler for NE Class definition
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015.
11 * @brief Executes pid control loop for NE
13 * @see The GNU Public License (GPL) Version 3
15 *****************************************************************************/
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef PIDCONTROLNE_H
32 #define PIDCONTROLNE_H
36 #include "pathfollowerfsm.h"
44 void UpdateParameters(float kp
, float ki
, float kd
, __attribute__((unused
)) float ilimit
, float dT
, float velocityMax
);
45 void UpdatePositionalParameters(float kp
);
46 void UpdatePositionState(float pvNorth
, float pvEast
);
47 void UpdatePositionSetpoint(float setpointNorth
, float setpointEast
);
48 void UpdateVelocitySetpoint(float setpointNorth
, float setpointEast
);
49 // void RateLimit(float *spDesired, float *spCurrent, float rateLimit);
50 void UpdateVelocityState(float pvNorth
, float pvEast
);
51 void UpdateCommandParameters(float minCommand
, float maxCommand
, float velocityFeedforward
);
52 void ControlPosition();
53 void ControlPositionWithPath(struct path_status
*progress
);
54 void GetNECommand(float *northCommand
, float *eastCommand
);
55 void GetVelocityDesired(float *north
, float *east
);
56 void UpdateBrakeVelocity(float startingVelocity
, float dT
, float brakeRate
, float currentVelocity
, float *updatedVelocity
);
57 void UpdateVelocityStateWithBrake(float pvNorth
, float pvEast
, float path_time
, float brakeRate
);
60 struct pid2 PIDvel
[2]; // North, East
61 float mVelocitySetpointTarget
[2];
62 float mVelocityState
[2];
63 struct pid PIDposH
[2];
64 float mPositionSetpointTarget
[2];
65 float mPositionState
[2];
69 float mVelocitySetpointCurrent
[2];
75 float mVelocityFeedforward
;
79 #endif // PIDCONTROLNE_H