PI depth control test

Dependencies:   MS5803 mbed Servo

Committer:
sandwich
Date:
Wed Aug 06 20:33:01 2014 +0000
Revision:
1:07e046bbcb84
Parent:
0:df16f9bfc07b
accounted for servo not being a motor. Made class more self contained

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sandwich 0:df16f9bfc07b 1 #pragma once
sandwich 1:07e046bbcb84 2 #include "mbed.h"
sandwich 1:07e046bbcb84 3 #include "Servo.h"
sandwich 0:df16f9bfc07b 4 #include "MS5803.h"
sandwich 0:df16f9bfc07b 5
sandwich 0:df16f9bfc07b 6 class IMUDepthControl
sandwich 0:df16f9bfc07b 7 {
sandwich 0:df16f9bfc07b 8 private:
sandwich 0:df16f9bfc07b 9 MS5803 IMU;
sandwich 0:df16f9bfc07b 10 float m_set_point;
sandwich 0:df16f9bfc07b 11 float m_Kp;
sandwich 0:df16f9bfc07b 12 float m_Ki;
sandwich 0:df16f9bfc07b 13 float m_errorsum;
sandwich 1:07e046bbcb84 14 float m_delta_t;
sandwich 1:07e046bbcb84 15 float m_last_pos;
sandwich 1:07e046bbcb84 16 Timer t;
sandwich 1:07e046bbcb84 17 Servo output;
sandwich 1:07e046bbcb84 18
sandwich 1:07e046bbcb84 19 Ticker feedback;
sandwich 0:df16f9bfc07b 20 public:
sandwich 0:df16f9bfc07b 21 IMUDepthControl(PinName sda, PinName scl, float Kp, float Ki);
sandwich 0:df16f9bfc07b 22 void setPoint(float setpoint);
sandwich 1:07e046bbcb84 23 void iterate();
sandwich 0:df16f9bfc07b 24 };