1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-12-22 18:34:14 +02:00

tornado/fw/sim/alg.c: tune EWMA weights; correct sample rate for simulation

This commit is contained in:
Werner Almesberger 2012-12-09 17:15:30 -03:00
parent 30c683effd
commit ce9caf0f3b

View File

@ -8,7 +8,7 @@
#define G 28 /* 1 Earth gravity in accelerometer units */
#define MID 512 /* accelerometer middle value */
#define S 1000 /* sample rate (samples/s) */
#define S 2000 /* sample rate (samples/s) */
#define F 2 /* rotational speed in Hz */
#define R 0.46 /* radius of accelerometer orbit */
@ -41,8 +41,8 @@ static uint16_t sample(double t)
}
#define E_SHIFT 3 /* ~ 0.1 */
#define M_SHIFT 10 /* ~ 1/S */
#define E_SHIFT 6 /* ~ 0.06 */
#define M_SHIFT 10 /* ~ 2/S */
static void process(unsigned v)