Last edited · 6 revisions   

 


ODrive Motor Driver Configuration

The ODrive is an integrated all-in-one servo motor driver with its own capabilities to manage brushless DC motors and encoders.  This includes its own software to setup and tune the drive, you can read more about the ODrive here.

  • For Axis1 and Axis2 only.
  • In OnStepX the AXISn_STEPS_PER_DEGREE setting effectively specifies the operating resolution and can be set to any value within OnStepX's limitations though there isn't much point in exceeding the angular resolution the encoder provides on the ODrive side.
  • Communication with the ODrive controller is by serial interface and this is setup in a pinmap or Config.h by adding lines similar to the following:
    • #define ODRIVE_SERIAL Serial3
    • #define ODRIVE_SERIAL_BAUD 19200
  • The ODrive controller also uses a reset pin and this is setup in a pinmap or Config.h by adding a line similar to the following:
    • #define ODRIVE_RST_PIN 5
  • The update rate controlling how often OnStepX sends axis position information to the controller (in milliseconds) defaults to 100.  This can be changed by adding the similar to the following to a pinmap or Config.h:
    • #define ODRIVE_UPDATE_MS 100
  • The "slew direct" option disables the continious update of position during slews and instead simply updates the position to the final destination (target.)  In this way the acceleration during gotos is controlled by the ODrive and defaults to OFF. This can be changed by adding the similar to the following to a pinmap or Config.h:
    • #define ODRIVE_SLEW_DIRECT OFF
  • The "absolute" hint lets OnStepX know if absolute encoders are present on the ODrive so it can interact properly. Default OFF assumes incremental encoders. This can be changed by adding the similar to the following to a pinmap or Config.h:
    • #define ODRIVE_ABSOLUTE OFF
  • The "sync limit" option works with absolute encoders to allow fine-tuning pointing to adjust for mechanical errors while still not allowing gross pointing errors to occur due to invalid syncs. This specifies the allowed sync range in arc-seconds and defaults to OFF.   It can be changed by adding the similar to the following to a pinmap or Config.h:
    • #define ODRIVE_SYNC_LIMIT OFF
  • The "swap axes" option as the name implies changes the normal order of assignment for Axis1 and Axis2 relative to the ODrive Motor0 and Motor1. This defaults to OFF but can be changed by adding similar to the following to a pinmap or Config.h:
    • #define ODRIVE_SWAP_AXES OFF