Encode 5047p connection

Hii everybody. There’s somebody that can show me how to connect asm 5047 encoder?

Connect CS to any of the numbered GPIO pins, and then remember to set encoder.config.abs_spi_gpio_pin to the number of the pin

obviously you should set encoder.config.mode=ENCODER_MODE_ABS_SPI_AMS
it’s also useful to set encoder.config.pre_calibrated=True and motor.config.pre_calibrated=True to take advantage of having an absolute encoder, so you don’t have to calibrate on boot.
That’s it.

1 Like

thank you so much. I’ll tried immediately

Send rotation instruction buqizy

odrv0.axis0.controller.pos_setpoint = 1000
odrv0.axis0.controller.pos_setpoint = 0


Reconnected to ODrive 207035A1524B as odrv0
In [6]: odrv0.axis0.controller.pos_setpoint = 1000

Exception Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\fibre\shell.py in
----> 1 odrv0.axis0.controller.pos_setpoint = 1000

C:\ProgramData\Anaconda3\lib\site-packages\fibre\remote_object.py in setattr
(self, name, value)
252 attr.set_value(value)
253 else:
–> 254 raise Exception(“Cannot write to property {}”.format(nam
255 elif not object.getattribute(self, “sealed”) or name in
object.getattribute(self, “dict”):
256 object.getattribute(self, “dict”)[name] = value

Exception: Cannot write to property pos_setpoint

In [7]:

In Wetmelon’s RazorsEdge, you must use odrv0.axis0.controller.input_pos instead of odrv0.axis0.controller.pos_setpoint

My setup for the AS5047P is:

odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin = 4
odrv0.axis0.encoder.config.mode = 257
odrv0.axis0.encoder.config.cpr = 2**14
1 Like