svoe
Dependencies: mbed mbed-STM32F103C8T6 MPU6050_1
Diff: common.h
- Revision:
- 19:2fe650d29823
- Parent:
- 17:bd6b6ac89e0e
- Child:
- 20:e73f49ba5001
--- a/common.h Sun Feb 10 12:05:16 2019 +0000 +++ b/common.h Sun Feb 24 11:02:56 2019 +0000 @@ -3,8 +3,9 @@ Serial sound_in(PA_2, PA_3); VL53L1X glaz(PB_9,PB_8); //USBSerial usb_serial(0x1f00, 0x2012, 0x0001, false); -DigitalOut myled(LED1); +DigitalOut myled(LED1); DigitalOut test(PB_15); //Test pin for diagnostics and debugging + int volatile proc_counter; //(3e5 - 2e6 idle, 2e5 - 5e5 at motion) / per 50 mS float const t_step = 0.02;//SI realtime step @@ -12,7 +13,6 @@ float const g = 9.81;//SI float const pi = 3.1415926535; - float const r_wheel = 0.038;//SI float const center_mas = 0.022;//SI (ot osi) float const mass = 1.3;//SI @@ -32,14 +32,14 @@ coord current; coord target; -float balance_prop = 160; +float balance_prop = 1.5; float balance_diff = 7; float x_prop = 45;//45; -float x_diff = 37;//37; +float x_diff = 45;//37; float azimuth_prop = 40;//50; float azimuth_diff = 10;//15; -float coord_accuracy = 0.1; +float coord_accuracy = 0.15; bool coord_ready; bool fall_flag; @@ -49,4 +49,10 @@ bool motion_flag; int delay_counter; int serva_counter; - +int delay2_counter; +int fall_timer; +int motion_timeout; +int motion_mode; +#define stop 0; +#define go 1; +#define rotate 2;