Skip to content

Commit

Permalink
Merge branch 'dev' into dev_i2c
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Apr 10, 2012
2 parents fff541d + 5349657 commit d207187
Show file tree
Hide file tree
Showing 35 changed files with 760 additions and 274 deletions.
1 change: 0 additions & 1 deletion conf/airframes/CDW/debug_i2c.xml
Expand Up @@ -213,7 +213,6 @@
<firmware name="rotorcraft">
<!-- <define name="USE_PERSISTENT_SETTINGS"/> -->
<!-- <define name="USE_INS_NAV_INIT"/> -->
<define name="USE_ADAPT_HOVER"/>
<define name="FAILSAFE_GROUND_DETECT"/>
<define name="USE_GPS_ACC4R"/>
<target name="ap" board="lisa_l_1.0">
Expand Down
1 change: 0 additions & 1 deletion conf/airframes/ENAC/quadrotor/blender.xml
Expand Up @@ -11,7 +11,6 @@

<firmware name="rotorcraft">
<define name="USE_INS_NAV_INIT"/>
<define name="USE_ADAPT_HOVER"/>
<!--define name="GUIDANCE_H_USE_REF"/-->

<target name="ap" board="booz_1.0">
Expand Down
1 change: 0 additions & 1 deletion conf/airframes/ENAC/quadrotor/booz2_g1.xml
Expand Up @@ -15,7 +15,6 @@

<firmware name="rotorcraft">
<define name="USE_INS_NAV_INIT"/>
<define name="USE_ADAPT_HOVER"/>
<!--define name="GUIDANCE_H_USE_REF"/-->

<target name="ap" board="booz_1.0">
Expand Down
2 changes: 0 additions & 2 deletions conf/airframes/ENAC/quadrotor/navgo.xml
Expand Up @@ -10,7 +10,6 @@

<firmware name="rotorcraft">
<define name="USE_INS_NAV_INIT"/>
<define name="USE_ADAPT_HOVER"/>
<define name="USE_ATTITUDE_REF" value="0"/>
<!--define name="GUIDANCE_H_USE_REF"/-->

Expand Down Expand Up @@ -105,7 +104,6 @@

<!-- Magnetic field for Toulouse (declination -16°) -->
<section name="AHRS" prefix="AHRS_">
<define name="MAG_UPDATE_YAW_ONLY" value="1"/>
<define name="PROPAGATE_FREQUENCY" value="512"/>
<define name="H_X" value=" 0.513081"/>
<define name="H_Y" value="-0.00242783"/>
Expand Down
1 change: 0 additions & 1 deletion conf/airframes/NoVa_L.xml
Expand Up @@ -242,7 +242,6 @@
<firmware name="rotorcraft">
<!-- <define name="USE_PERSISTENT_SETTINGS"/> -->
<!-- <define name="USE_INS_NAV_INIT"/> -->
<define name="USE_ADAPT_HOVER"/>
<define name="FAILSAFE_GROUND_DETECT"/>
<define name="USE_GPS_ACC4R"/>
<target name="ap" board="lisa_l_1.0">
Expand Down
1 change: 0 additions & 1 deletion conf/airframes/Poine/booz2_a7.xml
Expand Up @@ -214,7 +214,6 @@
<firmware name="rotorcraft">
<!-- <define name="USE_PERSISTENT_SETTINGS"/> -->
<!-- <define name="USE_INS_NAV_INIT"/> -->
<define name="USE_ADAPT_HOVER"/>
<define name="FAILSAFE_GROUND_DETECT"/>
<define name="USE_GPS_ACC4R"/>
<target name="ap" board="lisa_l_1.0">
Expand Down
38 changes: 19 additions & 19 deletions conf/airframes/fraser_lisa_m_rotorcraft.xml
Expand Up @@ -16,6 +16,7 @@
<define name="USE_INS_NAV_INIT"/>
<configure name="AHRS_ALIGNER_LED" value="3"/>
<configure name="USE_NEW_I2C_DRIVER" value="1"/>
<define name="USE_KILL_SWITCH_FOR_MOTOR_ARMING"/>
</target>
<target name="sim" board="pc">
<subsystem name="fdm" type="nps"/>
Expand Down Expand Up @@ -108,39 +109,38 @@

<section name="AHRS" prefix="AHRS_">
<define name="PROPAGATE_FREQUENCY" value="512"/>
<define name="MAG_UPDATE_YAW_ONLY"/>
<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"/>
<define name="BARO_SENS" value="22.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="0" />
<define name="DEADBAND_Q" value="0" />
<define name="DEADBAND_R" value="200" />
<define name="REF_TAU" value="4" />
<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="0"/>
<define name="DEADBAND_Q" value="0"/>
<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="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" />
<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" />
<define name="DDGAIN_P" value="300"/>
<define name="DDGAIN_Q" value="300"/>
<define name="DDGAIN_R" value="300"/>
</section>


