예제 #1
0
def __main__():
    time = 0.01
    P = SimplePendulum(g = 9.82, b = 0.0, m = 1, l = 1, timestep = time, \
        init_angle = radians(20), init_angle_speed = 0.001, noise = np.array([[0], [0]]))

    C = SimplePendulumController(P, K_LQR = np.array([ [200, 30] ]),K_SU = 3000, \
         setpoint = np.array([[np.radians(180)], [0]]), \
	 outmax = 1, outmin = -1, SwingupLimit = radians(1))

    G = StatePlotter(timestep = time)
    Plotter = DrawPendulum(P, C, G, frameskip = 4)
    Plotter.startAnimation(speedup = 0.5)
    G.plotData("state.png", "phase.png")
예제 #2
0
def __main__():
    time = 0.01
    P = SimplePendulum(g = 9.82, b = 0.0, m = 1, l = 1, timestep = time, \
        init_angle = radians(20), init_angle_speed = 0.001, noise = np.array([[0], [0]]))

    C = SimplePendulumController(P, K_LQR = np.array([ [200, 30] ]),K_SU = 3000, \
         setpoint = np.array([[np.radians(180)], [0]]), \
  outmax = 1, outmin = -1, SwingupLimit = radians(1))

    G = StatePlotter(timestep=time)
    Plotter = DrawPendulum(P, C, G, frameskip=4)
    Plotter.startAnimation(speedup=0.5)
    G.plotData("state.png", "phase.png")
예제 #3
0
def __main__():
	P = SimplePendulum(g = -9.82, b = 1, m = 1, l = 1, timestep = .01, \
		init_angle = radians(5), init_angle_speed = 0)
	C = SimplePendulumController(P, outmax = 100, outmin = -100)
	Plotter = DrawPendulum(P, C)
	Plotter.startAnimation()
예제 #4
0
def __main__():
    P = SimplePendulum(g = -9.82, b = 1, m = 1, l = 1, timestep = .01, \
     init_angle = radians(5), init_angle_speed = 0)
    C = SimplePendulumController(P, outmax=100, outmin=-100)
    Plotter = DrawPendulum(P, C)
    Plotter.startAnimation()