Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators.c File Reference

Actuator driver for the Parrot Disco. More...

#include "modules/actuators/actuators.h"
#include "modules/energy/electrical.h"
#include "actuators.h"
#include "autopilot.h"
#include "modules/core/abi.h"
#include <endian.h>
#include <string.h>
#include <stdio.h>
+ Include dependency graph for actuators.c:

Go to the source code of this file.

Data Structures

struct  disco_bldc_obs
 private observation structure More...
 

Macros

#define DISCO_BLDC_STATUS_STOPPED   1
 
#define DISCO_BLDC_STATUS_RAMPUP   2
 
#define DISCO_BLDC_STATUS_RUNNING   4
 
#define DISCO_BLDC_STATUS_RAMPDOWN   5
 
#define DISCO_BLDC_START_MOTOR_THRESHOLD   1100
 

Functions

static uint8_t actuators_disco_checksum (uint8_t *bytes, uint8_t size)
 
void actuators_disco_init (void)
 
void actuators_disco_set (uint8_t idx, uint16_t val)
 
void actuators_disco_commit (void)
 

Variables

struct disco_bldc_obs obs_data
 
static uint8_t disco_channels [] = { 4, 5, 6, 1, 2, 3 }
 Internal mapping of the PWM with output index servo rail 1 <-> linux pwm_4 servo rail 2 <-> linux pwm_5 servo rail 3 <-> linux pwm_6 servo rail 4 <-> linux pwm_1 servo rail 5 <-> linux pwm_2 servo rail 6 <-> linux pwm_3. More...
 
struct ActuatorsDisco actuators_disco
 

Detailed Description

Actuator driver for the Parrot Disco.

Disco plane is using the same ESC (I2C) as a Parrot Bebop for its motor and Pwm_sysfs linux driver for the PWM outputs

Some part of this code is coming from the APM Disco and Bebop drivers

Definition in file actuators.c.


Data Structure Documentation

◆ disco_bldc_obs

struct disco_bldc_obs

private observation structure

Definition at line 51 of file actuators.c.

Data Fields
uint16_t batt_mv
uint8_t checksum
uint8_t error
uint8_t motors_err
uint8_t overrcurrent
uint16_t rpm
uint8_t status
uint8_t temp

Macro Definition Documentation

◆ DISCO_BLDC_START_MOTOR_THRESHOLD

#define DISCO_BLDC_START_MOTOR_THRESHOLD   1100

Definition at line 84 of file actuators.c.

◆ DISCO_BLDC_STATUS_RAMPDOWN

#define DISCO_BLDC_STATUS_RAMPDOWN   5

Definition at line 79 of file actuators.c.

◆ DISCO_BLDC_STATUS_RAMPUP

#define DISCO_BLDC_STATUS_RAMPUP   2

Definition at line 77 of file actuators.c.

◆ DISCO_BLDC_STATUS_RUNNING

#define DISCO_BLDC_STATUS_RUNNING   4

Definition at line 78 of file actuators.c.

◆ DISCO_BLDC_STATUS_STOPPED

#define DISCO_BLDC_STATUS_STOPPED   1

Definition at line 76 of file actuators.c.

Function Documentation

◆ actuators_disco_checksum()

static uint8_t actuators_disco_checksum ( uint8_t bytes,
uint8_t  size 
)
static

Definition at line 184 of file actuators.c.

References checksum.

Referenced by actuators_disco_commit().

+ Here is the caller graph for this function:

◆ actuators_disco_commit()

◆ actuators_disco_init()

◆ actuators_disco_set()

void actuators_disco_set ( uint8_t  idx,
uint16_t  val 
)

Definition at line 101 of file actuators.c.

References actuators_disco, ACTUATORS_DISCO_MOTOR_IDX, ACTUATORS_DISCO_PWM_NB, idx, ActuatorsDisco::motor_rpm, ActuatorsDisco::pwm, pwm_sysfs_set_duty(), and val.

+ Here is the call graph for this function:

Variable Documentation

◆ actuators_disco

struct ActuatorsDisco actuators_disco

Definition at line 74 of file actuators.c.

Referenced by actuators_disco_commit(), actuators_disco_init(), and actuators_disco_set().

◆ disco_channels

uint8_t disco_channels[] = { 4, 5, 6, 1, 2, 3 }
static

Internal mapping of the PWM with output index servo rail 1 <-> linux pwm_4 servo rail 2 <-> linux pwm_5 servo rail 3 <-> linux pwm_6 servo rail 4 <-> linux pwm_1 servo rail 5 <-> linux pwm_2 servo rail 6 <-> linux pwm_3.

Definition at line 74 of file actuators.c.

Referenced by actuators_disco_init().

◆ obs_data

struct disco_bldc_obs obs_data

Referenced by actuators_disco_commit().