paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Tiny v2.11 - Programming help required


From: David Buzz Carlson
Subject: Re: [Paparazzi-devel] Tiny v2.11 - Programming help required
Date: Sat, 06 Sep 2008 15:17:05 +0300
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

Ben Paratz wrote:
Just one more thing, I powered up the Tiny for about a minute, and a few components on the GPS antenna side of the board got too hot to touch. Is this normal? I am powering the board with a 2-Cell 7.4v Li-Po connected to the "+ and -" battery input in the centre of the board. Plugged in are two servos, IR sensors, and a serial cable which is connected to the airborne modem. I am powering the airborne modem with +5VDC from the Tiny, and I have also connected the +5VDC to the shutdown pin as per the wiki.
I don't know the deal behind the +5V shutdown pin, but I do know I almost always had that problem when I had shorted the servo wires from VCC to ground. Check your connections and remove all unnecessary ones.

/"I have same problem of using wireless link, but what I do suggest is that can you confrim your autopilot has no problem by connecting to your wire to laptop
(FTDI cable, the one you use for bootloader).

If you have done that, and find when your autopilot has no problem, then you are in the same stage as me (which mean I am still try to configure my Xbee
modem)."/
I would like to do that, but don't have an FTDI cable. The maxstream modem plugs straight into the usb port, so i guess it is built into it. I bought my Tiny off PPZUAV so didn't have to do the bootloader myself.

First step is to make sure that you have your modems configured correctly. They must be on the same RF baud, have the correct dest and source address and be set to use API mode or not.
Does the aircraft have to be powered up for the GCS to load? I haven't seen any instructions about how to actually start the GCS.

Yes.
Thanks,
Ben

On Sat, Sep 6, 2008 at 7:44 AM, Ben Paratz <address@hidden <mailto:address@hidden>> wrote:

    Hi Guys,
