This repository contains Python scripts developed by Dallas Formula Racing for the purpose of reading sensor data (accelerometers and linear potentiometers) from CSV files, filtering out high-frequency noise, converting the data into displacement and wheel load, and calculating the vehicle's linear and rotational acceleration.
Analog Acel: https://www.analog.com/media/en/technical-documentation/data-sheets/adxl335.pdf
Digital Acel: https://www.adafruit.com/product/4438
The vehicle has four linpots, one on each wheel, and two analog accelerometers, one above each axle. The two analog accelerometers are in the process of being replaced for digital ones.
Datapath: handler.py -> filter.py -> conversions.py -> calculations.py -> plots.py
Filter/filter.py: uses a low pass filter to clean the data of high-frequency noise Calculations/calculations.py: calculates the vehicle's linear and rotational acceleration Conversions/conversions.py: based on the sensors' outputs in voltages, calculates the amount of displacement the vehicle experiences and the amount of weight borne by the wheels Make_plots/plots.py: plots the vehicle's wheel load and acceleration as a function of time Handler/handler.py: main function of the library
classDiagram
class handler {
+susp_steering_df: DataFrame
}
class calculations {
calculateWheelLoad(): float[]
calculateDamperPlots(): void
calculateOverSteerUnderSteer(): void
}
class Filter {
apply_low_pass_filter() : void
}
class conversions {
+data: DataFrame
calculateWheelLoadConsts() : float[]
+VOLTAGE_TO_GS_CONVERSION_FACTOR: float
convert_voltage_to_gs() : void
+VOLTS_TO_MM_CONVERSION_FACTOR : float
+VOLTS_TO_MM_OFFSET : float
+MM_TO_IN_CONVERSION_FACTOR : float
convert_voltage_to_in() : void
convert_time() : void
}
class Visualizer {
+df : DataFrame
plot() : void
}
class make_plot {
plotDamperPlots()
plotWheelLoadVSTime()
PlotWheelLoadVSAccel()
plotAccelVSTime()
plotUnderSteer()
plotOverSteer()
}
handler <|-- calculations
handler <|-- conversions
make_plot <|-- Visualizer
handler <|-- make_plot
conversions <|-- Filter