Skip to content

This is an official branch for all the device that need to interact with ODrive or Similar Motor Controller. Our team are currently using ODrive V3.6, ODrive Micro, and ODrive S1.

License

Notifications You must be signed in to change notification settings

uwrobotics/Controller_Bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is an official library repository for all the device that need to interact with ODrive micro or S1 or similar Motor Controller. Our team are currently using ODrive V3.6, ODrive Micro, and ODrive S1. Currently the command set support ODrive Micro and S1 using documentation 6.11. ODrive Docs

Project Objective

In short term, this project is aimed to support ODrive family. In long term, this project is also aiming to support custom FOC Device manufactured in house.

  • High-Level CAN Message Agent
    • Device Identification
    • Device Command Abstraction over CAN
    • Grouping Device Command
  • INS/ GNSS Fusion and Logging
  • Device Error Handling
  • Robotics Simulation Abstraction(Gazebo)

Anyone using this library still need to integrate this library into the application/ simulation on top of this static library.

On my computer the post-compiled library is libodrive.a.

Folder Structure

The project

.
├── C++.gitignore
├── CMake.gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── build
├── inc
├── src
└── test   

Movement Command

enum class MvCmd {
    Vel,
    Pos
};

class MvCmd {
    MvCmd mode;
    uint16_t id;
   	float32 value[2]; //X, Y component for vel or pos
}

Note: Vel_FF, Torque_FF is preconfigured variable.

Get Command

class InsOut {
    float fet_temp;
    float bus_volt;
    float bus_curr;
    float pos_est;
    float vel_est;
    float torque_est;
}

class Logging {
    float fet_temp;
    float bus_volt;
    float bus_curr;
    float pos_est;
    float vel_est;
    float torque_est;
    float motor_temp;
    float phase_current_setpoint;
    float phase_current_measured;
    float torque_tar;
    float elec_power;
    float mech_power;
}

Compile Library and UnitTest

# Linux Target
# Option 1:
mkdir build && cd build
cmake .. && cd ..
make

# Option 2:
cmake -B build -DCMAKE_INSTALL_PREFIX=lib -DBUILD_TESTING=OFF
cmake --build build
cmake --install build
# STM Target
cmake -B build_stm -DCMAKE_INSTALL_PREFIX=lib_stm -DBUILD_TESTING=OFF -DTARGET_STM=ON
cmake --build build_stm
cmake --install build_stm

Testing and Validation

cmake -B build -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build

# Execute test
cd build && ctest && cd ..

Triggering Actions

git tag -a v0.0.3 -m "Release v0.0.1" 
git push --follow-tags origin develop

Acknowledgements

About

This is an official branch for all the device that need to interact with ODrive or Similar Motor Controller. Our team are currently using ODrive V3.6, ODrive Micro, and ODrive S1.

Resources

License

Stars

Watchers

Forks

Packages

No packages published