Current transducer. For the electronic measurement of currents: DC, AC, pulsed..., with galvanic separation between the primary circuit and the secondary circuit.

Committer:
mcm
Date:
Tue Sep 19 16:30:52 2017 +0000
Revision:
1:3766b24dab80
Child:
2:c865023c4b20
Both function and header files are almost ready

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mcm 1:3766b24dab80 1 /**
mcm 1:3766b24dab80 2 * @brief LEM_HAIS.h
mcm 1:3766b24dab80 3 * @details Current transducer. For the electronic measurement of currents:
mcm 1:3766b24dab80 4 * DC, AC, pulsed..., with galvanic separation between the primary
mcm 1:3766b24dab80 5 * circuit and the secondary circuit.
mcm 1:3766b24dab80 6 * Header file.
mcm 1:3766b24dab80 7 *
mcm 1:3766b24dab80 8 *
mcm 1:3766b24dab80 9 * @return NA
mcm 1:3766b24dab80 10 *
mcm 1:3766b24dab80 11 * @author Manuel Caballero
mcm 1:3766b24dab80 12 * @date 19/September/2017
mcm 1:3766b24dab80 13 * @version 19/September/2017 The ORIGIN
mcm 1:3766b24dab80 14 * @pre NaN.
mcm 1:3766b24dab80 15 * @warning NaN
mcm 1:3766b24dab80 16 * @pre This code belongs to Nimbus Centre ( http://www.nimbus.cit.ie ).
mcm 1:3766b24dab80 17 */
mcm 1:3766b24dab80 18 #ifndef LEM_HAIS_H
mcm 1:3766b24dab80 19 #define LEM_HAIS_H
mcm 1:3766b24dab80 20
mcm 1:3766b24dab80 21 #include "mbed.h"
mcm 1:3766b24dab80 22
mcm 1:3766b24dab80 23
mcm 1:3766b24dab80 24 /**
mcm 1:3766b24dab80 25 Example:
mcm 1:3766b24dab80 26
mcm 1:3766b24dab80 27 [todo]
mcm 1:3766b24dab80 28
mcm 1:3766b24dab80 29 */
mcm 1:3766b24dab80 30
mcm 1:3766b24dab80 31
mcm 1:3766b24dab80 32 /*!
mcm 1:3766b24dab80 33 Library for the LEM_HAIS Current transducer.
mcm 1:3766b24dab80 34 */
mcm 1:3766b24dab80 35 class LEM_HAIS
mcm 1:3766b24dab80 36 {
mcm 1:3766b24dab80 37 public:
mcm 1:3766b24dab80 38
mcm 1:3766b24dab80 39
mcm 1:3766b24dab80 40 #ifndef VECTOR_STRUCT_H
mcm 1:3766b24dab80 41 #define VECTOR_STRUCT_H
mcm 1:3766b24dab80 42 typedef struct {
mcm 1:3766b24dab80 43 float Current;
mcm 1:3766b24dab80 44 } Vector_LEM_HAIS_current_t;
mcm 1:3766b24dab80 45
mcm 1:3766b24dab80 46 typedef struct {
mcm 1:3766b24dab80 47 float OUTPUT_Voltage;
mcm 1:3766b24dab80 48 float VREF_Voltage;
mcm 1:3766b24dab80 49 } Vector_LEM_HAIS_voltage_t;
mcm 1:3766b24dab80 50 #endif
mcm 1:3766b24dab80 51
mcm 1:3766b24dab80 52
mcm 1:3766b24dab80 53
mcm 1:3766b24dab80 54
mcm 1:3766b24dab80 55
mcm 1:3766b24dab80 56 /** Create an LEM_HAIS object connected to the specified pins.
mcm 1:3766b24dab80 57 *
mcm 1:3766b24dab80 58 * @param OUTPUT Vout from the device
mcm 1:3766b24dab80 59 * @param VREF Vref out from the device
mcm 1:3766b24dab80 60 */
mcm 1:3766b24dab80 61 LEM_HAIS ( PinName OUTPUT, PinName VREF );
mcm 1:3766b24dab80 62
mcm 1:3766b24dab80 63 /** Delete LEM_HAIS object.
mcm 1:3766b24dab80 64 */
mcm 1:3766b24dab80 65 ~LEM_HAIS();
mcm 1:3766b24dab80 66
mcm 1:3766b24dab80 67 /** It gets the voltage.
mcm 1:3766b24dab80 68 */
mcm 1:3766b24dab80 69 Vector_LEM_HAIS_voltage_t LEM_HAIS_GetVoltage ( float VoltageDivider = 1.0, float ADC_Vref = 3.3 );
mcm 1:3766b24dab80 70
mcm 1:3766b24dab80 71 /** It calculates the current.
mcm 1:3766b24dab80 72 */
mcm 1:3766b24dab80 73 Vector_LEM_HAIS_current_t LEM_HAIS_CalculateCurrent ( Vector_LEM_HAIS_voltage_t myVoltages, uint32_t myIPN );
mcm 1:3766b24dab80 74
mcm 1:3766b24dab80 75
mcm 1:3766b24dab80 76
mcm 1:3766b24dab80 77
mcm 1:3766b24dab80 78
mcm 1:3766b24dab80 79 private:
mcm 1:3766b24dab80 80 AnalogIn _OUTPUT;
mcm 1:3766b24dab80 81 AnalogIn _VREF;
mcm 1:3766b24dab80 82 float _LEM_HAIS_VREF;
mcm 1:3766b24dab80 83 };
mcm 1:3766b24dab80 84
mcm 1:3766b24dab80 85 #endif