Thanks very much for all your help, I've had much more success
    thanks to it.
    I spent all of today playing with paparazzi, and this is what I have:
    - The airframe file is successfully compiling, and has been
    uploaded to the autopilot. I had to create another airframe file,
    as the one I posted first caused the autopilot to do nothing. I
    found out that this is likely because the program was for an
    earlier version of the Tiny. I have based the new aiframe file on
    funjet1.xml
    - The servos (through the autopilot) respond correctly to my JR
    transmitter. I used a JR R700, but modified it as per the link
    earlier in the thread.

    The flight plan I have uploaded is "Muret demo"

    The only thing now is that the GCS is not populating. It loaded
    fully once, after I ran a simulation, but I cannot get it to do it
    again. When I execute a session the GCS window pops up, but
    remains blank... I have tried using both "Flight address@hidden"
    and "Flight address@hidden" but neither seems to help the GCS
    load. I think the defult baud rate for the Maxstream modem is 9600

    When I plug in the modem this what I get:

    tail -f /var/log/messages
    Sep  5 09:14:16 ben-laptop kernel: [ 1461.018531] usb 1-1: new
    full speed USB device using uhci_hcd and address 4
    Sep  5 09:14:16 ben-laptop kernel: [ 1461.040458] usb 1-1:
    configuration #1 chosen from 1 choice
    Sep  5 09:14:16 ben-laptop kernel: [ 1461.046091] ftdi_sio
    1-1:1.0: FTDI USB Serial Device converter detected
    Sep  5 09:14:16 ben-laptop kernel: [ 1461.046149]
    /build/buildd/linux-2.6.24/drivers/usb/serial/ftdi_sio.c: Detected
    FT232BM
    Sep  5 09:14:16 ben-laptop kernel: [ 1461.046277] usb 1-1: FTDI
    USB Serial Device converter now attached to ttyUSB0

    Do you have any ideas how to get the GCS to load? I have attached
    the new airframe code below. Let me know if you need me to post
    any more files.

    Thanks,
    Ben


    <!DOCTYPE airframe SYSTEM "airframe.dtd">

    <!-- Funjet Multiplex (http://www.multiplex-rc.de/)
         Tiny 2.1 board (http://paparazzi.enac.fr/wiki/index.php/Tiny_v2)
         Tilted infrared sensor
    (http://paparazzi.enac.fr/wiki/index.php/Image:Tiny_v2_1_Funjet.jpg)
         Radiotronix modem
    -->

    <airframe name="Easystar Tiny 2.1">

    <!-- commands section -->
      <servos>
        <servo name="THROTTLE" no="2" min="1000" neutral="1500"
    max="2000"/>
        <servo name="ROLL"  no="3" min="1000" neutral="1500" max="2000"/>
        <servo name="PITCH" no="4" min="1000" neutral="1500" max="2000"/>

      </servos>

      <commands>
        <axis name="THROTTLE" failsafe_value="0"/>
        <axis name="ROLL"     failsafe_value="0"/>

        <axis name="PITCH"    failsafe_value="0"/>
      </commands>

      <rc_commands>
        <set command="THROTTLE" value="@THROTTLE"/>
        <set command="ROLL"     value="@ROLL"/>
        <set command="PITCH"    value="@PITCH"/>
      </rc_commands>

      <command_laws>
        <set servo="THROTTLE" value="@THROTTLE"/>
        <set servo="ROLL"  value="@ROLL"/>
        <set servo="PITCH" value="@PITCH"/>

      </command_laws>

      <section name="AUTO1" prefix="AUTO1_">
        <define name="MAX_ROLL" value="0.3"/>
        <define name="MAX_PITCH" value="0.3"/>

      </section>

      <section name="adc" prefix="ADC_CHANNEL_">
        <define name="IR1" value="ADC_1"/>
        <define name="IR2" value="ADC_2"/>
        <define name="IR_TOP" value="ADC_0"/>
        <define name="IR_NB_SAMPLES" value="16"/>

      </section>

      <section name="INFRARED" prefix="IR_">
        <define name="ADC_IR1_NEUTRAL" value="512"/>
        <define name="ADC_IR2_NEUTRAL" value="512"/>
        <define name="ADC_TOP_NEUTRAL" value="512"/>

        <define name="LATERAL_CORRECTION" value="1."/>
        <define name="LONGITUDINAL_CORRECTION" value="1."/>
        <define name="VERTICAL_CORRECTION" value="1.5"/>


        <define name="HORIZ_SENSOR_TILTED" value="1"/>
        <define name="IR2_SIGN" value="-1"/>
        <define name="TOP_SIGN" value="-1"/>

        <define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
        <define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>

        <define name="CORRECTION_UP" value="1."/>
        <define name="CORRECTION_DOWN" value="1."/>
        <define name="CORRECTION_LEFT" value="1."/>
        <define name="CORRECTION_RIGHT" value="1."/>
      </section>

      <section name="BAT">
        <define name="MILLIAMP_PER_PERCENT" value="0.86"/>

        <define name="CATASTROPHIC_BAT_LEVEL" value="5.5" unit="V"/>
      </section>
<section name="MISC">
        <define name="NOMINAL_AIRSPEED" value="7" unit="m/s"/>
        <define name="CARROT" value="5." unit="s"/>
        <define name="KILL_MODE_DISTANCE"
    value="(1.5*MAX_DIST_FROM_HOME)"/>
        <define name="CONTROL_RATE" value="60" unit="Hz"/>
    <!--    <define name="XBEE_INIT"
    value="\"ATPL2\rATRN1\rATTT80\r\""/> -->
    <!--    <define name="NO_XBEE_API_INIT" value="TRUE"/> -->
        <define name="ALT_KALMAN_ENABLED" value="TRUE"/>

        <define name="TRIGGER_DELAY" value="1."/>
        <define name="DEFAULT_CIRCLE_RADIUS" value="80."/>
        <define name="MIN_CIRCLE_RADIUS" value="35."/>

      </section>
<section name="VERTICAL CONTROL" prefix="V_CTL_">

        <define name="POWER_CTL_BAT_NOMINAL" value="7.2" unit="volt"/>
        <!-- outer loop proportional gain -->
        <define name="ALTITUDE_PGAIN" value="-0.04"/>

        <!-- outer loop saturation -->
        <define name="ALTITUDE_MAX_CLIMB" value="2."/>

        <!-- auto throttle inner loop -->
        <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE"
    value="0.35"/>
        <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.3"/>

        <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.80"/>
        <define name="AUTO_THROTTLE_LOITER_TRIM" value="1500"/>
        <define name="AUTO_THROTTLE_DASH_TRIM" value="-1000"/>
        <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT"
    value="0.1" unit="%/(m/s)"/>
        <define name="AUTO_THROTTLE_PGAIN" value="-0.02"/>

        <define name="AUTO_THROTTLE_IGAIN" value="0.1"/>
        <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.1"/>


        <!-- auto pitch inner loop -->
        <define name="AUTO_PITCH_PGAIN" value="-0.05"/>
        <define name="AUTO_PITCH_IGAIN" value="0.075"/>
        <define name="AUTO_PITCH_MAX_PITCH" value="0.35"/>
        <define name="AUTO_PITCH_MIN_PITCH" value="-0.35"/>

       <define name="THROTTLE_SLEW" value="2.0"/>


      </section>

      <section name="HORIZONTAL CONTROL" prefix="H_CTL_">
        <define name="COURSE_PGAIN" value="-1.2"/>

        <define name="ROLL_MAX_SETPOINT" value="0.7" unit="radians"/>

        <define name="PITCH_MAX_SETPOINT" value="0.5" unit="radians"/>
        <define name="PITCH_MIN_SETPOINT" value="-0.5" unit="radians"/>

        <define name="PITCH_PGAIN" value="-10000."/>
        <define name="PITCH_DGAIN" value="1.5"/>

        <define name="ELEVATOR_OF_ROLL" value="0"/>

        <define name="ROLL_ATTITUDE_GAIN" value="-7500"/>
        <define name="ROLL_RATE_GAIN" value="-1500"/>
      </section>

      <section name="NAV">
        <define name="NAV_PITCH" value="0."/>
        <define name="NAV_GLIDE_PITCH_TRIM" value="0.1"/>

      </section>

      <section name="AGGRESSIVE" prefix="AGR_">
        <define name="BLEND_START" value="20"/><!-- Altitude Error to
    Initiate Aggressive Climb CANNOT BE ZERO!!-->
        <define name="BLEND_END" value="10"/><!-- Altitude Error to
    Blend Aggressive to Regular Climb Modes  CANNOT BE ZERO!!-->
        <define name="CLIMB_THROTTLE" value="1.0"/><!-- Gaz for
    Aggressive Climb -->
        <define name="CLIMB_PITCH" value="0.25"/><!-- Pitch for
    Aggressive Climb -->
        <define name="DESCENT_THROTTLE" value="0.1"/><!-- Gaz for
    Aggressive Decent -->
        <define name="DESCENT_PITCH" value="-0.15"/><!-- Pitch for
    Aggressive Decent -->

        <define name="CLIMB_NAV_RATIO" value="0.8"/><!-- Percent
    Navigation for Altitude Error Equal to Start Altitude -->
        <define name="DESCENT_NAV_RATIO" value="1.0"/>
        </section>

      <section name="FAILSAFE" prefix="FAILSAFE_">
        <define name="DELAY_WITHOUT_GPS" value="2" unit="s"/>
            <define name="DEFAULT_THROTTLE" value="0.0" unit="%"/>

            <define name="DEFAULT_ROLL" value="0.3" unit="rad"/>
            <define name="DEFAULT_PITCH" value="0.3" unit="rad"/>

        <define name="HOME_RADIUS" value="100" unit="m"/>
    </section>
<!--
     <section name="DATALINK" prefix="DATALINK_">
        <define name="DEVICE_TYPE" value="XBEE"/>

        <define name="DEVICE_ADDRESS" value="...."/>
      </section>
    -->

     <section name="SIMU">
        <define name="YAW_RESPONSE_FACTOR" value="0.5"/>
     </section>

     <makefile>
    CONFIG = \"tiny_2_1.h\"


    include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile

    FLASH_MODE=IAP

    ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DTIME_LED=1

    ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c
    $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c

    ap.srcs += commands.c

    ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017
    ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c


    ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_JR
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
    #XBEE ap.CFLAGS += -DDOWNLINK -DUSE_UART1
    -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1
    -DDATALINK=XBEE -DUART1_BAUD=B9600
    #XBEE ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c

    #TRANSPARENT
    ap.CFLAGS += -DDOWNLINK -DUSE_UART1
    -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1
    -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ
    -DUART1_BAUD=B9600

    ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c
    pprz_transport.c


    ap.CFLAGS += -DINTER_MCU
    ap.srcs += inter_mcu.c

    ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3

    ap.srcs += $(SRC_ARCH)/adc_hw.c

    ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0
    -DUART0_BAUD=B38400
    # -DGPS_LED=2
    ap.srcs += gps_ubx.c gps.c latlong.c

    ap.CFLAGS += -DINFRARED -DALT_KALMAN

    ap.srcs += infrared.c estimator.c

    ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM

    ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c

    # Config for SITL simulation
    include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
    sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM
    -DALT_KALMAN

    # a test program to setup actuators
    setup_actuators.ARCHDIR = $(ARCHI)
    setup_actuators.ARCH = arm7tdmi
    setup_actuators.TARGET = setup_actuators
    setup_actuators.TARGETDIR = setup_actuators

    setup_actuators.CFLAGS += -DFBW -DCONFIG=\"tiny.h\" -DLED
    -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015
    -DUSE_UART1 -DUART1_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart1
    setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c
    $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c
    $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c

      </makefile>
    </airframe>

    On Sat, Sep 6, 2008 at 7:47 PM, David Buzz Carlson
    <address@hidden <mailto:address@hidden>> wrote:

        Looking through his airframe file, it seems he is using ADC_6
        for his vertical IR sensor.  However,
        http://paparazzi.enac.fr/wiki/index.php/Tiny_v2  would have me
        believe that IRV is ADC_0.  I believe ADC_0 is the correct
        one, can anybody confirm that for me?

        Buzz

        address@hidden <mailto:address@hidden> wrote:

            Ben

            I believe the maxstream packages use an FTDI USB-to-serial
            converter chip (everything in linux is chip-specific).
             The FTDI driver is already present and functional in
            Ubuntu so you may be all set.  Type "dmesg | tail" after
            plugging in the modem and look for something about ftdi on
ttyusb0 or such. The ground modem can be any baud you want. Maxtream and
            some others allow independent configuration of the RF baud
            and serial port baud to allow the air and ground serial
            baud rates to be unequal so long as the RF rates are
            equal.  Make sure your ap and airborne modem are at the
            same baud (-DUART0_BAUD=B9600 in your case) and same for
            the gcs (link line should have "-s 9600" or such to match
            the ground modem) and make sure your modems are each
            configured for their appropriate baud rates as well (maybe
            9600 is the default?).

            The RC modes are set in conf/radios/*.xml but I don't know
            how those settings get mapped to channels 1 thru 8.  I
            usually use the transmitter programming to change the
            channel of my switch until I find the one that works.

            Your airframe file looks ok but I should point out that
            the GPS failsafe values on many of the cvs airframes are
            strange, specifying 30% throttle, 30 degree pitch up, and
            17 degree roll in the event of a total loss of GPS
            position info.  It sounds to me more like a wild spin,
            throttle-on crash and lipo fire.  I advise something more
            like 0 throttle, 10 deg up and 17 roll or whatever
            produces a gentle circling glide on your airframe.  I
            think these pitch/roll values are used in "kill" mode as
            well so you can test them in the air.
            ____________________________________________________________
            Fashion Design Education - Click Here!
            
http://thirdpartyoffers.juno.com/TGL2141/fc/Ioyw6i3oIaxayhf6v0qyKFdfvXplzTMUHQ82EF1TvuOwIQPzEsrgkl/

            
------------------------------------------------------------------------



            Hi,

            I have a Tiny v2.11 autopilot with all the hardware needed
            for autonomous flight. I have started on the programming,
            but have run into a few difficulties.

            I have installed all the hardware in my aircraft, but have
            not gotten any further than that succesfully. I am meant
            to be demonstrating autonomous flight a week from now, so
            it would be really great if I could get the autopilot
            fully working by then.

            I am new to Linux, and have run into some problems
            regarding the programming. It would be extremely helpful
            if you could provide some assistance. I am using Ubuntu
            8.04.1 - Hardy Heron

            I have been studying the Wiki and following it very closely.

            This is what I need help with:

            - Installing the drivers for the radio modem (the
            ground-station modem. It plugs into the USB port and grabs
            the serial signals. I'm sure you know all about this...
            The readme file that came with it says that I need to
            compile the driver into a 'Loadable Kernel Module' but I
            am unsure how to do this. The modem I am using is a Digi
            (Maxstream) 9XTend operating on 900MHz. I have been told
            that I may not need to install the driver, but can you
            please advise me on what to do.

            - Configuring the rc radio settings: I am using a
            6-channel JR Radio. I have found (using a scope) that my
            JR R700 7-channel receiver outputs the ppm signal through
            the 'signal' pin in the battery connector. I can attach a
            picture of the signal if you want. Also, how do you choose
            which channel determines the mode? (Auto 1, Auto 2, Manual).

            - Configuring the airframe file: I have had a go at making
            my own airframe file (following the wiki), but are not
            sure if it is correct. I have pasted the code at the
            bottom. My airframe is very simple: A 3-Channel Easystar.
            It also hope to be able to trigger a servo for controlling
            the shutter on a camera at a set position, but I will keep
            it simple and focus on achieving autonomous flight first.


            It would really be great if you could help me get this
            working within the next week.

            Thankyou very much,

            Ben


            Here is my airframe code:

            <!DOCTYPE airframe SYSTEM "airframe.dtd">

            <airframe name="EASYSTAR">
             <!-- tiny v2.11 airframe -->

            <!-- commands section -->
             <servos>
               <servo name="THROTTLE"  no="0" min="1000"
            neutral="1500" max="2000"/>
               <servo name="RUDDER"  no="2" min="1000" neutral="1500"
            max="2000"/>
               <servo name="ELEVATOR" no="6" min="1000" neutral="1500"
            min="2000"/>
             </servos>

             <commands>
               <axis name="THROTTLE" failsafe_value="0"/>
               <axis name="YAW"     failsafe_value="0"/>
               <axis name="PITCH"    failsafe_value="0"/>
             </commands>

             <rc_commands>
               <set command="THROTTLE" value="@THROTTLE"/>
               <set command="ROLL"     value="@ROLL"/>
               <set command="PITCH"    value="@PITCH"/>
             </rc_commands>

             <command_laws>
               <set servo="THROTTLE" value="@THROTTLE"/>
               <set servo="RUDDER" value="@ROLL"/>
            <set servo="ELEVATOR" value="@PITCH"/>
             </command_laws>

             <section name="AUTO1" prefix="AUTO1_">
               <define name="MAX_ROLL" value="0.6"/>
               <define name="MAX_PITCH" value="0.6"/>
             </section>

             <section name="adc" prefix="ADC_CHANNEL_">
               <define name="IR1" value="ADC_0"/>
               <define name="IR2" value="ADC_1"/>
               <define name="IR_TOP" value="ADC_6"/>

             </section>

             <section name="INFRARED" prefix="IR_">
               <define name="ADC_IR1_NEUTRAL" value="512"/>
               <define name="ADC_IR2_NEUTRAL" value="512"/>
               <define name="ADC_TOP_NEUTRAL" value="512"/>
               <define name="IR2_SIGN" value="-1"/>
               <define name="TOP_SIGN" value="-1"/>
               <define name="HORIZ_SENSOR_TILTED" value="1"/>
               <define name="LATERAL_CORRECTION" value="1"/>
               <define name="LONGITUDINAL_CORRECTION" value="1"/>
               <define name="VERTICAL_CORRECTION" value="1"/>
               <define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
               <define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
               <define name="CORRECTION_UP" value="1"/>
               <define name="CORRECTION_DOWN" value="1"/>
               <define name="CORRECTION_LEFT" value="1"/>
               <define name="CORRECTION_RIGHT" value="1"/>

             </section>

             <section name="BAT">
               <define name="MILLIAMP_PER_PERCENT" value="0.86"/>
               <define name="CATASTROPHIC_BAT_LEVEL" value="5.5"
            unit="V"/>
             </section>
               <section name="MISC">
               <define name="NOMINAL_AIRSPEED" value="7" unit="m/s"/>
               <define name="CARROT" value="5." unit="s"/>
               <define name="KILL_MODE_DISTANCE"
            value="(1.5*MAX_DIST_FROM_HOME)"/>
               <define name="CONTROL_RATE" value="60" unit="Hz"/>
             </section>
               <section name="PID">
               <define name="ROLL_PGAIN" value="5000."/>
               <define name="PITCH_OF_ROLL" value="0.25"/>
               <define name="PITCH_PGAIN" value="10000."/>
               <define name="MAX_ROLL" value="0.35"/>
               <define name="MAX_PITCH" value="0.35"/>
               <define name="MIN_PITCH" value="-0.35"/>
               <define name="AILERON_OF_THROTTLE" value="0.0"/>
               <define name="CRUISE_THROTTLE" value="0.35"/>
             </section>
               <section name="ALT" prefix="CLIMB_">
               <define name="PITCH_PGAIN" value="-0.05"/>
               <define name="PITCH_IGAIN" value="0.075"/>
               <define name="PGAIN" value="-0.01"/>
               <define name="IGAIN" value="0.1"/>
               <define name="MAX" value="1."/>
               <define name="PITCH_OF_VZ_PGAIN" value="0.05"/>
               <define name="THROTTLE_OF_CLIMB" value="0.15"
            unit="%/(m/s)"/>
             </section>
               <section name="HORIZONTAL CONTROL" prefix="H_CTL_">
               <define name="COURSE_PGAIN" value="-0.4"/>
               <define name="ROLL_MAX_SETPOINT" value="0.6"
            unit="radians"/>
               <define name="PITCH_MAX_SETPOINT" value="0.5"
            unit="radians"/>
               <define name="PITCH_MIN_SETPOINT" value="-0.5"
            unit="radians"/>


               <define name="ROLL_PGAIN" value="5000."/>
               <define name="AILERON_OF_THROTTLE" value="0.0"/>
               <define name="PITCH_PGAIN" value="-9000."/>
               <define name="PITCH_DGAIN" value="1.5"/>
                 <!--  roll rate loop -->
               <define name="ROLL_RATE_MODE_DEFAULT" value="1"/>
               <define name="ROLL_RATE_SETPOINT_PGAIN" value="-5."
            unit="rad/s/rad"/>
               <define name="ROLL_RATE_MAX_SETPOINT" value="10"/>
               <define name="LO_THROTTLE_ROLL_RATE_PGAIN" value="1000."/>
               <define name="HI_THROTTLE_ROLL_RATE_PGAIN" value="1000."/>
               <define name="ROLL_RATE_IGAIN" value="0"/>
               <define name="ROLL_RATE_DGAIN" value="0"/>
               <define name="ROLL_RATE_SUM_NB_SAMPLES" value="64"/>

             </section>

             <section name="VERTICAL CONTROL" prefix="V_CTL_">

               <define name="POWER_CTL_BAT_NOMINAL" value="6"
            unit="volt"/>
               <!-- outer loop proportional gain -->
               <define name="ALTITUDE_PGAIN" value="-0.03"/>
               <!-- outer loop saturation -->
               <define name="ALTITUDE_MAX_CLIMB" value="2."/>

               <!-- auto throttle inner loop -->
               <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE"
            value="0.4"/>
               <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE"
            value="0.30"/>
               <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE"
            value="0.80"/>
               <define name="AUTO_THROTTLE_LOITER_TRIM" value="1500"/>
               <define name="AUTO_THROTTLE_DASH_TRIM" value="-1000"/>
               <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT"
            value="0.15" unit="%/(m/s)"/>
               <define name="AUTO_THROTTLE_PGAIN" value="-0.01"/>
               <define name="AUTO_THROTTLE_IGAIN" value="0.1"/>
               <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN"
            value="0.05"/>

               <!-- auto pitch inner loop -->
               <define name="AUTO_PITCH_PGAIN" value="-0.05"/>
               <define name="AUTO_PITCH_IGAIN" value="0.075"/>
               <define name="AUTO_PITCH_MAX_PITCH" value="0.35"/>
               <define name="AUTO_PITCH_MIN_PITCH" value="-0.35"/>

              <define name="THROTTLE_SLEW" value="0.1"/>

             </section>


             <section name="NAV">
               <define name="NAV_PITCH" value="0.0"/>
               <define name="NAV_GLIDE_PITCH_TRIM" value="0.2"/>
               <define name="DEFAULT_CIRCLE_RADIUS" value="100" unit="m"/>
             </section>

             <section name="AGGRESSIVE" prefix="AGR_">
               <define name="CLIMB_THROTTLE" value="0.95"/><!--
            Throttle for Aggressive Climb -->
               <define name="DESCENT_THROTTLE" value="0.1"/><!--
            Throttle for Aggressive Decent -->
               <define name="CLIMB_PITCH" value="0.3"/><!-- Pitch for
            Aggressive Climb -->
               <define name="DESCENT_PITCH" value="-0.25"/><!-- Pitch
            for Aggressive Decent -->
               <define name="BLEND_START" value="20"/><!-- Altitude
            Error to Initiate Aggressive Climb CANNOT BE ZERO!!-->
               <define name="BLEND_END" value="10"/><!-- Altitude
            Error to Blend Aggressive to Regular Climb Modes  CANNOT
            BE ZERO!!-->
               <define name="CLIMB_NAV_RATIO" value="0.8"/><!--
            Percent Navigation for Altitude Error Equal to Start
            Altitude -->
               <define name="DESCENT_NAV_RATIO" value="1.0"/>
               </section>


             <section name="FAILSAFE" prefix="FAILSAFE_">
               <define name="DELAY_WITHOUT_GPS" value="1" unit="s"/>
                   <define name="DEFAULT_THROTTLE" value="0.3" unit="%"/>
                   <define name="DEFAULT_ROLL" value="0.3" unit="rad"/>
                   <define name="DEFAULT_PITCH" value="0.5" unit="rad"/>
               <define name="HOME_RADIUS" value="100" unit="m"/>
            </section>
             <!--
             <section name="DATALINK" prefix="DATALINK_">
               <define name="DEVICE_TYPE" value="PPRZ"/>
               <define name="DEVICE_ADDRESS" value="...."/>
             </section>
            -->


             <makefile>
            include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile

            FLASH_MODE=IAP

            ap.CFLAGS +=  -DFBW -DAP -DCONFIG=\"tiny.h\" -DLED
            -DTIME_LED=1
            ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c
            $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c

            ap.CFLAGS += -DLED_3_BANK=0 -DLED_3_PIN=17 -DLED_4_BANK=0
            -DLED_4_PIN=18 -DLED_5_BANK=0 -DLED_5_PIN=19
            -DLED_6_BANK=0 -DLED_6_PIN=20


            ap.srcs += commands.c

            ap.CFLAGS += -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015
            ap.srcs += actuators.c $(SRC_ARCH)/servos_4015_hw.c

            ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_JR
            ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
            ap.CFLAGS += -DDOWNLINK -DUSE_UART0
            -DDOWNLINK_TRANSPORT=PprzTransport
            -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0
            -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600
            ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c
            pprz_transport.c latlong.c


            ap.CFLAGS += -DINTER_MCU
            ap.srcs += inter_mcu.c

            ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_2 -DUSE_AD0_3
            -DUSE_AD1 -DUSE_AD1_5 -DUSE_AD1_3 -DUSE_AD1_5
            ap.srcs += $(SRC_ARCH)/adc_hw.c

            ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1
            -DUART1_BAUD=B9600

            ap.srcs += gps_ubx.c gps.c

            ap.CFLAGS += -DINFRARED
            ap.srcs += infrared.c estimator.c

            ap.CFLAGS += -DNAV
            ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
            nav_survey_rectangle.c nav_line.c


            ap.CFLAGS += -DGYRO -DADXRS150 -DPID_RATE_LOOP
            ap.srcs += gyro.c

            # Harware In The Loop

            #ap.CFLAGS += -DHITL

            # Config for SITL simulation
            include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
            sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB
            -DLOITER_TRIM -DALT_KALMAN
            sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c
             </makefile>
            </airframe>

            
------------------------------------------------------------------------



            _______________________________________________
            Paparazzi-devel mailing list
            address@hidden <mailto:address@hidden>
            http://lists.nongnu.org/mailman/listinfo/paparazzi-devel



        _______________________________________________
        Paparazzi-devel mailing list
        address@hidden <mailto:address@hidden>
        http://lists.nongnu.org/mailman/listinfo/paparazzi-devel



------------------------------------------------------------------------

_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel





reply via email to

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