Back to Portfolio Home

Summary - A C++ library was made to accompany the Mahi Open Exo robot. The library uses the MAHI labs internal libraries, and makes controlling the robot simple and intuitive. The library also enables seamless communication with the Mahi Open Exo simulation, which enables all software intended to run on the physical robot to be tested in a safe environment.

MAHI Open Exo Software

The MAHI Open Exo runs based on a c++ library that I have developed based on the MEII software library that was used before. This library is set up to interface with a number of DAQs that we have in our lab. The library also abstracts out all necessary conversions so that the user can provide inputs and read outputs directly in useful units. This includes converting encoder position and velocity readings to radians for all joints, accounting for gear ratios, as well as allowing the user to provide command torques to the robot, accounting for conversions from voltage output, to current output, to motor torque output which is then amplified through a gear ratio. An example of some of the high-level commands are shown below.

    // enables communication with the daq and turns on the motor drivers
    // updates the internal model of the robot's state

    // get all joint positions, or just get the position from a single joint
    // set all raw joint torques 

    // set torques based on tuned PD gains for position control

    // checks the status of all important states to make sure 
    // that the robot is in a safe configuration

One of the most important features of this library is that it is tightly integrated with the MOE simulation that has been created to work alongside the robot. Through a simple command line flag which can be added to any program, the program will communcate with the MOE simulation instead of attempting to connect to the appropriate DAQ. This is extremely valuable because it lets the user test any program before running it on the actual robot. Not only does this help verify that the program is doing what it was intended to do, but because it includes accurate dynamics of the robot, control algorithms can be tuned using the simulation so that we know they will run effectively the first time on the real robot.