paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] current sensor problem


From: Felix Ruess
Subject: Re: [Paparazzi-devel] current sensor problem
Date: Fri, 16 Nov 2012 00:27:22 +0100

In the previous discussion it was not clear that the problem was an overflow... it only referred to negative values.
Thx, pushed using BoundAbs.



On Thu, Nov 15, 2012 at 5:43 PM, Eduardo lavratti <address@hidden> wrote:
Felix, i open an issue about current sensor some time ago.
today i make a comment to this issue with a solution.

here are the lines i put in electrical.c
this solve the overflow problem when i use ESC motor break.
after i put the bound to electrical.current the overflow not occured anymore.

#ifdef ADC_CHANNEL_CURRENT
#ifndef SITL
  electrical.current = MilliAmpereOfAdc((electrical_priv.current_adc_buf.sum/electrical_priv.current_adc_buf.av_nb_sample));
  if (electrical.current < -65000 ) electrical.current = -65000;
  if (electrical.current >  65000 ) electrical.current =  65000;
 
#endif
#else


best regards.

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]