openpilot revo mini results

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

openpilot revo mini results

Chris
Hi.
Just to let everyone know i just finished testing (on the bench) the
mini version of the openpilot revo.
I wrote a slightly different board config because i wanted to also test
the transparent serial link provided
by the orangerx 433 Mhz  LRS rc receiver (contains a rfm22 module)
running the openlrsng firmware,
so i moved the telemetry link to UART6 on the RC input port which
allowed me to have a single connector to the receiver-modem.
Everything worked fine at 9600bps (i didn't test the telemetry link at a
higher serial speed) until the openpilot revo mini died probably from
voltage regulator overheating.
I have mixed feelings for this autopilot board as i feel that the single
3.3v regulator is not up to the task
of a otherwise wonderfully small autopilot board.
If it is powered from more than 5v as mine was (6.6v) the regulator gets
very hot
Now on to make my own 1w rc-modem transceivers which will carry the rc
link as well as the telemetry.
BTW Felix i think there is a typo in the normal openpilot_revo_1.0.h
file because the PPM input pin used is the PA01 which ends up to servo 5
not 6 (counting from 1) of the revo board.
Below is the board file i used:
#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO_MINI

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
#define USE_BARO_BOARD 1
#endif

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
  * Onboard LEDs
  */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) ||
USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) ||
USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6


/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
  * ADC
  */

/* Onboard ADCs */
/*
    ADC1 PC2/ADC1,2,3 channel 12 (Voltage input 3.3v max)
    ADC2 PC1/ADC1,2,3 channel 11 (Current input 3.3v max)
    ADC3 PA3/ADC1,2,3 channel 3
    ADC4 PA2/ADC1,2,3 channel 2
*/

/* 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
  */

#if RADIO_CONTROL_PPM_PIN == SERVO_5_OUT
#define USE_AD_TIM1 1
#else
#define USE_AD_TIM2 1
#endif

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

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

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/* PPM
  *
  * Default is input on GPIOA1 (Servo pin 5)
  */
#define SERVO_5_IN    1
#define SERVO_5_OUT    2
#define SERVO_6_IN    3

#ifndef RADIO_CONTROL_PPM_PIN
#define RADIO_CONTROL_PPM_PIN    SERVO_5_OUT
#endif

#if RADIO_CONTROL_PPM_PIN == SERVO_6_IN
  /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif RADIO_CONTROL_PPM_PIN == SERVO_5_IN

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#elif RADIO_CONTROL_PPM_PIN == SERVO_5_OUT

/* input on PA01 (SERVO 5 OUT) */
#define USE_PPM_TIM2 1
#define PPM_CHANNEL         TIM_IC2
#define PPM_TIMER_INPUT     TIM_IC_IN_TI2
#define PPM_IRQ             NVIC_TIM2_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC2IE
#define PPM_CC_IF           TIM_SR_CC2IF
#define PPM_GPIO_PORT       GPIOA
#define PPM_GPIO_PIN        GPIO1
#define PPM_GPIO_AF         GPIO_AF1

// Move default ADC timer
#if USE_AD_TIM2
#undef USE_AD_TIM2
#endif
#define USE_AD_TIM1 1


#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
  * PWM
  *
  */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif
#if (RADIO_CONTROL_PPM_PIN != SERVO_1_IN && RADIO_CONTROL_PPM_PIN !=
SERVO_2_IN)
#define PWM_USE_TIM12 1
#elif (RADIO_CONTROL_PPM_PIN != SERVO_5_IN && RADIO_CONTROL_PPM_PIN !=
SERVO_6_IN)
#define PWM_USE_TIM8 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5 && RADIO_CONTROL_PPM_PIN != SERVO_5_OUT
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif

#if (RADIO_CONTROL_PPM_PIN != SERVO_5_IN && RADIO_CONTROL_PPM_PIN !=
SERVO_6_IN)

#if USE_PWM9
#define PWM_SERVO_9 8
#define PWM_SERVO_9_TIMER TIM8
#define PWM_SERVO_9_GPIO GPIOC
#define PWM_SERVO_9_PIN GPIO8
#define PWM_SERVO_9_AF GPIO_AF3
#define PWM_SERVO_9_OC TIM_OC3
#define PWM_SERVO_9_OC_BIT (1<<2)
#else
#define PWM_SERVO_9_OC_BIT 0
#endif

#if USE_PWM10
#define PWM_SERVO_10 9
#define PWM_SERVO_10_TIMER TIM8
#define PWM_SERVO_10_GPIO GPIOC
#define PWM_SERVO_10_PIN GPIO9
#define PWM_SERVO_10_AF GPIO_AF3
#define PWM_SERVO_10_OC TIM_OC4
#define PWM_SERVO_10_OC_BIT (1<<3)
#else
#define PWM_SERVO_10_OC_BIT 0
#endif

#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)

#if (RADIO_CONTROL_PPM_PIN != SERVO_5_IN && RADIO_CONTROL_PPM_PIN !=
SERVO_6_IN)
/* servos 9-10 on TIM8 */
#define PWM_TIM8_CHAN_MASK (PWM_SERVO_9_OC_BIT | PWM_SERVO_10_OC_BIT)
#endif





/*
  * Spektrum
  */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5



#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Loading...