合肥生活安徽新闻合肥交通合肥房产生活服务合肥教育合肥招聘合肥旅游文化艺术合肥美食合肥地图合肥社保合肥医院企业服务合肥法律

代写MEC 302、代做python编程设计
代写MEC 302、代做python编程设计

时间:2025-04-10  来源:合肥网hfw.cc  作者:hfw.cc 我要纠错



MEC 302: Embedded Computer Systems
Tutorial
Week 6 - SS 2024/2025
1 Cartpole System Analysis
The cartpole system (Fig. 1) consists of a cart of mass M moving along a frictionless track, and a
pendulum of mass m and length l pivoting around the cart. The mass of the pendulum is assumed
to be equally distributed along the rigid rod. The system is actuated by a horizontal force F applied
to the cart.
Figure 1: Cart-pole as the combination of a cart and a pendulum.
1.1 Tasks
1. Draw the free-body diagram of the pendulum and cart, showing all forces acting on them.
Note: Point the reaction force Fx as the coupling force between the pendulum and the cart in
positive x-direction in the free-body diagram of the pendulum.
2. Formulate Newton’s second law for the horizontal motion of the cart. The motion of the
pendulum is described by

¨ = mglsin θ − ml(lθ
¨− x¨ cos θ) (1)
Fx =m(¨x − lθ
¨cos θ + lθ
˙2
sin θ) (2)
3. Derive the state-space representation of the linearized system around the equilibrium θ = 0
A1q˙ = A2q + Bu (3)
Define q, u, A1, A2 and B. Use the fact that for small deviations from θ = 0, the following
relations hold
sin(θ) ≈ θ (4)
cos(θ) ≈ 1 (5)
θ
˙2 ≈ 0 (6)
4. Analyze BIBO stability of the equilibrium point by using the Eigenvalues λ of the system
matrix A of the linearized system. Assume A = A
Use the fact that
det(A − λI) = 0 (8)
5. The non-linear system can be controlled via the feed-back Linear-Quadratic-Regulator (LQR)
u = −Ke (9)
K is the LQR gain obtained by solving the so-called Riccati-equation. e is a linear error
feed-back
e = q − qd (10)
qd is the desired state. Initially, the cart-pole is standing still (zero velocity) with x = 10
m and θ = θ0 = 0. Complete the code given in cart_pole_LQR.py in order to achieve the
following tasks:
❼ Use the LQR controller (9) to move the cart-pole to x = −10 m and θ = 0 [rad] (zero
velocity). Show the plots of q and u.
❼ How does θ0 need to be chosen? How can restrictions on θ0 be avoided?
The python code can be run for example by jupyter (File → New → Notebook):
2 Line-Following Robot
Consider a robot which is equipped with two photo-sensors on its left and right side (see Fig. 2).
The sensors return True if they detect black color, and False otherwise. The robot is able to turn
left and right on command with turning angle α. The robot is asked to follow a black line (see Fig.
2) at constant speed. If both sensors return False, the robot goes straight until a time-out tto is
reached, at which point the robot stops.
Figure 2: Line-following robot with two sensors aligned in parallel. They return True if they detect
black color, and otherwise False.
2.1 Tasks
1. Is a finite-state-machine (FSM) or an extended-state-machine (ESM) more appropriate for this
task? Justify.
2. Which
❼ variables
❼ inputs
❼ outputs
❼ states
are there? For each variable, input, and output, say which type they are.
3. Design an FSM for the line-following robot.
2

请加QQ:99515681  邮箱:99515681@qq.com   WX:codinghelp

扫一扫在手机打开当前页
  • 上一篇:DTS101TC代做、代写Python语言程序
  • 下一篇:AM11编程代做、代写Python编程语言
  • 无相关信息
    合肥生活资讯

    合肥图文信息
    出评 开团工具
    出评 开团工具
    挖掘机滤芯提升发动机性能
    挖掘机滤芯提升发动机性能
    戴纳斯帝壁挂炉全国售后服务电话24小时官网400(全国服务热线)
    戴纳斯帝壁挂炉全国售后服务电话24小时官网
    菲斯曼壁挂炉全国统一400售后维修服务电话24小时服务热线
    菲斯曼壁挂炉全国统一400售后维修服务电话2
    美的热水器售后服务技术咨询电话全国24小时客服热线
    美的热水器售后服务技术咨询电话全国24小时
    海信罗马假日洗衣机亮相AWE  复古美学与现代科技完美结合
    海信罗马假日洗衣机亮相AWE 复古美学与现代
    合肥机场巴士4号线
    合肥机场巴士4号线
    合肥机场巴士3号线
    合肥机场巴士3号线
  • 短信验证码 酒店vi设计