|
From: | Cedric Marzer |
Subject: | Re: [Paparazzi-devel] Rotorcraft - starting motors |
Date: | Sun, 7 Oct 2012 22:06:01 +0200 |
Hello, I think my problem is that the autopilot doesn't read my yaw stick correctly. When I print the messages, the value of yaw changes in the ROTORCRAFT_RADIO_CONTROL message but it doesn't change in the ROTORCRAFT_CMD message ! That would explain why I can't start with the yaw and throttle procedure. When I start the motor for instance with the kill switch method, the regime of the motor doesn't change if I move the yaw stick. I think there might be a problem with the ppm rx + supervision mode or maybe I didn't setup correctly the command laws…Do I have to define an <rc_command> section ? Here is my airframe file : <airframe name="mzrhexa"> <firmware name="rotorcraft"> <target name="sim" board="pc"> <subsystem name="fdm" type="nps"/> </target> <target name="ap" board="lisa_m_2.0"/> <!--define name="GUIDANCE_H_USE_REF"/--> <!--define name="USE_THROTTLE_FOR_MOTOR_ARMING"/--> <define name="USE_KILL_SWITCH_FOR_MOTOR_ARMING"/> <define name="RADIO_KILL_SWITCH" value="KILL_SWITCH"/> <subsystem name="radio_control" type="ppm"/> <subsystem name="telemetry" type="transparent"> <configure name="MODEM_BAUD" value="B57600"/> <configure name="MODEM_PORT" value="UART2"/> </subsystem> <subsystem name="actuators" type="pwm_supervision"> <define name="SERVO_HZ" value="400"/> <define name="SERVO_HZ_SECONDARY" value="40"/> <define name="USE_SERVOS_7AND8"/> </subsystem> <subsystem name="imu" type="aspirin_v2.1"/> <subsystem name="gps" type="ublox"/> <subsystem name="ahrs" type="int_cmpl_quat"/> <subsystem name="stabilization" type="int_quat"/> <configure name="AHRS_PROPAGATE_FREQUENCY" value="500"/> </firmware> <servos min="0" neutral="0" max="0xff"> <servo name="FRONT_RIGHT" no="0" min="1000" neutral="1000" max="2000"/> <servo name="FRONT_LEFT" no="1" min="1000" neutral="1000" max="2000"/> <servo name="LEFT" no="2" min="1000" neutral="1000" max="2000"/> <servo name="BACK_LEFT" no="3" min="1000" neutral="1000" max="2000"/> <servo name="BACK_RIGHT" no="4" min="1000" neutral="1000" max="2000"/> <servo name="RIGHT" no="5" min="1000" neutral="1000" max="2000"/> <servo name="CAM_TILT" no="6" min="1000" neutral="1500" max="2000"/> <servo name="CAM_ROLL" no="7" min="1000" neutral="1500" max="2000"/> </servos> <commands> <axis name="PITCH" failsafe_value="0"/> <axis name="ROLL" failsafe_value="0"/> <axis name="YAW" failsafe_value="0"/> <axis name="THRUST" failsafe_value="0"/> <!--axis name="CAM_TILT" failsafe_value="0"/--> <!--axis name="CAM_PAN" failsafe_value="0"/--> </commands> <!--rc_commands> <set command="CAM_PAN" value="@CAM_PAN"/> <set command="CAM_TILT" value="@CAM_TILT"/> </rc_commands--> <command_laws> <!-- command_laws is needed for pwm_supervision --> <!-- but can be empty if no additional servos are used --> <!--set servo="FRONT_RIGHT" value="0"/> <set servo="FRONT_LEFT" value="1"/> <set servo="LEFT" value="2"/> <set servo="BACK_LEFT" value="3"/> <set servo="BACK_RIGHT" value="4"/> <set servo="RIGHT" value="5"/--> <set servo="CAM_TILT" value="1500"/> <set servo="CAM_ROLL" value="1500"/> </command_laws> <section name="SUPERVISION" prefix="SUPERVISION_"> <define name="STOP_MOTOR" value="900"/> <define name="MIN_MOTOR" value="1200" /> <define name="MAX_MOTOR" value="2100" /> <define name="TRIM_A" value="0" /> <define name="TRIM_E" value="0" /> <define name="TRIM_R" value="0" /> <define name="NB_MOTOR" value="6" /> <define name="SCALE" value="256"/> <define name="ROLL_COEF" value="{ -128, 128, 256, 128, -128, -256}" /> <define name="PITCH_COEF" value="{ 256, 256, 0, -256, -256, 0}" /> <define name="YAW_COEF" value="{ 256, -256, 256, -256, 256, -256}" /> <define name="THRUST_COEF" value="{ 256, 256, 256, 256, 256, 256}"/> </section> <section name="IMU" prefix="IMU_"> <define name="ACCEL_X_NEUTRAL" value="11"/> <define name="ACCEL_Y_NEUTRAL" value="11"/> <define name="ACCEL_Z_NEUTRAL" value="-25"/> <!-- replace this with your own calibration --> <define name="MAG_X_NEUTRAL" value="-152"/> <define name="MAG_Y_NEUTRAL" value="-51"/> <define name="MAG_Z_NEUTRAL" value="10"/> <define name="MAG_X_SENS" value="4.04042714046" integer="16"/> <define name="MAG_Y_SENS" value="3.95350991963" integer="16"/> <define name="MAG_Z_SENS" value="3.83055079257" integer="16"/> <define name="BODY_TO_IMU_PHI" value="0." unit="deg"/> <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/> <define name="BODY_TO_IMU_PSI" value="0." unit="deg"/> </section> <section name="AHRS" prefix="AHRS_"> <define name="H_X" value="0.3770441"/> <define name="H_Y" value="0.0193986"/> <define name="H_Z" value="0.9259921"/> </section> <section name="INS" prefix="INS_"> <define name="BARO_SENS" value="3.3" integer="16"/> </section> <section name="STABILIZATION_RATE" prefix="STABILIZATION_RATE_"> <!-- setpoints --> <define name="SP_MAX_P" value="10000"/> <define name="SP_MAX_Q" value="10000"/> <define name="SP_MAX_R" value="10000"/> <define name="DEADBAND_P" value="20"/> <define name="DEADBAND_Q" value="20"/> <define name="DEADBAND_R" value="200"/> <define name="REF_TAU" value="4"/> <!-- feedback --> <define name="GAIN_P" value="400"/> <define name="GAIN_Q" value="400"/> <define name="GAIN_R" value="350"/> <define name="IGAIN_P" value="75"/> <define name="IGAIN_Q" value="75"/> <define name="IGAIN_R" value="50"/> <!-- feedforward --> <define name="DDGAIN_P" value="300"/> <define name="DDGAIN_Q" value="300"/> <define name="DDGAIN_R" value="300"/> </section> <section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_"> <!-- setpoints --> <define name="SP_MAX_PHI" value="45." unit="deg"/> <define name="SP_MAX_THETA" value="45." unit="deg"/> <define name="SP_MAX_R" value="90." unit="deg/s"/> <define name="DEADBAND_A" value="0"/> <define name="DEADBAND_E" value="0"/> <define name="DEADBAND_R" value="250"/> <!-- reference --> <define name="REF_OMEGA_P" value="800" unit="deg/s"/> <define name="REF_ZETA_P" value="0.85"/> <define name="REF_MAX_P" value="400." unit="deg/s"/> <define name="REF_MAX_PDOT" value="RadOfDeg(8000.)"/> <define name="REF_OMEGA_Q" value="800" unit="deg/s"/> <define name="REF_ZETA_Q" value="0.85"/> <define name="REF_MAX_Q" value="400." unit="deg/s"/> <define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/> <define name="REF_OMEGA_R" value="500" unit="deg/s"/> <define name="REF_ZETA_R" value="0.85"/> <define name="REF_MAX_R" value="180." unit="deg/s"/> <define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/> <!-- feedback --> <define name="PHI_PGAIN" value="1000"/> <define name="PHI_DGAIN" value="400"/> <define name="PHI_IGAIN" value="200"/> <define name="THETA_PGAIN" value="1000"/> <define name="THETA_DGAIN" value="400"/> <define name="THETA_IGAIN" value="200"/> <define name="PSI_PGAIN" value="500"/> <define name="PSI_DGAIN" value="300"/> <define name="PSI_IGAIN" value="10"/> <!-- feedforward --> <define name="PHI_DDGAIN" value="300"/> <define name="THETA_DDGAIN" value="300"/> <define name="PSI_DDGAIN" value="300"/> </section> <section name="GUIDANCE_V" prefix="GUIDANCE_V_"> <define name="MIN_ERR_Z" value="POS_BFP_OF_REAL(-10.)"/> <define name="MAX_ERR_Z" value="POS_BFP_OF_REAL( 10.)"/> <define name="MIN_ERR_ZD" value="SPEED_BFP_OF_REAL(-10.)"/> <define name="MAX_ERR_ZD" value="SPEED_BFP_OF_REAL( 10.)"/> <define name="MAX_SUM_ERR" value="2000000"/> <define name="HOVER_KP" value="150"/> <define name="HOVER_KD" value="80"/> <define name="HOVER_KI" value="20"/> <!-- 1.5m/s for full stick : BOOZ_SPEED_I_OF_F(1.5) / (MAX_PPRZ/2) --> <define name="RC_CLIMB_COEF" value ="163"/> <!-- BOOZ_SPEED_I_OF_F(1.5) * 20% --> <define name="RC_CLIMB_DEAD_BAND" value ="160000"/> <!-- NOMINAL_HOVER_THROTTLE sets a fixed value instead of the adaptive estimation --> <!--define name="NOMINAL_HOVER_THROTTLE" value="0.5"/--> </section> <section name="GUIDANCE_H" prefix="GUIDANCE_H_"> <define name="MAX_BANK" value="20" unit="deg"/> <define name="PGAIN" value="100"/> <define name="DGAIN" value="100"/> <define name="IGAIN" value="0"/> </section> <section name="SIMULATOR" prefix="NPS_"> <define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/> <define name="INITIAL_CONDITITONS" value=""reset00""/> <define name="SENSORS_PARAMS" value=""nps_sensors_params_default.h""/> </section> <section name="AUTOPILOT"> <define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/> <define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_Z_HOLD"/> <define name="MODE_AUTO2" value="AP_MODE_HOVER_Z_HOLD"/> </section> <section name="BAT"> <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/> <define name="CRITIC_BAT_LEVEL" value="9.6" unit="V"/> <define name="LOW_BAT_LEVEL" value="9.7" unit="V"/> <define name="MAX_BAT_LEVEL" value="12.6" unit="V"/> </section> <modules main_freq="512"> <load name="gps_ubx_ucenter.xml"/> </modules> </airframe> Le 4 oct. 2012 à 22:58, Felix Ruess a écrit : Hi Cedric, |
[Prev in Thread] | Current Thread | [Next in Thread] |