Expand Down Expand Up @@ -204,7 +204,7 @@
<define name="RC_CLIMB_COEF" value ="163"/>
<!-- BOOZ_SPEED_I_OF_F(1.5) * 20% -->
<define name="RC_CLIMB_DEAD_BAND" value ="160000"/>
<!--define name="INV_M" value ="0.21"/-->
<!--define name="NOMINAL_HOVER_THROTTLE" value="0.5"/-->
</section>

<section name="GUIDANCE_H" prefix="GUIDANCE_H_">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions conf/boards/lisa_m_2.0.makefile
Expand Up @@ -2,11 +2,11 @@
#
# lisa_m_2.0.makefile
#
# http://paparazzi.enac.fr/wiki/Lisa/M
# http://paparazzi.enac.fr/wiki/Lisa/M_v20
#

BOARD=lisa_m
BOARD_VERSION=1.0
BOARD_VERSION=2.0
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"

ARCH=stm32
Expand Down
21 changes: 21 additions & 0 deletions conf/modules/bat_checker.xml
@@ -0,0 +1,21 @@
<!DOCTYPE module SYSTEM "module.dtd">

<!--
Battery checker module
@define BAT_CHECKER_DELAY Number of seconds the battery voltage has to be
below LOW_BAT_LEVEL before the warning signal is
activated.
@define BAT_CHECKER_LED The LED to use for the warning signal.
-->
<module name="bat_checker">
<header>
<file name="bat_checker.h"/>
</header>
<init fun="init_bat_checker()"/>
<periodic fun="bat_checker_periodic()" freq="2" autorun="TRUE"/>
<makefile>
<define name="bat_checker_periodic_FREQ" value="2"/>
<file name="bat_checker.c"/>
</makefile>
</module>

19 changes: 0 additions & 19 deletions conf/modules/battery_buzzer.xml

This file was deleted.

1 change: 1 addition & 0 deletions conf/settings/settings_booz2.xml
Expand Up @@ -43,6 +43,7 @@
<dl_setting var="guidance_v_kd" min="0" step="1" max="600" module="guidance/guidance_v" shortname="kd"/>
<dl_setting var="guidance_v_ki" min="0" step="1" max="300" module="guidance/guidance_v" shortname="ki" handler="SetKi" />
<dl_setting var="guidance_v_z_sp" min="-5" step="0.5" max="3" module="guidance/guidance_v" shortname="sp" unit="2e-8m" alt_unit="m" alt_unit_coef="0.00390625"/>
<dl_setting var="guidance_v_nominal_throttle" min="0.1" step="0.01" max="0.9" module="guidance/guidance_v" shortname="nominal_throttle" handler="SetNominalHoverThrottle" alt_unit="%" alt_unit_coef="0.000104167"/>
<dl_setting var="ins_vf_realign" min="0" step="1" max="1" module="subsystems/ins" shortname="vf_realign" values="OFF|ON"/>
</dl_settings>

Expand Down
55 changes: 38 additions & 17 deletions sw/airborne/boards/lisa_m_1.0.h
Expand Up @@ -24,6 +24,7 @@
#define LED_3_GPIO_PIN GPIO_Pin_2
#define LED_3_AFIO_REMAP ((void)0)

// GPIO pins
#define LED_4_BANK
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOC
Expand All @@ -42,29 +43,49 @@
#define IMU_ACC_DRDY_GPIO GPIOB
#define IMU_ACC_DRDY_GPIO_PORTSOURCE GPIO_PortSourceGPIOB

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY 2
#endif


#define DefaultVoltageOfAdc(adc) (0.00485*adc)

/* Onboard ADCs */
/*
ADC1 PC3/ADC13
ADC2 PA0/ADC0
ADC3 PC0/ADC10
ADC4 PC1/ADC11
ADC5 PC5/ADC15
ADC6 PA1/ADC1
ADC7 PC2/ADC12
BATT PC4/ADC14
ADC_1 PC3/ADC13
ADC_2 PC0/ADC10
ADC_3 PC1/ADC11
ADC_4 PC5/ADC15
ADC_6 PC2/ADC12
BATT PC4/ADC14
*/
#define BOARD_ADC_CHANNEL_1 ADC_Channel_13
#define BOARD_ADC_CHANNEL_2 ADC_Channel_0
// FIXME - removed for now and used for battery monitoring
//#define BOARD_ADC_CHANNEL_3 ADC_Channel_10
#define BOARD_ADC_CHANNEL_3 ADC_Channel_14
#define BOARD_ADC_CHANNEL_4 ADC_Channel_11
#define BOARD_ADC_CHANNEL_2 ADC_Channel_10
#define BOARD_ADC_CHANNEL_3 ADC_Channel_11
// we can only use ADC1,2,3; the last channel is for bat monitoring
#define BOARD_ADC_CHANNEL_4 ADC_Channel_14

