# Error\_control\_deadline\_missed

**URL:** <https://discourse.odriverobotics.com/t/error-control-deadline-missed/3662>\
**Category:** Support\
**Created:** [November 15, 2019, 4:09pm UTC](https://discourse.odriverobotics.com/t/error-control-deadline-missed/3662 "2019-11-15T16:09:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bechilled](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/bechilled/32/2367_2.png) [@Bechilled](https://discourse.odriverobotics.com/u/Bechilled)\
**Post date:** [November 15, 2019, 4:09pm UTC](https://discourse.odriverobotics.com/t/error-control-deadline-missed/3662/1 "2019-11-15T16:09:44Z")

</div>

Hi guys !

I have an **24V odrive board 3.6** with firmware **v0.4.11** and I’m using it with a brushless motor from hobbyking ([Turnigy Aerodrive SK3 - 4250-350kv](https://hobbyking.com/fr_fr/turnigy-aerodrive-sk3-4250-350kv-brushless-outrunner-motor.html)) and a cheap encoder ([B015GYY7XU](https://www.amazon.fr/gp/product/B015GYY7XU/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1))

I setup my odrive as the documentation suggest:

odrv0.axis0.motor.config:

> pre\_calibrated = False (bool)  
> pole\_pairs = 7 (int)  
> calibration\_current = 10.0 (float)  
> resistance\_calib\_max\_voltage = 2.0 (float)  
> phase\_inductance = 2.110511741193477e-05 (float)  
> phase\_resistance = 0.04368022829294205 (float)  
> direction = -1 (int)  
> motor\_type = 0 (int)  
> current\_lim = 20.0 (float)  
> current\_lim\_tolerance = 1.25 (float)  
> inverter\_temp\_limit\_lower = 100.0 (float)  
> inverter\_temp\_limit\_upper = 120.0 (float)  
> requested\_current\_range = 60.0 (float)  
> current\_control\_bandwidth = 1000.0 (float)

odrv0.axis0.controller.config

> control\_mode = 3 (int)  
> pos\_gain = 20.0 (float)  
> vel\_gain = 0.0005000000237487257 (float)  
> vel\_integrator\_gain = 0.0010000000474974513 (float)  
> vel\_limit = 20000.0 (float)  
> vel\_limit\_tolerance = 1.2000000476837158 (float)  
> vel\_ramp\_rate = 10000.0 (float)  
> setpoints\_in\_cpr = False (bool)

odrv0.axis0.encoder.config

> mode = 0 (int)  
> use\_index = False (bool)  
> find\_idx\_on\_lockin\_only = False (bool)  
> pre\_calibrated = False (bool)  
> zero\_count\_on\_find\_idx = True (bool)  
> cpr = 2400 (int)  
> offset = -1279 (int)  
> offset\_float = 0.1684531271457672 (float)  
> enable\_phase\_interpolation = True (bool)  
> bandwidth = 1000.0 (float)  
> calib\_range = 0.019999999552965164 (float)  
> calib\_scan\_distance = 50.26548385620117 (float)  
> calib\_scan\_omega = 12.566370964050293 (float)  
> idx\_search\_unidirectional = False (bool)  
> ignore\_illegal\_hall\_state = False (bool)

The full\_calibration and the closed\_loop\_control work just fine. But when I want to move the motor with pos\_setpoint, I’m getting this error:

 ![odrive2](https://discourse.odriverobotics.com/uploads/default/original/2X/e/e3d44e993e444a2b0a7cf1d37975359edb2e36ba.jpeg)

> axis0  
> axis: Error(s):  
> ERROR\_CONTROLLER\_FAILED  
> motor: Error(s):  
> ERROR\_CONTROL\_DEADLINE\_MISSED  
> encoder: no error  
> controller: Error(s):  
> ERROR\_OVERSPEED

I’m trying to figure out what happen for 2 weeks now. I played with a lot of params, try 12V and 24v power supply, change the motor and the encoder (but same ref), try python script instead of odrivetool.  
Same result ☹

I have the feeling that the problem come from the encoder (600 ppr so 2400 cpr) because I read

> _“Usually that error is caused by noise on the index pulse line of the encoders. It gets picked up and triggers an interrupt on repeat.”_

But my setup is pretty clean and I don’t understand how there can be noise

Am I missing something ? Any ideas ?  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![towen](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/t/bcef8e/32.png) [@towen](https://discourse.odriverobotics.com/u/towen)\
**Post date:** [November 15, 2019, 4:58pm UTC](https://discourse.odriverobotics.com/t/error-control-deadline-missed/3662/2 "2019-11-15T16:58:51Z")

</div>

Ignore the CONTROL\_DEADLINE\_MISSED - it’s misleading. It’s caused by the real error, which is ERROR\_OVERSPEED.

As in a similar thread here:

> [@Slotless BLDC Motor](https://discourse.odriverobotics.com/t/slotless-bldc-motor/3296/4):
>
> I believe that this error is just an overspeed error- ignore the control\_deadline\_missed. It is caused by hitting the configured velocity limit, which itself is usually caused by controller instability or an unrealistic demand. You could: Increase the vel\_limit Reduce your controller gains Do not set the position demand using pos\_setpoint= to move a lonbg distance. Set your trap\_traj vel\_limit to be below (e.g. half) the actual vel\_limit, and use controller.move\_to\_pos() instead, to generate …

1. Do not set the position demand using pos\_setpoint= to move a long distance.  
Set your trap\_traj vel\_limit to be below (e.g. half) the actual vel\_limit, and use controller.move\_to\_pos() instead, to generate and follow trajectory to the new position
2. Increase the vel\_limit
3. Reduce your controller gains

---

<div class="post-metadata">

**Author:** ![Bechilled](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/bechilled/32/2367_2.png) [@Bechilled](https://discourse.odriverobotics.com/u/Bechilled)\
**Post date:** [November 17, 2019, 6:34pm UTC](https://discourse.odriverobotics.com/t/error-control-deadline-missed/3662/4 "2019-11-17T18:34:48Z")

</div>

Thank you for the anwser 👌

move\_to\_pos() seems to work much better than pos\_setpoint.

Where can I read more about the trap\_traj attributs ? I would like to know what is the difference between trap\_traj.vel\_limit and controller.vel\_limit.  
Also what about the controller gains ?

Thanks again

---

<div class="post-metadata">

**Author:** ![towen](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/t/bcef8e/32.png) [@towen](https://discourse.odriverobotics.com/u/towen)\
**Post date:** [November 17, 2019, 8:18pm UTC](https://discourse.odriverobotics.com/t/error-control-deadline-missed/3662/5 "2019-11-17T20:18:58Z")

</div>

Hi @Bechilled

See [https://docs.odriverobotics.com/#trajectory-control](https://docs.odriverobotics.com/#trajectory-control)  
Also [https://docs.odriverobotics.com/control](https://docs.odriverobotics.com/control)

The vel\_limit is a safety speed limit - the drive will lock out in error if it is exceeded.

The ODrive implements various PID control loops (see second link). If you set pos\_setpoint directly, then you are simply changing the control reference (effectively, you are asking for infinite acceleration) - if it’s more than a few counts away from the actual position, then the integrator will wind up and the drive will use maximum available voltage and current to accelerate, until it approaches the new position. This may exceed the vel\_limit and cause it to shut down.

trap\_traj.vel\_limit is not so much a limit but a cruising speed - the trajectory generator plans a smooth ramp in position reference, so as not to cause such severe acceleration.

As for control gains, see link and/or read up about how PID controllers work 🙂
