MCU
Loading...
Searching...
No Matches
LoadCellInterface.h
Go to the documentation of this file.
1#ifndef __LOADCELLINTERFACE_H__
2#define __LOADCELLINTERFACE_H__
3
4#include "Utility.h"
5#include "SysClock.h"
7#include "SharedDataTypes.h"
8
9/* Structs */
10
12{
13 const AnalogConversion_s &FLConversion;
14 const AnalogConversion_s &FRConversion;
15 const AnalogConversion_s &RLConversion;
16 const AnalogConversion_s &RRConversion;
17};
18
19
21{
22public:
27 }
28 void tick(const LoadCellInterfaceTick_s &intake);
29 void update_raw_data(const LoadCellInterfaceTick_s &intake);
32private:
33 /*
34 FIR filter designed with
35 http://t-filter.appspot.com
36
37 sampling frequency: 100 Hz
38
39 * 0 Hz - 10 Hz
40 gain = 1
41 desired ripple = 5 dB
42 actual ripple = 1.7659949026015025 dB
43
44 * 40 Hz - 50 Hz
45 gain = 0
46 desired attenuation = -40 dB
47 actual attenuation = -47.34009380570117 dB
48 */
49 const static int numFIRTaps_ = 5;
51 {
52 0.07022690881526232,
53 0.27638313122745306,
54 0.408090001549378,
55 0.27638313122745306,
56 0.07022690881526232
57 };
58 int FIRCircBufferHead = 0; // index of the latest sample in the raw buffer
63 bool FIRSaturated_ = false;
64
65};
66
67#endif
veh_vec< float > loadCellForcesFiltered_
LoadCellInterfaceOutput_s getLoadCellForces()
veh_vec< float[numFIRTaps_]> loadCellForcesUnfiltered_
LoadCellInterfaceRawOutput_s _raw_data
void tick(const LoadCellInterfaceTick_s &intake)
float FIRTaps_[numFIRTaps_]
veh_vec< AnalogConversion_s > loadCellConversions_
LoadCellInterfaceRawOutput_s get_latest_raw_data()
void update_raw_data(const LoadCellInterfaceTick_s &intake)
static const int numFIRTaps_
const AnalogConversion_s & RRConversion
const AnalogConversion_s & FRConversion
const AnalogConversion_s & FLConversion
const AnalogConversion_s & RLConversion
generic data vector type that can be used with tire and / or anything to do with 4 corners of the car...
Definition: Utility.h:17