I cannot seem to get the motor to turn the direction I want. It’s an ODrive D5065 motor with CUI encoder mounted on a Taig mill, driving the spindle via the same belt drive and pulleys, in the same location as the original motor. When given a positive velocity command, the Odrive wants to turn the motor in the opposite direction than the original motor (i.e., the wrong way for normal right hand cutters). I really want the original direction to be the direction for a positive velocity command. I didn’t worry about it until now, because it is common knowledge that a 3 phase motor can be reversed by swapping any two motor leads; I do it all the time in my work. Well, imagine my surprise when it didn’t work! Actually, the motor would not turn at all until I re-calibrated everything, but after recalibration, it continued to turn the same, wrong direction - even with two swapped leads. I then tried the alternative described in the docs, which changes the sign of three calibration lockin attributes. This also failed to make a difference. I’ve tried it several times, with no luck. I have no idea why swapping the leads does not work, though it has to be something in the calibration process, perhaps something to do with the encoder wiring. I also don’t know why the documented alternative doesn’t work, unless it has to be done after calibration. Suggestions welcome!
“Positive” for ODrive is defined by the encoder, not the motor phase connection ordering. As you found by swapping leads, part of the calibration procedure is figuring out the relation between the motor phase ordering and encoder direction.
The easiest solution is to command negative velocities. An alternative solution is to swap the A and B pins in the encoder header.
Well, it’s more or less evident that’s the way it is. Might be good to clarify in the docs that changing the index search direction is not the same as changing the motor direction for positive velocity - for those of us who read too quickly…
The solution is also pretty obvious and easily accomplished, so no big problem. I may be being over-picky, but it might be a good idea nonetheless to add the ability to configure the motor rotation sense. There are de facto conventions in the CNC world that M3 means CW rotation, normal right hand cutter rotation, and this corresponds to positive velocities. It would be nice to be able to configure the ODrive to obey that convention.
Hmm, I guess if +Z axis is down toward the table, that obeys RHR.
It’s not to do with the right hand axis rule. It has to do with how cutters must be rotated, so would apply to a hand drill. With “normal” right hand cutters (drills, taps, endmills,…), you need the cutter to rotate CW when looking along the tool towards the work. This is the M3 direction, and it’s usually described as “normal rotation (CW)”. An M3 on both mills and lathes will cause the main spindle to turn appropriately for drilling, etc., with RH tools.
In addition, the “standard direction of rotation” for electric motors is considered to be CCW viewed from the output shaft (Machinery’s Handbook). Of course, they make them with opposite rotation and dual shafts and other non-standard arrangements, but the standard rotation is overwhelmingly dominant.