2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file hip9011_lookup.h
|
|
|
|
*
|
|
|
|
* @date Jan 4, 2015
|
2017-01-03 03:05:22 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
#ifndef CONTROLLERS_SENSORS_HIP9011_LOOKUP_H_
|
|
|
|
#define CONTROLLERS_SENSORS_HIP9011_LOOKUP_H_
|
|
|
|
|
2016-01-01 14:02:49 -08:00
|
|
|
#include "engine.h"
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#define INT_LOOKUP_SIZE 32
|
|
|
|
#define GAIN_LOOKUP_SIZE 64
|
|
|
|
#define BAND_LOOKUP_SIZE 64
|
|
|
|
|
|
|
|
#define PIF 3.14159f
|
|
|
|
#define DESIRED_OUTPUT_VALUE 5.0f
|
|
|
|
|
|
|
|
extern const int integratorValues[INT_LOOKUP_SIZE];
|
|
|
|
extern const float gainLookupInReverseOrder[GAIN_LOOKUP_SIZE];
|
|
|
|
extern const float bandFreqLookup[BAND_LOOKUP_SIZE];
|
|
|
|
|
|
|
|
float getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth);
|
2019-01-04 16:20:32 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
int getHip9011BandIndex(float frequency);
|
|
|
|
|
2017-05-28 21:02:43 -07:00
|
|
|
#define GAIN_INDEX(gain) (GAIN_LOOKUP_SIZE - 1 - findIndexMsg("fGain", gainLookupInReverseOrder, GAIN_LOOKUP_SIZE, (gain)))
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
extern float rpmLookup[INT_LOOKUP_SIZE];
|
2017-05-15 20:33:22 -07:00
|
|
|
void initEngineNoiseTable(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#endif /* CONTROLLERS_SENSORS_HIP9011_LOOKUP_H_ */
|