Noisy setpoint by analog input

Hi, I’m sending a torque setpoint to the GPIO15 of the ODrivePro from another device. This is the GPIO config:

odrv.can.config.protocol = Protocol.NONE
odrv0.config.gpio15_mode = GpioMode.ANALOG_IN
odrv0.config.gpio15_analog_mapping.min = -0.284
odrv0.config.gpio15_analog_mapping.max = 0.284
odrv0.config.gpio15_analog_mapping.endpoint = odrv0.axis0.controller._input_torque_property

The min and max values correspond to the limit torque given by the current limit and torque constant. When I plot the setpoint in the GUI Inspector I see it’s very noisy and I already checked from the device that sends the analog signal that the noise is not coming from there (stable current in the line). Here’s how it looks:
image
This is the output value coming from the device that is sending the signal:


So at max it should oscillate of about 0.0001 Nm and not 0.026 Nm. Is it expected to be this noisy the analog inputs of the ODrive Pro? would it change if I use another GPIO? Is there another way to reduce the noise? Thanks in advance.

I’m immediately thinking of ground loops here – the analog input isn’t isolated, so ground bounce between the sender and the ODrive could definitely be causing this inaccuracy. Could you sketch a quick diagram of your system – how things are wired together, etc?

Here is a rough diagram of the connections:


When I turn off the 48v power supply the noise reduces:
image
Then increases when I turn it on:
image
I tried connecting the 2 grounds of both power supplies:

But very similar results… (internally the bus and AO GND have around 1mV difference)

According to the AO Module datasheet, the bus and the AO should be isolated:

Interesting. I’d add a very small RC filter, maybe 1kohm + 100nF (tau = 1.6kHz, ODrive samples analog at 1kHz). There may also be an additional consideration with how we do analog reads on the Pro – if you’re still getting noise with the RC filter, I can look into that.

Generally, I would recommend against doing analog input – it’s a more nice-to-have than a strongly recommended method of control. Any sort of digital input (USB, UART, or CAN) is definitely recommended over analog, or maybe R/C PWM (1-2ms pulse width) if possible from the PLT?

It was the ODrive’s power supply the culprit… I changed it to another one of better quality and there’s way less noise in the GPIO analog input. Idk why I assumed that the Regen Clamp would smooth the power supply voltage ripple, my bad. I also tested the RC filter and it seems to smooth out the signal, but gets rid of some high frequency signals (not noise), so I prefer to leave it without it as with the new power supply works fine. Thanks for the support.

Fully understood! Yes, the regen clamp will definitely smooth supply ripple, but many supplies (at light load) will expand the acceptable tolerance of the output voltage, which is a bit of a different ball game than high-frequency noise filtering. Very curious the old and new power supplies, if you’re able/willing to share.