1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 15:11:52 +02:00

tornado/fw/sim/alg.c: dampen more, to also absorb chain jumps

This commit is contained in:
Werner Almesberger 2012-12-09 17:27:14 -03:00
parent ce9caf0f3b
commit 2c7d7b78b0

View File

@ -12,7 +12,7 @@
#define F 2 /* rotational speed in Hz */ #define F 2 /* rotational speed in Hz */
#define R 0.46 /* radius of accelerometer orbit */ #define R 0.46 /* radius of accelerometer orbit */
#define H (G/2) /* hysteresis, in accelerometer units */ #define H (G/3) /* hysteresis, in accelerometer units */
/* noise pattern: frequency, amplitude pairs */ /* noise pattern: frequency, amplitude pairs */
@ -41,13 +41,13 @@ static uint16_t sample(double t)
} }
#define E_SHIFT 6 /* ~ 0.06 */ #define E_SHIFT 8 /* ~ 0.06 */
#define M_SHIFT 10 /* ~ 2/S */ #define M_SHIFT 11 /* ~ 2/S */
static void process(unsigned v) static void process(unsigned v)
{ {
static uint16_t e = MID << E_SHIFT; static uint32_t e = MID << E_SHIFT;
static uint32_t m = MID << M_SHIFT; static uint32_t m = MID << M_SHIFT;
static bool up = 0; static bool up = 0;
int d; int d;