/* provide defines that can be used to access the ADC_x in the code or airframe file
* these directly map to the index number of the 4 adc channels defined above
* 4th (index 3) is used for bat monitoring by default
*/
#define ADC_1 0
#define ADC_2 1
#define ADC_3 2

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY 3
#endif

/* GPIO mapping for ADC1 pins, overwrites the default in arch/stm32/mcu_periph/adc_arch.c */
// FIXME, this is not very nice, is also stm lib specific
#ifdef USE_AD1
#define ADC1_GPIO_INIT(gpio) { \
(gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4; \
(gpio).GPIO_Mode = GPIO_Mode_AIN; \
GPIO_Init(GPIOC, (&gpio)); \
}
#endif // USE_AD1



#define BOARD_HAS_BARO 1

Expand Down
107 changes: 107 additions & 0 deletions sw/airborne/boards/lisa_m_2.0.h
@@ -0,0 +1,107 @@
#ifndef CONFIG_LISA_M_2_0_H
#define CONFIG_LISA_M_2_0_H

#define BOARD_LISA_M

#define AHB_CLK 72000000

/* Onboard LEDs */
#define LED_1_BANK
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_CLK RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO
#define LED_1_GPIO_PIN GPIO_Pin_4
#define LED_1_AFIO_REMAP GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE)

/* shared with ADC15 */
#define LED_2_BANK
#define LED_2_GPIO GPIOC
#define LED_2_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_2_GPIO_PIN GPIO_Pin_5
#define LED_2_AFIO_REMAP ((void)0)

#define LED_3_BANK
#define LED_3_GPIO GPIOC
#define LED_3_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_3_GPIO_PIN GPIO_Pin_2
#define LED_3_AFIO_REMAP ((void)0)

#define LED_4_BANK
#define LED_4_GPIO GPIOC
#define LED_4_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_4_GPIO_PIN GPIO_Pin_12
#define LED_4_AFIO_REMAP ((void)0)

#define LED_5_BANK
#define LED_5_GPIO GPIOC
#define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
#define LED_5_GPIO_PIN GPIO_Pin_10
#define LED_5_AFIO_REMAP ((void)0)


/* configuration for aspirin - and more generaly IMUs */
#define IMU_ACC_DRDY_RCC_GPIO RCC_APB2Periph_GPIOB
#define IMU_ACC_DRDY_GPIO GPIOB
#define IMU_ACC_DRDY_GPIO_PORTSOURCE GPIO_PortSourceGPIOB



#define DefaultVoltageOfAdc(adc) (0.00485*adc)

/* Onboard ADCs */
/*
ADC1 PC3/ADC13
ADC2 PC0/ADC10
ADC3 PC1/ADC11
ADC4 PC5/ADC15
ADC6 PC2/ADC12
BATT PC4/ADC14
*/
#define BOARD_ADC_CHANNEL_1 ADC_Channel_13
#define BOARD_ADC_CHANNEL_2 ADC_Channel_10
#define BOARD_ADC_CHANNEL_3 ADC_Channel_11
// we can only use ADC1,2,3; the last channel is for bat monitoring
#define BOARD_ADC_CHANNEL_4 ADC_Channel_14

/* provide defines that can be used to access the ADC_x in the code or airframe file
* these directly map to the index number of the 4 adc channels defined above
* 4th (index 3) is used for bat monitoring by default
*/
#define ADC_1 0
#define ADC_2 1
#define ADC_3 2

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY 3
#endif

/* GPIO mapping for ADC1 pins, overwrites the default in arch/stm32/mcu_periph/adc_arch.c */
// FIXME, this is not very nice, is also stm lib specific
#ifdef USE_AD1
#define ADC1_GPIO_INIT(gpio) { \
(gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4; \
(gpio).GPIO_Mode = GPIO_Mode_AIN; \
GPIO_Init(GPIOC, (&gpio)); \
}
#endif // USE_AD1



#define BOARD_HAS_BARO 1

#define USE_OPENCM3 1

// not needed with USE_OPENCM3:
//#define HSE_TYPE_EXT_CLK
//#define STM32_RCC_MODE RCC_HSE_ON
//#define STM32_PLL_MULT RCC_PLLMul_6

#define PWM_5AND6_TIMER TIM5
#define PWM_5AND6_RCC RCC_APB1Periph_TIM5
#define PWM5_OC 1
#define PWM6_OC 2
#define PWM_5AND6_GPIO GPIOA
#define PWM5_Pin GPIO_Pin_0
#define PWM6_Pin GPIO_Pin_1

#endif /* CONFIG_LISA_M_2_0_H */

0 comments on commit d207187

Please sign in to comment.