00001
00007 #ifndef VFD_H
00008 #define VFD_H
00009
00010 #include "powerflow.h"
00011 #include "link.h"
00012 #include "node.h"
00013
00014 EXPORT STATUS current_injection_update_VFD(OBJECT *obj);
00015 EXPORT SIMULATIONMODE interupdate_vfd(OBJECT *obj, unsigned int64 delta_time, unsigned long dt, unsigned int iteration_count_val, bool interupdate_pos);
00016 EXPORT STATUS postupdate_vfd(OBJECT *obj);
00017
00018 class vfd : public link_object
00019 {
00020 public:
00021 static CLASS *oclass;
00022 static CLASS *pclass;
00023
00024 public:
00025 int create(void);
00026 int init(OBJECT *parent);
00027 TIMESTAMP presync(TIMESTAMP t0);
00028 TIMESTAMP sync(TIMESTAMP t0);
00029 TIMESTAMP postsync(TIMESTAMP t0);
00030 vfd(MODULE *mod);
00031 inline vfd(CLASS *cl=oclass):link_object(cl){};
00032 int isa(char *classname);
00033
00034 STATUS alloc_freq_arrays(double delta_t_val);
00035 void CheckParameters(void);
00036 complex complex_exp(double angle);
00037 STATUS VFD_current_injection(void);
00038
00039 SIMULATIONMODE inter_deltaupdate_vfd(unsigned int64 delta_time, unsigned long dt, unsigned int iteration_count_val, bool interupdate_pos);
00040 STATUS post_deltaupdate_vfd(void);
00041
00042 public:
00043 double ratedRPM;
00044 double motorPoles;
00045 double desiredRPM;
00046 double stableTime;
00047 double voltageLLRating;
00048 double horsePowerRatedVFD;
00049 double nominal_output_frequency;
00050 double settleTime;
00051
00052 enum {
00053 VFD_OFF=0,
00054 VFD_CHANGING=1,
00055 VFD_STEADY=2
00056 };
00057 enumeration vfdState;
00058 enumeration prev_vfdState;
00059
00060 double currEfficiency;
00061 double desiredFrequency;
00062 double currentFrequency;
00063
00064 private:
00065 node *fNode;
00066 node *tNode;
00067
00068 double *settleFreq;
00069 unsigned int settleFreq_length;
00070 unsigned int curr_array_position;
00071 bool force_array_realloc;
00072
00073 double nominal_output_radian_freq;
00074 double VbyF;
00075 double HPbyF;
00076
00077 double phasorVal[3];
00078 complex prev_power[3];
00079 double prev_desiredRPM;
00080 double efficiency_coeffs[8];
00081 double curr_time_value;
00082 double prev_time_value;
00083 };
00084
00085 #endif // VFD_H
00086