Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

Next week's video for Patrons is the next openDog V3 video - there's a lot more walking and testing in this video and a bit of rudimentary dynamic stability thrown in too.

Video comes up early next week for Patrons. 

Files

Previews only

Comments

Anonymous

when I get to odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION the motor does not turn, should it? And I get 257 retuned for odrv0.axis0.error

Anonymous

And when you said "Effectively" did that mean to run the "Encoder Without Index Signal" instructions?

XRobots

Did you do the .requested_state = AXIS_STATE_MOTOR_CALIBRATION first? and then .motor.config.pre_calibrated = True

XRobots

The only thing is there is the offset calibration, which is correct, but then you need to save the calibration as I said above.

Anonymous

I get 256 retuned for odrv0.axis0.error now, is there somewhere that will tell me what that means?

XRobots

Does the motor turn 180' and turn back to where it started again, and that's the axis error afterwards? If so then it means the encoder hasn't come back exactly to where it started again. The encoder has a high CPR so it may be ok. Try .requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL and see if it turns the motor on.

Anonymous

No the motor does not turn. If I reset it to the factory settings it will move in one direction but it does not reverse. Then it never moves again no matter what, it only moves the one time on the odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

XRobots

ok, you need to do AXIS_STATE_MOTOR_CALIBRATION before it will move at all (you can do it once you can save the calibration with .motor.config.pre_calibrated = True ) The full calibration sequence includes the motor calibration. If it only turns one way then the encoder is not working. Try: dump_errors(odrv0,True) to see what the errors are. You can also use: axis0.encoder.shadow_count to read the encoder value. So if you turn it and do the command again the number should change if the encoder is connected and configured correctly.

Anonymous

No change after odrv0.axis0.encoder.shadow_count, it always returns 0 even after I spin the motor between reads

Anonymous

OK, I have 3.3v to 3.3v - gnd to gnd - MISO to MISO - MOSI to MOSI - CLK to SCK - and CSn to pin 4 and I do the .encoder.config.abs_spi_cs_gpio_pin = 4 Is that all wired correctly?

Anonymous

I jumped the 3.3v like you did and I removed to zero ohm resister and put a jumper on the other pins r1 removed and r2 jumped

XRobots

What does: dump_errors(odrv0,True) give you? Also I beleive: axis0.encoder.spi_error_rate should be close to zero.

Anonymous

In [24]: dump_errors(odrv0,True) system: not found axis0 axis: Error(s): UNKNOWN ERROR: 0x00000100 motor: no error sensorless_estimator: no error encoder: Error(s): ENCODER_ERROR_ABS_SPI_COM_FAIL controller: no error axis1 axis: no error motor: no error sensorless_estimator: no error encoder: no error controller: no error --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~\anaconda3\Lib\site-packages\odrive\pyfibre\fibre\shell.py in ----> 1 dump_errors(odrv0,True) ~\anaconda3\lib\site-packages\odrive\utils.py in dump_errors(odrv, clear, printfunc) 125 126 if clear: --> 127 odrv.clear_errors() 128 129 def oscilloscope_dump(odrv, num_vals, filename='oscilloscope.csv'): AttributeError: 'anonymous_interface_2350605565296' object has no attribute 'clear_errors' In [25]:

Anonymous

In [26]: odrv0.axis0.encoder.spi_error_rate Out[26]: 0.9997616410255432

Anonymous

It would be nice if there was a step by step guide to configure the encoder. The Odrive website makes it very hard to know what to do when.

Anonymous

From a fresh start I: Connected to ODrive 2071307D534B as odrv0 In [1]: odrv0.axis0.motor.config.current_lim = 15 In [2]: odrv0.axis0.motor.config.pole_pairs = 20 In [3]: odrv0.axis0.motor.config.motor_type = 0 In [4]: odrv0.axis0.encoder.config.cpr = 16384 In [5]: odrv0.save_configuration() In [6]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE In [7]: At this point the motor turns almost 180 degrees in one direction and stops, it does not reverse. What have I missed? I am following "Getting Started" line by line for those I think matter. Should I not run the odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE command until after I have done other stuff?

XRobots

I will DM you from here because the thread is getting really long. From the end of the error you got from 'dump_errors', and the 'unknown error' it looks like your firmware is massively out of date and does not match the version of the ODrive tool, so it doesn't know what the errors mean.

Anonymous

odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_AMS and odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin =