예제 #1
0
midi_conn.connect("tcp://192.168.0.2:1250")

pid_viz_conn = context.socket(zmq.PUSH)
pid_viz_conn.connect("tcp://127.0.0.1:5123")

ctrl_conn = context.socket(zmq.PULL)
ctrl_conn.connect("tcp://127.0.0.1:5124")

yaw_sp = 0

#r_pid = PID_RP(name="roll", P=30, I=0, D=10, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
#p_pid = PID_RP(name="pitch", P=30, I=0, D=10, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
r_pid = PID_RP(name="roll",
               P=25,
               I=0.28,
               D=7,
               Integrator_max=5,
               Integrator_min=-5,
               set_point=0,
               zmq_connection=pid_viz_conn)
p_pid = PID_RP(name="pitch",
               P=25,
               I=0.28,
               D=7,
               Integrator_max=5,
               Integrator_min=-5,
               set_point=0,
               zmq_connection=pid_viz_conn)
y_pid = PID_RP(name="yaw",
               P=5,
               I=0,
               D=0.35,
예제 #2
0
#kinect_conn.connect("tcp://172.16.13.90:1213")

midi_conn = context.socket(zmq.PULL)
midi_conn.connect("tcp://192.168.0.2:1250")

pid_viz_conn = context.socket(zmq.PUSH)
pid_viz_conn.connect("tcp://127.0.0.1:5123")

ctrl_conn = context.socket(zmq.PULL)
ctrl_conn.connect("tcp://127.0.0.1:5124")

yaw_sp = 0

#r_pid = PID_RP(name="roll", P=30, I=0, D=10, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
#p_pid = PID_RP(name="pitch", P=30, I=0, D=10, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
r_pid = PID_RP(name="roll", P=25, I=0.28, D=7, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
p_pid = PID_RP(name="pitch", P=25, I=0.28, D=7, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
y_pid = PID_RP(name="yaw", P=5, I=0, D=0.35, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
#r_pid = PID_RP(P=0.1, D=0.3, I=0, Integrator_max=5, Integrator_min=-5, set_point=0)
#p_pid = PID_RP(P=0.1, D=0.3, I=0, Integrator_max=5, Integrator_min=-5, set_point=0)
t_pid = PID_RP(name="thrust", P=20, I=5*0.035, D=8*0.035, set_point=1.6, Integrator_max=0.01, Integrator_min=-0.01/0.035, zmq_connection=pid_viz_conn)
#y_pid = PID_RP(P=0.5, D=1.0, I=0.00025, set_point=300.0)

# Vertical position and velocity PID loops
# WORKING
v_pid = PID_RP(name="position", P=0.5, D=0.0, I=0.28, Integrator_max=100/0.035, Integrator_min=-100/0.035, set_point=1.6, zmq_connection=pid_viz_conn)
vv_pid = PID_RP(name="velocity", P=0.1, D=0.00315, I=0.28, Integrator_max=5/0.035, Integrator_min=-5/0.035, set_point=0, zmq_connection=pid_viz_conn)
#vv_pid = PID_RP(name="velocity", P=0.1, D=0.00315, I=0.28, Integrator_max=0.1/0.28, Integrator_min=-0.1/0.28, set_point=0, zmq_connection=pid_viz_conn)

#v_pid = PID_RP(name="position", P=0.2, D=0.0, I=0.01, Integrator_max=100, Integrator_min=-100, set_point=1.6, zmq_connection=pid_viz_conn)
#vv_pid = PID_RP(name="velocity", P=0.1, D=0.09, I=0.0, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
예제 #3
0
midi_conn = context.socket(zmq.PULL)
midi_conn.connect("tcp://192.168.0.2:1250")


pid_viz_conn = context.socket(zmq.PUSH)
pid_viz_conn.connect("tcp://127.0.0.1:5123")


ctrl_conn = context.socket(zmq.PULL)
ctrl_conn.connect("tcp://127.0.0.1:5124")

yaw_sp = 0

""" Roll, Pitch and Yaw PID controllers """
r_pid = PID_RP(name="roll", P=25, I=0.28, D=7, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
p_pid = PID_RP(name="pitch", P=25, I=0.28, D=7, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
y_pid = PID_RP(name="yaw", P=5, I=0, D=0.35, Integrator_max=5, Integrator_min=-5, set_point=0, zmq_connection=pid_viz_conn)
t_pid = PID_RP(name="thrust", P=10, I=5*0.035, D=8*0.035, set_point=.150, Integrator_max=0.01,
               Integrator_min=-0.01/0.035, zmq_connection=pid_viz_conn)


""" Vertical position and velocity PID loops """
v_pid = PID_RP(name="position", P=.5, D=0.0, I=0.28, Integrator_max=100/0.035, Integrator_min=-100/0.035, set_point= .150,
               zmq_connection=pid_viz_conn)
vv_pid = PID_RP(name="velocity", P=0.35, D=0.00315, I=0.28, Integrator_max=5/0.035, Integrator_min=-5/0.035,
                set_point=0, zmq_connection=pid_viz_conn)



f_x = 1000.0