Equator Strut Controller

Dependents:   EquatorStrutDigitalMonitor

Committer:
pyrostew
Date:
Tue Jul 29 08:44:30 2014 +0000
Revision:
0:a6ade00ff41d
Child:
2:3976e3f43470
Equator Strut Controller with position monitoring. No Speed feedback.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pyrostew 0:a6ade00ff41d 1 #ifndef EQUATOR_STRUT_CONTROLLER_H
pyrostew 0:a6ade00ff41d 2 #define EQUATOR_STRUT_CONTROLLER_H
pyrostew 0:a6ade00ff41d 3
pyrostew 0:a6ade00ff41d 4 #include "mbed.h"
pyrostew 0:a6ade00ff41d 5
pyrostew 0:a6ade00ff41d 6 class EquatorStrut
pyrostew 0:a6ade00ff41d 7 {
pyrostew 0:a6ade00ff41d 8 public:
pyrostew 0:a6ade00ff41d 9 EquatorStrut();
pyrostew 0:a6ade00ff41d 10 void SetPower(double power);
pyrostew 0:a6ade00ff41d 11 double GetPosition();
pyrostew 0:a6ade00ff41d 12 double CurrentSpeed();
pyrostew 0:a6ade00ff41d 13 void Home();
pyrostew 0:a6ade00ff41d 14 void Enable();
pyrostew 0:a6ade00ff41d 15 void Disable();
pyrostew 0:a6ade00ff41d 16
pyrostew 0:a6ade00ff41d 17 private:
pyrostew 0:a6ade00ff41d 18 Timer SinInterruptInterval;
pyrostew 0:a6ade00ff41d 19 Ticker InputReadTick;
pyrostew 0:a6ade00ff41d 20
pyrostew 0:a6ade00ff41d 21 InterruptIn* HallSensor;
pyrostew 0:a6ade00ff41d 22
pyrostew 0:a6ade00ff41d 23 PwmOut* PhaseA;
pyrostew 0:a6ade00ff41d 24 PwmOut* PhaseB;
pyrostew 0:a6ade00ff41d 25
pyrostew 0:a6ade00ff41d 26 DigitalIn* RGHSin;
pyrostew 0:a6ade00ff41d 27 DigitalIn* RGHCos;
pyrostew 0:a6ade00ff41d 28
pyrostew 0:a6ade00ff41d 29 DigitalOut* ResetLine;
pyrostew 0:a6ade00ff41d 30 DigitalOut* PulseOut1;
pyrostew 0:a6ade00ff41d 31 DigitalOut* PulseOut2;
pyrostew 0:a6ade00ff41d 32
pyrostew 0:a6ade00ff41d 33 bool Valid();
pyrostew 0:a6ade00ff41d 34
pyrostew 0:a6ade00ff41d 35 void InputRead();
pyrostew 0:a6ade00ff41d 36 void HallEffectFall();
pyrostew 0:a6ade00ff41d 37
pyrostew 0:a6ade00ff41d 38 char PinState;
pyrostew 0:a6ade00ff41d 39
pyrostew 0:a6ade00ff41d 40 int FullWavePeriod;
pyrostew 0:a6ade00ff41d 41 int PartWavePeriod;
pyrostew 0:a6ade00ff41d 42
pyrostew 0:a6ade00ff41d 43 double position;
pyrostew 0:a6ade00ff41d 44
pyrostew 0:a6ade00ff41d 45 int direction;
pyrostew 0:a6ade00ff41d 46
pyrostew 0:a6ade00ff41d 47 bool Homing;
pyrostew 0:a6ade00ff41d 48 bool HallTriggered;
pyrostew 0:a6ade00ff41d 49 bool Enabled;
pyrostew 0:a6ade00ff41d 50 };
pyrostew 0:a6ade00ff41d 51
pyrostew 0:a6ade00ff41d 52 #endif