2 #define SCANNER_ENC ((void *)1)
4 /* relative motor position from mirror axis */
8 /* length of motor arm*/
11 /* length of bielle */
14 /* length of mirror (rotating axe to bielle) */
18 /* distance from telemetre to mirror axis */
21 /* higth between mirror axis and horizontal laser beam*/
25 /* transform telemeter unit to cm
26 using linear approximation
27 d_telemetre = a * cm + b
29 //#define TELEMETRE_A (16.76)
30 //#define TELEMETRE_B (-476.)
33 #define TELEMETRE_A_INIT 0.067325
34 #define TELEMETRE_B_INIT 23.225
37 extern double TELEMETRE_A;
38 extern double TELEMETRE_B;
43 #define SCAN_L_MIN 15.
44 #define SCAN_L_MAX 40.
46 #define SCAN_H_MAX 40.
47 #define SCAN_H_COEF (255./(SCAN_H_MAX+10.))
49 #define SCAN_MAX_DIST 70.
51 #define MAX_SAMPLE (1500L)
54 // TRUE encoder value: 3531.75
55 #define SCANNER_STEP_TOUR (14127L)
57 //#define PIX_PER_SCAN 30L
58 #define PIX_PER_SCAN (25L)
60 void scanner_init(void);
61 void scanner_set_mode(uint8_t mode);
63 void scanner_end_process(void);
65 void scanner_calibre_laser(void);
66 void scanner_calibre_mirror(void);
69 void scanner_scan_autonomous(void);
71 int32_t encoders_spi_update_scanner(void * number);
72 int32_t encoders_spi_get_value_scanner(void *number);
74 void do_scan(void * dummy);
84 int32_t pos_start_scan;
91 uint8_t sample_tab[MAX_SAMPLE+10];
92 volatile uint8_t working;
101 uint8_t working_zone;
116 for column drop zone answer
122 uint8_t max_column_detected;
127 #define STEP_PER_ROUND 14127
129 #define TELEMETRE_MIN 66
130 #define TELEMETRE_MAX 466
133 #define TELEMETRE_MIN_CM (25)
134 #define TELEMETRE_MAX_CM (55)
137 #define DIM_ANGLE (400/4)
138 #define DIM_DIST ((TELEMETRE_MAX_CM - TELEMETRE_MIN_CM)*3)
142 #define ANGLE_STEP (STEP_PER_ROUND/DIM_ANGLE +1)
143 #define DIST_STEP ((TELEMETRE_MAX - TELEMETRE_MIN) /DIM_DIST +1)
146 typedef struct _lookup_h_l{
151 #define telemetre_to_cm(t) ((double)(TELEMETRE_A * ((double)(t)) + TELEMETRE_B))
153 #define SCAN_DEFAULT_SPEED 600
156 extern struct scan_params scan_params;