Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubanek committed Sep 1, 2024
1 parent c3c65f0 commit 920a8a7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/LSST/M1M3/TS/MPU/FlowMeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ namespace TS {

/**
* Reads FlowMeter values.
* [Documentation](https://rubinobs.atlassian.net/wiki/spaces/LTS/pages/50081742/Datasheets?preview=/50081742/50505733/FDT40%20Users%20Guide.pdf)
* [Datasheets](https://confluence.lsstcorp.org/display/LTS/Datasheets).
*/
class FlowMeter : public cRIO::MPU {
public:
FlowMeter(uint8_t bus) : MPU(bus, 1) {}

/**
* Push calls to readout FlowMeter registers.
*/
void readInfo();

uint16_t getSignalStrength() { return getRegister(5500); }
Expand All @@ -49,6 +54,9 @@ class FlowMeter : public cRIO::MPU {
double _getDoubleValue(uint16_t reg);
};

/**
* Add print() method to print readout values.
*/
class FlowMeterPrint : public FlowMeter {
public:
FlowMeterPrint(uint8_t bus) : FlowMeter(bus) {}
Expand Down
19 changes: 19 additions & 0 deletions src/LSST/M1M3/TS/MPU/VFD.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,31 @@ class VFD : public cRIO::MPU {

void readInfo();

/**
* Starts pump - make sure it is running.
*/
void start() { presetHoldingRegister(0x2000, 0x1a); }

/**
* Stops pump - stop its motor.
*/
void stop() { presetHoldingRegister(0x2000, 0x01); }

/**
* Reset pump state - clear all errors.
*/
void resetCommand() { presetHoldingRegister(0x2000, 0x08); }

/**
* Set pump output frequency.
*/
void setFrequency(float freq) { presetHoldingRegister(0x2001, freq * 100.0f); }

/**
* Returns pump status.
*/
uint16_t getStatus() { return getRegister(0x2000); }

float getCommandedFrequency() { return getRegister(0x2001) / 100.0f; }

uint16_t getVelocityPositionBits() { return getRegister(0x2100); }
Expand Down
4 changes: 4 additions & 0 deletions src/LSST/M1M3/TS/Telemetry/FlowMeterThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ namespace M1M3 {
namespace TS {
namespace Telemetry {

/**
* Thread reading out flow meter values. Started from TSPublisher when CSC
* enteres disabled state, updates SAL flow meter telemetery.
*/
class FlowMeterThread final : public cRIO::Thread, MTM1M3TS_flowMeterC {
public:
FlowMeterThread(std::shared_ptr<FlowMeter> flowMeter);
Expand Down
4 changes: 4 additions & 0 deletions src/LSST/M1M3/TS/Telemetry/PumpThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ namespace M1M3 {
namespace TS {
namespace Telemetry {

/**
* Thread reading out pump values. Started from TSPublisher when CSC
* enteres disabled state, updates SAL VFD pump telemetery.
*/
class PumpThread final : public cRIO::Thread, MTM1M3TS_glycolPumpC {
public:
PumpThread(std::shared_ptr<VFD> vfd);
Expand Down

0 comments on commit 920a8a7

Please sign in to comment.