[Solved] - Encoding hooverboard motors with rotary encoder

vel_limit should do it!

I tried using this, but the vel limit just checks the velocity of the motor to see if it passes a certain amount of rotation per second, I need a command that slows the motor physically, or limits the amount of current flowing through the motor.

The ODrive will actively limit the motor to vel_limit, and throw an error if it exceeds vel_limit * vel_limit_tolerance. You can increase vel_limit_tolerance if it’s overshooting vel_limit.

I’ve solved the speed issue, but do you know of any explanations for why my motor might not be moving right away when I send it a position command?

Can you elaborate? How are you sending the command (USB, UART, CAN, etc)? What’s your input mode? Does the motor delay for a second before moving, or do you need to send the command multiple times?

I’m sending it through USB. My input mode is INPUT_MODE_POS_FILTER. My motor delays for several seconds.

Have you changed the input filter bandwidth? It’s quite low by default, increasing it will decrease the time constant of the position filter.

Could you give me the full command for input filter bandwidth?

odrv0.axis0.controller.config.input_filter_bandwidth

I’m having a new issue, I did what you told me to do, but it only moves after a type in one position. If I type in another position, it does not move.

Also, if I separate the rotary encoder from the motor and move the rotary encoder, the motor moves. Do you know how I could stop this so that i does not happen?

Well the encoder should definitely remain connected to the motor.

My best guess here is that your encoder shaft is slipping relative to how it’s connected to the motor - they must always remain tightly coupled. Maybe you could post a picture of how you have everything set up?

By the way - the Discord is going to be the best way to get fast support.

Do you know where I could find Arduino commands for the Odrive using the library OdriveArduino?

If this is for v3.6, you’ll probably have to read the source code, it’s not well documented. If this is for S1/Pro, Controlling ODrive from an Arduino via UART — ODrive Documentation 0.6.8 documentation

Do you know any websites that explain all the commands for configuring the Odrive (besides the Odrive Reference website)?

That’s about it. You could read the source code?

ODrive Pro and S1 are better supported and documented, generally.

What’s the source code and how do I read/access that?

Takes a good amount of coding knowledge, unfortunately. ODrive v3.6 was definitely oriented towards developers and people willing to get a bit dirty with source code.

Which folder?

all the firmware is in Firmware/. You’ll have to have some coding experience to navigate well.

Quick question, Do you know why I could be getting this when I try to save configuration?(I just got a new Odrive):
In [121]: odrv0.save_configuration()
Out[121]: False