# OVER\_REGEN\_CURRENT problem

**URL:** <https://discourse.odriverobotics.com/t/over-regen-current-problem/14467>\
**Category:** General\
**Created:** [August 21, 2026, 5:19pm UTC](https://discourse.odriverobotics.com/t/over-regen-current-problem/14467 "2026-08-21T17:19:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chillstar2000](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@chillstar2000](https://discourse.odriverobotics.com/u/chillstar2000)\
**Post date:** [August 21, 2026, 5:19pm UTC](https://discourse.odriverobotics.com/t/over-regen-current-problem/14467/1 "2026-08-21T17:19:49Z")

</div>

Hi, I got some error after motor and encoder calibration. two 2804 motors with odrive V3.6 firmware 0.5.1. Please help to solve the errors.Thanks a lot.  
Is there any configration mistake? BTW, I use a 12V mingwell power supply.

In [173]: odrv0.config.max\_regen\_current  
Out[173]: 5.0

In [174]: odrv0.config.dc\_max\_negative\_current  
Out[174]: 0.0

In [175]: odrv0.config.brake\_resistance  
Out[175]: 0.4699999988079071

In [135]: odrv0.axis1.controller.config.control\_mode = CONTROL\_MODE\_POSITION\_CONTROL

In [136]: odrv0.axis0.controller.config.control\_mode = CONTROL\_MODE\_POSITION\_CONTROL

In [137]: odrv0.axis1.controller.config.vel\_limit = 2

In [138]: odrv0.axis0.controller.config.vel\_limit = 2

In [139]: odrv0.axis1.controller.config.pos\_gain = 15

In [140]: odrv0.axis0.controller.config.pos\_gain = 15

In [141]: odrv0.axis1.controller.config.vel\_gain = 0.01

In [142]: odrv0.axis0.controller.config.vel\_gain = 0.01

In [143]: odrv0.axis1.controller.config.vel\_integrator\_gain = 0.1

In [144]: odrv0.axis0.controller.config.vel\_integrator\_gain = 0.1

In [145]: odrv0.axis1.controller.config.input\_mode = INPUT\_MODE\_TRAP\_TRAJ

In [146]: odrv0.axis0.controller.config.input\_mode = INPUT\_MODE\_TRAP\_TRAJ

In [147]: odrv0.axis1.trap\_traj.config.vel\_limit = 2

In [148]: odrv0.axis0.trap\_traj.config.vel\_limit = 5

In [149]: odrv0.axis1.trap\_traj.config.accel\_limit = 2

In [150]: odrv0.axis0.trap\_traj.config.accel\_limit = 2

In [151]: odrv0.axis1.trap\_traj.config.vel\_limit = 5

In [152]: odrv0.axis1.trap\_traj.config.decel\_limit = 2

In [153]: odrv0.axis0.trap\_traj.config.decel\_limit = 2

In [154]: odrv0.save\_configuration()

In [155]: odrv0.reboot()  
Reconnected to ODrive 358A387A3335 as odrv0

In [156]: dump\_errors(odrv0)  
axis0  
axis: no error  
motor: no error  
fet\_thermistor: no error  
motor\_thermistor: no error  
encoder: no error  
controller: no error  
axis1  
axis: no error  
motor: no error  
fet\_thermistor: no error  
motor\_thermistor: no error  
encoder: no error  
controller: no error

In [157]: odrv0.axis1.requested\_state = AXIS\_STATE\_MOTOR\_CALIBRATION

In [159]: odrv0.axis0.requested\_state = AXIS\_STATE\_MOTOR\_CALIBRATION

In [160]: odrv0.axis1.motor.config.phase\_resistance  
Out[160]: 4.987849712371826

In [161]: odrv0.axis0.motor.config.phase\_resistance  
Out[161]: 3.382427215576172

In [162]: odrv0.axis1.motor.config.phase\_inductance  
Out[162]: 0.0013441413175314665

In [163]: odrv0.axis0.motor.config.phase\_inductance  
Out[163]: 0.0009417851106263697

In [164]: odrv0.axis1.requested\_state = AXIS\_STATE\_ENCODER\_OFFSET\_CALIBRATION

In [165]: odrv0.axis0.requested\_state = AXIS\_STATE\_ENCODER\_OFFSET\_CALIBRATION

In [166]: odrv0.axis1.config.startup\_encoder\_offset\_calibration = True

In [167]: odrv0.axis0.config.startup\_encoder\_offset\_calibration = True

In [168]: odrv0.axis1.config.startup\_closed\_loop\_control = True

In [169]: odrv0.axis0.config.startup\_closed\_loop\_control = True

In [170]: odrv0.save\_configuration()

In [171]: odrv0.reboot()  
Reconnected to ODrive 358A387A3335 as odrv0

In [172]: dump\_errors(odrv0)  
axis0  
axis: Error(s):  
AXIS\_ERROR\_BRAKE\_RESISTOR\_DISARMED  
AXIS\_ERROR\_MOTOR\_DISARMED  
motor: Error(s):  
MOTOR\_ERROR\_DC\_BUS\_OVER\_REGEN\_CURRENT  
fet\_thermistor: no error  
motor\_thermistor: no error  
encoder: no error  
controller: no error  
axis1  
axis: Error(s):  
AXIS\_ERROR\_INVALID\_STATE  
AXIS\_ERROR\_BRAKE\_RESISTOR\_DISARMED  
motor: Error(s):  
MOTOR\_ERROR\_DC\_BUS\_OVER\_REGEN\_CURRENT  
fet\_thermistor: no error  
motor\_thermistor: no error  
encoder: no error  
controller: no error

In [178]: odrv0.axis1.motor.error  
Out[178]: 16384

In [179]: odrv0.axis1.error  
Out[179]: 17

In [180]: odrv0.axis1.encoder.error  
Out[180]: 0

In [181]: odrv0.axis1.motor.error  
Out[181]: 16384

In [182]: odrv0.axis0.error  
Out[182]: 304

In [183]: odrv0.axis0.encoder.error  
Out[183]: 128

In [184]: odrv0.axis0.motor.error  
Out[184]: 16384

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [August 21, 2026, 6:09pm UTC](https://discourse.odriverobotics.com/t/over-regen-current-problem/14467/2 "2026-08-21T18:09:31Z")

</div>

The key error is BRAKE\_RESISTOR\_DISARMED – as of firmware 0.5.1 the brake resistor has to be explicitly enabled, so right now the current regenerated when the motors decelerate during calibration has nowhere to go. And dc\_max\_negative\_current = 0.0 means the ODrive trips the instant any current flows back towards the supply.

Assuming you have the brake resistor physically connected, ensure you have:

```auto
odrv0.config.enable_brake_resistor = True
odrv0.config.max_regen_current = 0
odrv0.config.dc_max_negative_current = -0.01
odrv0.save_configuration()
odrv0.reboot()

```

Note max\_regen\_current = 5 was telling the ODrive it’s allowed to push 5A back into your Meanwell before using the resistor – those supplies can’t sink current, so leave it at 0 and let the resistor take everything.

Also, your last dump shows axis0 encoder error 128 = ABS\_SPI\_COM\_FAIL – what encoders are you using, and how long are the SPI wires?

---

<div class="post-metadata">

**Author:** ![chillstar2000](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@chillstar2000](https://discourse.odriverobotics.com/u/chillstar2000)\
**Post date:** [August 22, 2026, 1:52am UTC](https://discourse.odriverobotics.com/t/over-regen-current-problem/14467/3 "2026-08-22T01:52:00Z")

</div>

Thanks for reply, it is very helpful!  
I try “odrv0.config.enable\_brake\_resistor = True”,but get below error info.  
I use MT6701 encoder, add a STM32f103C8T6 as encoderbrige to transfer position reading (MT6701 can not be use directly with odrive?). SPI wires are 20cm long.

## In [22]: odrv0.config.enable\_brake\_resistor = True

AttributeError Traceback (most recent call last)  
File :1  
----\> 1 odrv0.config.enable\_brake\_resistor = True

File c:\users\thinkpad\appdata\local\programs\python\python39\lib\site-packages\fibre\remote\_object.py:258, in RemoteObject. **setattr** (self, name, value)  
256 object. **getattribute** (self, “ **dict** ”)[name] = value  
257 else:  
 → 258 raise AttributeError(“Attribute {} not found”.format(name))

AttributeError: Attribute enable\_brake\_resistor not found

---

<div class="post-metadata">

**Author:** ![solomondg](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/s/bcef8e/32.png) [@solomondg](https://discourse.odriverobotics.com/u/solomondg)\
**Post date:** [August 24, 2026, 6:03pm UTC](https://discourse.odriverobotics.com/t/over-regen-current-problem/14467/4 "2026-08-24T18:03:23Z")

</div>

Which ODrive is this? Is it a v3.6?

Note that any encoder reading needs to be extremely low latency (e.g. propagation delay); if the STM32 bridge is delaying the actual encoder position, that can easily lead to poor motor control. Why not just use the incremental A/B/Z outputs of the MT6701?

The AttributeError is because the ODrive is on 0.5.1, which is older than the 0.5.6 firmware release for the v3.6. Consider updating?

However, the root cause is the combination of max\_regen\_current = 5 with dc\_max\_negative\_current = 0. max\_regen\_current = 5 lets up to 5A flow back into your power supply before the brake resistor starts shunting, but dc\_max\_negative\_current = 0 forbids the supply from sinking anything at all – so the instant the motors regen (e.g. decelerating at the end of calibration), you get DC\_BUS\_OVER\_REGEN\_CURRENT. The BRAKE\_RESISTOR\_DISARMED errors are just fallout from that fault.

```auto
odrv0.config.max_regen_current = 0
odrv0.config.dc_max_negative_current = -0.01
odrv0.save_configuration()
odrv0.reboot()

```

That makes the resistor take all the braking current – right for a Meanwell, since those can’t sink current at all.
