Skip to content

Commit fdd9dff

Browse files
committed
Add control architecture diagrams and state-space models for various robotic systems
- Introduced system block diagrams for Scout V2, Tractor, TurtleBot3, and Wheelchair, detailing their control architectures. - Added state-space model diagrams and matrices for each system, providing insights into their dynamics. - Included kinematic models and control algorithms, enhancing documentation for motion control and obstacle avoidance strategies. - Enhanced clarity and structure of the documentation with mermaid diagrams for better visualization of system interactions.
1 parent 9fa0f5b commit fdd9dff

9 files changed

Lines changed: 2117 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ examples/**/controllers/**/**.mexmaca64
1111
examples/**/controllers/**/**.r*
1212
examples/**/controllers/**/**.asv
1313

14+
.claude
15+
1416
# Byte-compiled / optimized / DLL files
1517
__pycache__/
1618
*.py[cod]

docs/examples/crazyflie-drone.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,222 @@ m4_motor = wb_robot_get_device('m4_motor');
213213

214214
## Control System Design
215215

216+
### System Block Diagram
217+
218+
```mermaid
219+
flowchart TB
220+
subgraph Reference["Reference Inputs"]
221+
R1[/"Position<br/>(x_d, y_d, z_d)"/]
222+
R2[/"Yaw<br/>(ψ_d)"/]
223+
end
224+
225+
subgraph Control["Cascaded Control System"]
226+
subgraph OuterLoop["Outer Loop - Position"]
227+
PC[Position<br/>Controller]
228+
end
229+
subgraph MiddleLoop["Middle Loop - Attitude"]
230+
AC[Attitude<br/>Controller]
231+
end
232+
subgraph InnerLoop["Inner Loop - Rate"]
233+
RC[Rate<br/>Controller]
234+
end
235+
end
236+
237+
subgraph Mixer["Motor Mixer"]
238+
MIX[X-Config<br/>Mixing]
239+
end
240+
241+
subgraph Motors["Motors"]
242+
M1[M1<br/>Front-Right]
243+
M2[M2<br/>Back-Right]
244+
M3[M3<br/>Back-Left]
245+
M4[M4<br/>Front-Left]
246+
end
247+
248+
subgraph Plant["Crazyflie Quadcopter"]
249+
QUAD[Vehicle<br/>Dynamics]
250+
end
251+
252+
subgraph Sensors["Sensor Suite"]
253+
IMU_S[IMU]
254+
GPS_S[GPS]
255+
GYRO_S[Gyro]
256+
RANGE[Range<br/>Sensors]
257+
end
258+
259+
R1 --> PC
260+
R2 --> AC
261+
PC --> AC
262+
AC --> RC
263+
RC --> MIX
264+
265+
MIX --> M1
266+
MIX --> M2
267+
MIX --> M3
268+
MIX --> M4
269+
270+
M1 --> QUAD
271+
M2 --> QUAD
272+
M3 --> QUAD
273+
M4 --> QUAD
274+
275+
QUAD --> IMU_S
276+
QUAD --> GPS_S
277+
QUAD --> GYRO_S
278+
QUAD --> RANGE
279+
280+
IMU_S --> AC
281+
GPS_S --> PC
282+
GYRO_S --> RC
283+
RANGE --> PC
284+
285+
style Reference fill:#e1f5fe
286+
style Control fill:#e8f5e9
287+
style Mixer fill:#fff8e1
288+
style Motors fill:#ffebee
289+
style Plant fill:#fce4ec
290+
style Sensors fill:#f3e5f5
291+
```
292+
293+
### Cascaded Control Architecture
294+
295+
```mermaid
296+
flowchart LR
297+
subgraph Position["Position Control (10 Hz)"]
298+
POS_D[/"x_d, y_d, z_d"/]
299+
POS[/"x, y, z"/]
300+
POS_ERR((Δ))
301+
POS_CTRL[Position PID]
302+
ATT_CMD["φ_d, θ_d, T"]
303+
304+
POS_D --> POS_ERR
305+
POS --> POS_ERR
306+
POS_ERR --> POS_CTRL
307+
POS_CTRL --> ATT_CMD
308+
end
309+
310+
subgraph Attitude["Attitude Control (250 Hz)"]
311+
ATT_D[/"φ_d, θ_d, ψ_d"/]
312+
ATT[/"φ, θ, ψ"/]
313+
ATT_ERR((Δ))
314+
ATT_CTRL[Attitude PID]
315+
RATE_CMD["p_d, q_d, r_d"]
316+
317+
ATT_CMD --> ATT_D
318+
ATT_D --> ATT_ERR
319+
ATT --> ATT_ERR
320+
ATT_ERR --> ATT_CTRL
321+
ATT_CTRL --> RATE_CMD
322+
end
323+
324+
subgraph Rate["Rate Control (500 Hz)"]
325+
RATE_D[/"p_d, q_d, r_d"/]
326+
RATE[/"p, q, r"/]
327+
RATE_ERR((Δ))
328+
RATE_CTRL[Rate PID]
329+
MOMENT["τ_φ, τ_θ, τ_ψ"]
330+
331+
RATE_CMD --> RATE_D
332+
RATE_D --> RATE_ERR
333+
RATE --> RATE_ERR
334+
RATE_ERR --> RATE_CTRL
335+
RATE_CTRL --> MOMENT
336+
end
337+
338+
style Position fill:#e3f2fd
339+
style Attitude fill:#fff3e0
340+
style Rate fill:#e8f5e9
341+
```
342+
343+
### Motor Mixing (X-Configuration)
344+
345+
```mermaid
346+
flowchart TB
347+
subgraph MixerInput["Control Commands"]
348+
T["Thrust (T)"]
349+
TAU_PHI["Roll Moment (τ_φ)"]
350+
TAU_THETA["Pitch Moment (τ_θ)"]
351+
TAU_PSI["Yaw Moment (τ_ψ)"]
352+
end
353+
354+
subgraph MixingMatrix["X-Configuration Mixing"]
355+
MIX["Motor Mixing Matrix"]
356+
end
357+
358+
subgraph MotorOut["Motor Commands"]
359+
W1["ω₁ = T + τ_φ - τ_θ - τ_ψ"]
360+
W2["ω₂ = T - τ_φ - τ_θ + τ_ψ"]
361+
W3["ω₃ = T - τ_φ + τ_θ - τ_ψ"]
362+
W4["ω₄ = T + τ_φ + τ_θ + τ_ψ"]
363+
end
364+
365+
subgraph Layout["Motor Layout (Top View)"]
366+
L1[" M4(CCW) M1(CW) "]
367+
L2[" ╲ ╱ "]
368+
L3[" ╲ ╱ "]
369+
L4[" × "]
370+
L5[" ╱ ╲ "]
371+
L6[" ╱ ╲ "]
372+
L7[" M3(CW) M2(CCW) "]
373+
end
374+
375+
T --> MIX
376+
TAU_PHI --> MIX
377+
TAU_THETA --> MIX
378+
TAU_PSI --> MIX
379+
380+
MIX --> W1
381+
MIX --> W2
382+
MIX --> W3
383+
MIX --> W4
384+
385+
style MixerInput fill:#e1f5fe
386+
style MixingMatrix fill:#fff8e1
387+
style MotorOut fill:#e8f5e9
388+
style Layout fill:#f5f5f5
389+
```
390+
391+
### Control Loop Details
392+
393+
```mermaid
394+
flowchart TB
395+
subgraph AltitudeControl["Altitude Control"]
396+
Z_D[/"z_d"/]
397+
Z[/"z"/]
398+
VZ[/"v_z"/]
399+
ERR_Z((+<br/>-))
400+
PID_Z[PID<br/>Kp=50, Ki=5, Kd=15]
401+
THRUST["Thrust Command"]
402+
403+
Z_D --> ERR_Z
404+
Z --> ERR_Z
405+
ERR_Z --> PID_Z
406+
VZ --> PID_Z
407+
PID_Z --> THRUST
408+
end
409+
410+
subgraph AttitudeLoop["Attitude Loop (Roll Example)"]
411+
PHI_D[/"φ_d"/]
412+
PHI[/"φ"/]
413+
P[/"p"/]
414+
ERR_PHI((+<br/>-))
415+
PID_PHI[PID<br/>Kp=25, Ki=1, Kd=8]
416+
TAU_ROLL["τ_φ"]
417+
418+
PHI_D --> ERR_PHI
419+
PHI --> ERR_PHI
420+
ERR_PHI --> PID_PHI
421+
P --> PID_PHI
422+
PID_PHI --> TAU_ROLL
423+
end
424+
425+
THRUST --> MIXER[Motor<br/>Mixer]
426+
TAU_ROLL --> MIXER
427+
428+
style AltitudeControl fill:#e3f2fd
429+
style AttitudeLoop fill:#f3e5f5
430+
```
431+
216432
### Attitude Control
217433

218434
The inner loop controls roll, pitch, and yaw using PID controllers:

0 commit comments

Comments
 (0)