Adding a New CAN Motor¶
config.ini¶
Go to the individual exoskeleton sections and add the name of your new motor in the values comments above the joints. Make sure you add it to all the exoskeleton configurations.
parseIni.h¶
In the
config_defsnamespace, add a new enumeration value to the motor enum.In the
config_mapnamespace, add a case for your new motor in the motor mapping. Use the string you added toconfig.ini.
Motor.h¶
Define a new CAN motor class that inherits
_CANMotor(seeclass AK60as an example). - To define a motor class, copy one of the existing CAN motor classes at the bottom of the file and rename it. - Ensure the class name is unique and descriptive.
Motor.cpp¶
Define the constructor for your new class.
Following the other CAN motor classes, define your
_T_MAXand_V_MAXto match the motor’s maximum torque and velocity: -_T_MAXis the peak torque in Nm. -_V_MAXis the max speed (rpm) converted to rad/s:[rev/min] / 60 [s/min] * (2 * PI) [rad/rev]
Joint.cpp¶
In each Joint constructor, add a case to the
switchstatement to handle your new motor.
Done¶
Update the config.ini file to use your new motors, and you’re all set!