コード例 #1
0
        if ptu_offset_mode == 2:
            #Command PTU to point at moon
            ptu.ephem_point(ep, imu=imu, target='moon', init=False)

    else:
        track_mode = default_track_mode
        filter_mode = default_filter_mode
        ptu_offset_mode = default_ptu_offset_mode

    #Initiate PID control loop
    pid_x = PID(
        step_size=params.ptu_step_size
    )  #'eighth'    #pid_x will control azimuth ptu motor (assuming orientation of ss is correct)
    pid_x.SetKp(kp_x)
    pid_x.SetKi(ki_x)
    pid_x.SetKd(kd_x)

    pid_y = PID(
        step_size=params.ptu_step_size
    )  #pid_y will control azimuth ptu motor (assuming orientation of ss is correct)
    pid_y.SetKp(kp_y)
    pid_y.SetKi(ki_y)
    pid_y.SetKd(kd_y)

    #Set ptu=None if not using tracking to ensure PTU is not moved after initial offset
    if track_mode == 4:
        ptu.ptu.close()
        ptu = None
        print('Not tracking, so disconnecting from the PTU for safe measure')

    queue_size = 1
コード例 #2
0
    track_mode = params.track_mode  #default: 4 = no tracking
    filter_mode = params.filter_mode  #default: 1 raw SS and IMU data
    ptu_offset_mode = params.ptu_offset_mode  #default: 0 no PTU offset prior to tracking

    #Show tracking display
    show_display = params.display
    print('show_display = ', show_display)

    #Initiate PID control loop
    #pan-axis (x-axis) PID gains
    pid_x = PID(
        step_size=params.ptu_step_size
    )  #'eighth'    #pid_x will control azimuth ptu motor (assuming orientation of ss is correct)
    pid_x.SetKp(params.kpx)  #0.44
    pid_x.SetKi(params.kix)  #0.05*0
    pid_x.SetKd(params.kdx)  #0.3

    #tilt-axis (y-axis) PID gains
    pid_y = PID(
        step_size=params.ptu_step_size
    )  #pid_y will control azimuth ptu motor (assuming orientation of ss is correct)
    pid_y.SetKp(params.kpy)  #-0.44
    pid_y.SetKi(params.kiy)  #0.01*0
    pid_y.SetKd(params.kdy)  #-0.3

    print('Pan axis (x-axis) PID gains kpx=', params.kpx, 'kix=', params.kix,
          'kdx=', params.kdx)
    print('Tilt axis (t-axis) PID gains kpy=', params.kpy, 'kiy=', params.kiy,
          'kdy=', params.kdy)

    #Define tracking/data collection parameters