Revision 296

View differences:

branch/lepogam/Emb_App/SessionM32C_E8a_system.ini
25 25
[Target]
26 26
M32C E8a SYSTEM=Renesas Communications
27 27
[USER_DATA]
28
RESET=ff0034
28
RESET=ff0038
branch/lepogam/Emb_App/SessionM32C_E8a_system.hsf
149 149
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_13" "0000000000000000" 
150 150
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_14" "0000000000000000" 
151 151
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000512" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF3297" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF3383" 
153 153
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A42" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000846" 
156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000004" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A5A" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000085E" 
156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
157 157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C0" 
158 158
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
159 159
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
......
172 172
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "000000000000036A" 
173 173
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
174 174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000004" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000512" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A42" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "00000000001200FE" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A5A" 
177 177
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000512" 
178 178
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
179 179
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
......
207 207
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH" "c,buff,n,rx,flag," 
208 208
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "alpha, 2, 0, P, Col, Hex, MA" 
209 209
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
210
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "1" 
210
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "couleur, 2, 0, P, Col, Hex, MA" 
211
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
212
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "consigne_vitesse, 2, 0, P, Col, Dec, MA" 
213
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
214
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "npiste, 2, 0, P, Col, Dec, MA" 
215
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
216
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "vitesse_min, 2, 0, P, Col, Dec, MA" 
217
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
218
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "5" 
211 219
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
212 220
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
213 221
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
......
277 285
0 
278 286
[WINDOW_POSITION_STATE_DATA_VD1]
279 287
"Help" "TOOLBAR 0" 59419 2 4 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
280
"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.08" 365 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0" 
288
"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.07" 365 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0" 
281 289
"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 -4 -30 948 486 9 0 "" "0.0" 
282 290
"{WK_00000001_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.11" 365 0 0 350 200 18 0 "32774|32775|32777|<<separator>>|32780|<<separator>>" "0.0" 
283 291
"{WK_00000001_MEMORY}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.23" 365 2 -1 350 200 2065 0 "42202|42203|42204|42233|<<separator>>|42206|42205|42230|42229|42207|<<separator>>|42208|42209|42210|49076|42228|42227|<<separator>>|42231|42232|42234|42235|<<separator>>|42211|<<separator>>|32796|32797" "0.0" 
......
358 366
[FLASH_DETAILS]
359 367
"" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
360 368
[BREAKPOINTS]
361
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 90544424 1 "{00000000-0000-0000-C000-000000000046}" "" 
369
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 101587000 1 "{00000000-0000-0000-C000-000000000046}" "" 
362 370
[END]
branch/lepogam/Emb_App/programme_principal_etud.c
126 126
unsigned int couleur=0; // vert -> ligne droie
127 127
unsigned int npiste=0;
128 128
unsigned int distance_ref=700;
129
unsigned int distance_ref_init=700;
129 130
unsigned int consigne=450;
131
unsigned int consigne_init=450;
130 132
unsigned int consigne_vitesse=34;
131 133
unsigned int vitesse_min=24;
132 134
unsigned int valeur_t=0;
......
156 158
		switch(npiste){
157 159
			
158 160
        	case(256) : //verte
159
            consigne_vitesse =60;
160
            vitesse_min =35;
161
       		distance_ref = 880;
161
            consigne_vitesse =60; //60
162
            vitesse_min =35; //35
163
       		distance_ref_init = 820; // d?cal?e ? gauche 820
162 164
			go=1;
163 165
            break;
164 166
			
165 167
            case(512) : //bleue
166
            consigne_vitesse =40;
167
            vitesse_min =22;
168
            distance_ref = 700;
168
            consigne_vitesse =50; //48 ok 21'19, max 50
169
            vitesse_min =30;//26 ok 21,19, max 30
170
            distance_ref_init = 700; // centr?e 700
169 171
			go=1;
170 172
            break;
171 173
			
172 174
            case(768) : //rouge
173
            consigne_vitesse =34;
174
            vitesse_min =24;
175
            distance_ref = 700;
175
            consigne_vitesse =46; //40 ok 26,19
176
            vitesse_min =20; // 20 ok 26'19
177
            distance_ref_init = 700;
176 178
			go=1;
177 179
            break;
178 180

  
179 181
                
180 182
            case(1024) : //noir
181
            consigne_vitesse =25;
182
            vitesse_min =25;
183
            distance_ref = 700;
183
            consigne_vitesse =22;
184
            vitesse_min =22;
185
            distance_ref_init = 700;
184 186
			go=1;
185 187
            break;
186 188
            }
......
216 218
	}
217 219

  
218 220
void asserv1(){ //asservissement tourelle
219
	if(alpha!=consigne) valeur_t=k1*(consigne-alpha);
221
	if(alpha!=consigne) valeur_t=k1*(consigne-alpha);	
220 222
	}
221 223

  
222 224
void asserv_roue(){
......
238 240
	
239 241
		comm.data.id='D'; 
240 242
		comm.data.rtr=0; 
241
		comm.data.val=valeur_r;
243
		if(valeur_r>-100) comm.data.val=valeur_r;
244
		else comm.data.val=-100;
242 245
		snd_dtq (CanTx,comm.msg);
243 246
		dly_tsk(10);
244 247
		}
245 248

  
246 249
	}
247 250
void asserv2(){ //asservissement roue
248
	if(couleur==0x1c80) ; // bloc rouge grand valeur 2 avant saut
251
	if(couleur==0x1c80 || couleur==0x18c8 ) ; // avant saut: bloc rouge grand valeur 2 et pr?-barille: petit bloc cyan 32 , bloc les roues
252
	else if(couleur==0x18d0){
253
		distance_ref=400;
254
		if(distance!=distance_ref) valeur_r=-k2*(distance_ref-distance);
255
		}
249 256
	else {
257
		distance_ref=distance_ref_init;
250 258
		if(distance!=distance_ref) valeur_r=-k2*(distance_ref-distance);
251 259
		}
252 260
	}
......
275 283
	}
276 284
void asserv3(){ //asservisement vitesse
277 285
	if(couleur==0x1580 || couleur==0x1581 ) vitesse=consigne_vitesse; // vert=ligne droite
278
	else if(couleur==0x1c80) vitesse=45; // vitesse saut
279
	else if(couleur==0x1c88) vitesse=14; //vitesse apr?s saut,  bloc rouge grand valeur 32 apr?s saut
286
	else if(couleur==0x1c80) vitesse=45; // vitesse saut: bloc rouge grand valeur 2
287
	else if(couleur==0x1c88) vitesse=vitesse_min; //vitesse apr?s saut:  bloc rouge grand valeur 32 
288
	else if(couleur==0x1a90 || couleur==0x1890) vitesse=consigne_vitesse-8; //mise en place rail: grand bloc jaune 64 et piste courbe: petit bloc bleu(cyan) 64
289
	else if(couleur==0x1a88) vitesse=consigne_vitesse+4; //rail apres mise en place: gand bloc jaune 32 
290
	else if(couleur==0x18d0 || couleur==0x18c8) vitesse=vitesse_min; //barille: petit bloc cyan 64 et pr?-barille: petit bloc cyan 32
280 291
	else{
281 292
		vitesse=vitesse_min; //virage
282 293
		}

Also available in: Unified diff