Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators.c File Reference

Actuator driver for the Parrot Disco. More...

#include "subsystems/actuators.h"
#include "subsystems/electrical.h"
#include "actuators.h"
#include "autopilot.h"
#include "subsystems/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

struct disco_bldc_obs

private observation structure

Definition at line 46 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

#define DISCO_BLDC_START_MOTOR_THRESHOLD   1100

Definition at line 79 of file actuators.c.

Referenced by actuators_disco_commit().

#define DISCO_BLDC_STATUS_RAMPDOWN   5

Definition at line 74 of file actuators.c.

#define DISCO_BLDC_STATUS_RAMPUP   2

Definition at line 72 of file actuators.c.

Referenced by actuators_disco_commit().

#define DISCO_BLDC_STATUS_RUNNING   4

Definition at line 73 of file actuators.c.

Referenced by actuators_disco_commit().

#define DISCO_BLDC_STATUS_STOPPED   1

Definition at line 71 of file actuators.c.

Referenced by actuators_disco_commit().

Function Documentation

static uint8_t actuators_disco_checksum ( uint8_t bytes,
uint8_t  size 
)
static

Definition at line 175 of file actuators.c.

References checksum.

Referenced by actuators_disco_commit().

+ Here is the caller graph for this function:

void actuators_disco_set ( uint8_t  idx,
uint16_t  val 
)

Definition at line 96 of file actuators.c.

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

+ Here is the call graph for this function:

Variable Documentation

struct ActuatorsDisco actuators_disco

Definition at line 81 of file actuators.c.

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

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 69 of file actuators.c.

Referenced by actuators_disco_init().

struct disco_bldc_obs obs_data

Referenced by actuators_disco_commit().