Overview
Comment: | Monor changes - preparing for Inverted pendulum work |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6069fc9eef54d2f02577543c12b91e8a |
User & Date: | gawthrop@users.sourceforge.net on 2004-10-14 21:40:36 |
Other Links: | branch diff | manifest | tags |
Context
2004-10-14
| ||
21:42:44 | Changed timing - now works with inverted pendulum. check-in: d896096f57 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
21:40:36 | Monor changes - preparing for Inverted pendulum work check-in: 6069fc9eef user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
2004-09-14
| ||
19:04:35 | Improved diagram. check-in: 1226fc1478 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/lib/control/PPP/ppp_lin_run.m from [db1e37b858] to [e3761c925e].
| 1 2 3 4 5 6 7 8 9 10 | - + - + |
|
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + - + | if nargin<7 p_o.sigma = 1e-1; endif ## System sys = mtt2sys(Name); # Create system [A,B,C_0,D_0] = sys2ss(sys); # SS form [n_x, n_u, n_y] = abcddim(A,B,C_0,D_0); ## Extract matrices for controlled and constrained outputs. if !struct_contains(p_c,"I_0") # Indices for controlled outputs p_c.I_0 = 1:n_y endif |
︙ | |||
62 63 64 65 66 67 68 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - | w = ones(n_y,1);; endif if nargin<5 x_0 = zeros(n_x,1); endif |
︙ | |||
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | + + | [p_c.n_U,M_u] = size(p_c.A_u); if (p_c.n_U!=M_u) error("A_u must be square"); endif ## Checks cl_poles = eig(A - B*k_x) ol_poles = eig(A) t_max = 1/min(abs(cl_poles)); t_min = 1/max(abs(cl_poles)); endif ## Initial control U U = zeros(p_c.n_U,1) ; ## Short sample interval dt = p_c.delta_ol/p_c.N; p_o ## Observer design G = eye(n_x); # State noise gain sigma_x = eye(n_x); # State noise variance Sigma = p_o.sigma*eye(n_y) # Measurement noise variance if strcmp(p_o.method, "intermittent") Ad = expm(A*p_c.delta_ol); # Discrete-time transition matrix |
︙ | |||
239 240 241 242 243 244 245 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | - + + + - + - - + - - - + + + + + + + + + + - + - + + + - + | overrun = 2; Ustar = ppp_ustar (p_c.A_u, n_u, [0:dt:overrun*p_c.delta_ol], 0,0); if p_c.integrate # Integrate Ustar disp("Integrating Ustar"); Ustar = cumsum(Ustar)*dt; endif |
︙ | |||
351 352 353 354 355 356 357 | 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | - + | if strcmp(p_o.method, "continuous") t_e = t; endif |