Skip to content

SLS095 Linear Potentiometer Module #507

@BlakeFreer

Description

@BlakeFreer

we have linear potentiometers which measure the displacement of our suspension. This issue will write a driver to convert Voltage inputs (in volts) to a displacement output (in mm).

  1. Create a new folder lib/sls095. Copy the lib/lookup_table structure.
    • Your code should code in a file called sls095.hpp
    • everything should be in the macfe::sls095 namespace
  2. Write a function which takes a voltage input and returns position.
  3. Add a couple tests to the lib/sls095 folder. Make sure they run and pass when you execute pio test from the folder
  4. Update lvcontroller/src/suspension to use the new function. See that file's comment // todo: update the mapping

    To use the lib/sls095 module in projects/lvcontroller, you should add a relative symlink inside projects/lvcontroller/lib to the module. Use these commands

    cd projects/lvcontroller/lib
    ln -s ../../../lib/sls095

    Then you should be able to #include "sls095.hpp" from anywhere in the LV controller project

Considerations

  • avoid using unnamed constants in equations. use c++ constants to give names to constants
  • your function signature should clearly express the physical units (for example, ComputeTime is a bad name whereas ComputeSeconds explicitly shows the units. this is just an example, your code uses displacement and voltage, not Time)

Metadata

Metadata

Assignees

Labels

controlscontrols team work

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions