[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Rotorcraft - starting motors

From: Cedric Marzer
Subject: Re: [Paparazzi-devel] Rotorcraft - starting motors
Date: Mon, 8 Oct 2012 22:42:38 +0200

OK, the problem was the yaw stick not reaching the extrema. It is working now.
My next step is to make my camera stabilization work. I guess I should look into the cam point module. Has anyone already achieve that ?

Le 8 oct. 2012 à 09:06, Cédric Marzer (MRSA) a écrit :

if you want to use arming via yaw stick, DON'T <define name="USE_KILL_SWITCH_FOR_MOTOR_ARMING"/>
(or did you have this commented out when trying to arm via yaw stick?)
Of course, I defined it as a workaround to be able to start the motors as the yaw stick way didn’t work…
You don't see any yaw in ROTORCRAFT_CMD, because yaw control is only enabled once you are in_flight.
So when is it exactly enabled ? Does that mean that one doesn’t have any control on the yaw axis while taking off ?
The speed of the motors also doesn’t change when I apply yaw (I mean when I am testing it without the props, so obviously when I am not flying).
Is that normal ? The stabilisation on the yaw axis does work : if I rotate the hexa the motor speed changes.
The only thing I can think of is that maybe you don't reach the thresholds for throttle down or full yaw.
Can you please check ROTORCRAFT_RADIO_CONTROL if you really get zero for throttle down and +-MAX_PPRZ (9600) for full yaw.
If not the best thing is to set the min/max values in your radio file correctly.
Well that could be the problem. I will check carefully the values I get from the messages and compare it with the radio file.
Thank you for your help.
On Sun, Oct 7, 2012 at 10:06 PM, Cedric Marzer <address@hidden> wrote:
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 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 name="actuators"     type="pwm_supervision">
               <define name="SERVO_HZ" value="400"/>
               <define name="SERVO_HZ_SECONDARY" value="40"/>
               <define name="USE_SERVOS_7AND8"/>

           <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"/>
    <servos min="0" neutral="0" max="0xff">
   <servo name="FRONT_RIGHT"   no="0" min="1000" neutral="1000"
   <servo name="FRONT_LEFT"  no="1" min="1000" neutral="1000"
   <servo name="LEFT"        no="2" min="1000" neutral="1000"
   <servo name="BACK_LEFT"   no="3" min="1000" neutral="1000"
   <servo name="BACK_RIGHT"    no="4" min="1000" neutral="1000"
   <servo name="RIGHT"         no="5" min="1000" neutral="1000"
   <servo name="CAM_TILT"         no="6" min="1000" neutral="1500"
   <servo name="CAM_ROLL"         no="7" min="1000" neutral="1500"
       <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"/-->
   <set command="CAM_PAN" value="@CAM_PAN"/>
   <set command="CAM_TILT" value="@CAM_TILT"/>
       <!-- 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"/>
   <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,
   <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 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 name="INS" prefix="INS_">
       <define name="BARO_SENS" value="3.3" integer="16"/>
       <!-- 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"/>
       <!-- 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 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 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 name="SIMULATOR" prefix="NPS_">
       <define name="ACTUATOR_NAMES"  value="{&quot;front_motor&quot;,
&quot;back_motor&quot;, &quot;right_motor&quot;,
       <define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
       <define name="SENSORS_PARAMS"
   <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 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"/>
   <modules main_freq="512">
       <load name="gps_ubx_ucenter.xml"/>
Le 4 oct. 2012 à 22:58, Felix Ruess a écrit :

Hi Cedric,
you shouldn't need to use the GCS. If you didn't configure a different mode explicitly, you should be able to arm/disarm the motors via yaw stick (at zero throttle).
But you need to be in one of the normal flying modes (not KILL or FAILSAFE) and the AHRS needs to be aligned (in default configuration the AHRS led stops blinking if it's aligned).
Usage of a KILL switch is independent of the arming mode. (But if you have a KILL_SWITCH defined make sure it is not in the kill position when trying to arm the motors).
If it is not behaving as you would expect, can you please provide your configuration so we can either figure out what is not working as it should, or where we need to clarify the docs....

Cheers, Felix

On Thu, Oct 4, 2012 at 10:42 PM, Cedric Marzer <address@hidden> wrote:
I tried to start the motors without the GCS but without success so far.
To make them start I need to push the resurrect button on the GCS and then switch the kill switch.
I'd love not to use any kill switch because of the risk of switching it by accident. I prefer the full yaw mode, but it didn't work so far. When I look at the messages I can see that the cmd_yaw doesn't change when I move the sticks but the yaw does.
I also need to be able to start the motors without hitting the resurrect button in the GCS.
Could you please give me more details about the lines I need to add to my airframe and flight plan files ?
Thanks a lot

Paparazzi-devel mailing list

Paparazzi-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]