# oDrive vs stepper - new to Odrive

**URL:** <https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663>\
**Category:** General\
**Created:** [October 13, 2020, 12:49am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663 "2020-10-13T00:49:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 13, 2020, 12:49am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/1 "2020-10-13T00:49:04Z")

</div>

Just discovered the oDrive. I have an application that could use smoother motion than I get with steppers, was looking at BLDC. AS compared to a stepper, that I have to leave powered up to hold a position, how does the Odrive work? I issue a command, assume via Text for now, to move to a position. It will hold there? Will the motor get hot form this hold like a stepper? Can the current be reduced while holding (maybe not necessary).

I understand the motor destination command is in turns. How are partial turns communicated, what is the resolution?

Thanks for any tips or pointers I should consider.

---

<div class="post-metadata">

**Author:** ![PJohnson](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/pjohnson/32/3571_2.png) [@PJohnson](https://discourse.odriverobotics.com/u/PJohnson)\
**Post date:** [October 13, 2020, 2:02am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/2 "2020-10-13T02:02:40Z")

</div>

Hi Shorton,

ODrive is a closed-loop servo driver with some motion planning capabilities. For your use case, if you are in position control mode, the motor will hold the position that you tell it to. For a perfect system with no load, the holding current is 0. The current required to hold a position depends entirely on your load, so if there is no load, there is very little current. If it’s holding a 50lb weight off the ground with a rope, the motor might warm up a bit.

The `input_pos` parameter is a floating point number. You can give it any valid float as an input (1.23456 for example). The resolution is dependent on your encoder - ODrive can’t do any better than `1 / <encoder cpr> [turns]`, where cpr is the resolution of your encoder.

For the step/direction interface, the parameter of interest is `turns_per_step` - this sets how many turns a step pulse corresponds to. By default, it’s `1/1024`, so it takes 1024 step pulses for the commanded position to be 1 turn ahead of where it started.

Also - ODrive supports a few different input modes. One that is useful for smoothing out step/direction commands is the Filtered Position Mode described here: [https://docs.odriverobotics.com/#other-control-modes](https://docs.odriverobotics.com/#other-control-modes).

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 13, 2020, 2:07am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/3 "2020-10-13T02:07:48Z")

</div>

Thank you. My application is basically a level, belt driven, X-Y system moving around an unchanging (weight) 50lb load. Once positioned, it’s stable, no load. So that’s great.

Now I understand the position parameter, thank you. I figured that was it, but wanted to be sure I understood.

---

<div class="post-metadata">

**Author:** ![PJohnson](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/pjohnson/32/3571_2.png) [@PJohnson](https://discourse.odriverobotics.com/u/PJohnson)\
**Post date:** [October 13, 2020, 2:18am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/4 "2020-10-13T02:18:56Z")

</div>

No problem! One important difference with the ODrive vs a stepper motor is that it needs an absolute reference for the encoder position vs motor phases. In other words: with an incremental encoder, the motor has to move a bit on startup (to figure out “where it is”) before it can be put into closed loop control. With an absolute encoder, the drive can start and go.

The absolute encoders that we support use SPI for communications, which requires some special care with regard to noise. Incremental encoders are more robust.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 13, 2020, 3:46pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/5 "2020-10-13T15:46:46Z")

</div>

My device will have a long cable from the control to the Y axis. so SPI noise may be problematic, dunno. Cable will be over 12 feet. When you say “move a bit”, can you elaborate on “a bit”. 2 encoder steps, 2 revolutions of the motor, how much? I need to know if I need to plan for a vibration at my tool or a move that must be dealt with to prevent a crash.

I need to read up on encoders, I’ve only ever used plain step motors and encoders are new to me. I appreciate you sharing that detail.

---

<div class="post-metadata">

**Author:** ![PJohnson](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/pjohnson/32/3571_2.png) [@PJohnson](https://discourse.odriverobotics.com/u/PJohnson)\
**Post date:** [October 13, 2020, 8:13pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/6 "2020-10-13T20:13:18Z")

</div>

If you use an incremental encoder without an index, the motor will have to move roughly 2 revolutions to calibrate the offset between the encoder and motor phases. With an incremental encoder that has an index pin, like the AMT102-V in the store, the motor only has to rotate until the index position is hit. That will always be less than 1 whole revolution.

For your application, something like a CNC xy gantry, the startup sequence might look like this:

- If the gantry is in a position where an axis would crash during encoder calibration, manually move it towards the middle of the range of the axes
- Turn on machine, ODrives not set to closed loop control on startup
- Use an Arduino or similar device to send the command for encoder calibration and then the command to enable closed-loop control
- Proceed with step and direction commands just like a stepper-driven setup.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 13, 2020, 8:56pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/7 "2020-10-13T20:56:07Z")

</div>

This only happens at the Odrive board’s power-up, right? What happens if the BLDC motor can’t move, due to machine limits, I assume it’s gonna keep trying. A stepper would just give that horrible lost step noise, while it applies a lot of force. I have no experience with the BLDC.

In the case of a machine limit being reached, is there any way to trigger a limit switch and have ti try to calibrate in the other direction? Or at the least cause a reset/stop.

---

<div class="post-metadata">

**Author:** ![PJohnson](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/pjohnson/32/3571_2.png) [@PJohnson](https://discourse.odriverobotics.com/u/PJohnson)\
**Post date:** [October 13, 2020, 9:07pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/8 "2020-10-13T21:07:43Z")

</div>

ODrive does support some limit switch functionality, but I’m not sure if it’s integrated into the calibration sequence. If the motor hits a limit during calibration, the ODrive will just error out and stop. The calibration doesn’t happen automatically on startup unless you configure the ODrive to do so, so the comments about the Arduino are a way for you to have some control over that process based on if the machine is ready for calibration or not.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 13, 2020, 9:27pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/9 "2020-10-13T21:27:40Z")

</div>

Thanks. Sounds like I need to get one to play with.

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [October 14, 2020, 1:44am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/10 "2020-10-14T01:44:51Z")

</div>

You can hook up a limit switch to the Z pin to pretend to be the index pin, as long as there’s no slippage.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 14, 2020, 1:56am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/11 "2020-10-14T01:56:24Z")

</div>

Not following how this would work?

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [October 14, 2020, 1:57am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/12 "2020-10-14T01:57:34Z")

</div>

When the axis attempts to find the index pin, it would run into the limit switch which is connected to the Encoder Z pin on the Odrive. The ODrive _thinks_ this is the index from the encoder. This works as long as the relative position between the motor angle and homing switch never changes (i.e. no belt slippage)

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 14, 2020, 2:22am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/13 "2020-10-14T02:22:16Z")

