You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CCS-COMM_BOARD/RUDRIVEFRAMEWORK/SystemDefinitions.h

49 lines
1019 B
C

/*
* SystemDefinitions.h
*
* Author: Aleksey Gerasimenko
* gerasimenko.aleksey.n@gmail.com
*/
#include <math.h>
#include <stdint.h>
#ifndef SYSTEM_SYSTEMDEFINITIONS_H_
#define SYSTEM_SYSTEMDEFINITIONS_H_
#ifndef NOP
#define NOP asm(" NOP")
#endif
#ifndef FP_PI
#define FP_PI (float)3.14159265359 // Pi
#endif
#ifndef FP_2PI
#define FP_2PI (float)6.28318530718 // 2Pi
#endif
#ifndef FP_DAMP_FACTOR
#define FP_DAMP_FACTOR 0.70710678118654752440 // 1/sqrt(2)
#endif
//
// Voltage PLL-ABC Parameters
//
#define PLLABC_FREQUENCY_NOMINAL (float)(2.0*FP_PI*50.0)
#define PLLABC_FREQUENCY_CUT (float)(2.0*FP_PI*10.0)
#define PLLABC_FILTER_TIME (float)(1.0/PLLABC_FREQUENCY_CUT)
#define PLLABC_CONTROLLER_GAIN (float)(PLLABC_FREQUENCY_CUT/2.0)
#define PLLABC_CONTROLLER_TIME (float)(4.0/PLLABC_FREQUENCY_CUT)
#define PLLABC_FREQUENCY_LIMIT_HI PLLABC_FREQUENCY_CUT
#define PLLABC_FREQUENCY_LIMIT_LOW -PLLABC_FREQUENCY_CUT
#endif /* SYSTEM_SYSTEMDEFINITIONS_H_ */