</div>

Ah. I think I get it now. And I’d wire in parallel so if the system did a startup away from the switch it would find the index pin first and that becomes it’s reference. But if it hit he limit switch subsequently, it would think it was off track and that could be a problem.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 14, 2020, 2:22am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/14 "2020-10-14T02:22:39Z")

</div>

The device I’m moving is a 3rd party machine, I have limited control over it directly. It has 3 states, 1. engaged (with workpiece) and idle, 2. disengaged and idle, and 3. ready to operate upon movement (engaged). So, it could be in the worst case which is engaged but idle state, at startup, so that fact may make using the BLDC a non-starter anyway. Unless I can find a way to ensure it is in a disengaged state before this required homing routine, which may not be possible.

Assuming I cannot mechanically detect the engaged state, if the system does a worst case 99% turn to a index point, something will break or be damaged. So that’s no good. Unless the system can operate at very low torque for this startup routine? I mean low enough that it would slip with the tinyest of resistance and fail initialization if the state was engaged. Possible?

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [October 14, 2020, 2:27am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/15 "2020-10-14T02:27:02Z")

</div>

You want to use one or the other, not in parallel. It should always hit the reference at the exact same electrical angle every time.

The torque needed is surprisingly high during the “lockin” movement, actually. It sounds like you need an absolute encoder, though, if it can’t move a little bit during startup. We are working on a solution that should work for long-distance (your 12 foot wire won’t be a problem) encoder setups. You’ll just need an ethernet cable.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 14, 2020, 2:40am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/16 "2020-10-14T02:40:11Z")

</div>

I can make a CAT6 shielded cable, not problem. That, I know how to do LOL. But I thought the absolute encoder needed a couple of revolutions for startup, worse in my case than the indexed encoder.

From above: 'If you use an incremental encoder without an index, the motor will have to move roughly 2 revolutions to calibrate the offset between the encoder and motor phases. "

I’m misunderstanding something maybe.

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 14, 2020, 2:43am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/17 "2020-10-14T02:43:02Z")

</div>

For me, it’s fundamental that the machine ONLY moves when I direct it to move. Ever.

---

<div class="post-metadata">

**Author:** ![PJohnson](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/pjohnson/32/3571_2.png) [@PJohnson](https://discourse.odriverobotics.com/u/PJohnson)\
**Post date:** [October 14, 2020, 2:49am UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/18 "2020-10-14T02:49:10Z")

</div>

My bad there, I might not have been clear when I said that. There are three good options: Incremental encoder without index signal (worst case for amount of motion required before the motors will accept commands), incremental encoder with index signal (less movement), absolute encoder (no movement).

---

<div class="post-metadata">

**Author:** ![shorton](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/shorton/32/3258_2.png) [@shorton](https://discourse.odriverobotics.com/u/shorton)\
**Post date:** [October 14, 2020, 8:23pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/19 "2020-10-14T20:23:24Z")

</div>

Thanks guys. Yes I missed the absolute encoder as a no move option. Had to go look up the differences but now I understand. And boy are they proud of those encoders LOL. ($$$) Have any recommendations for one similar to your CUI indexed encoder?

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [October 15, 2020, 2:38pm UTC](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663/20 "2020-10-15T14:38:28Z")

</div>

Unfortunately all of the encoder options that work with ODrive natively are susceptible to noise, except the one we’re putting together. What’s your timeline?

[Next page](https://discourse.odriverobotics.com/t/odrive-vs-stepper-new-to-odrive/5663.md?page=2)
