Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
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>
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 |
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.
struct disco_bldc_obs |
#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().
Definition at line 175 of file actuators.c.
References checksum.
Referenced by actuators_disco_commit().
void actuators_disco_commit | ( | void | ) |
Definition at line 108 of file actuators.c.
References actuators_disco, actuators_disco_checksum(), ACTUATORS_DISCO_CLEAR_ERROR, ACTUATORS_DISCO_GET_OBS_DATA, ACTUATORS_DISCO_SET_REF_SPEED, ACTUATORS_DISCO_START_PROP, ACTUATORS_DISCO_STOP_PROP, autopilot_set_kill_throttle(), disco_bldc_obs::batt_mv, i2c_transaction::buf, DISCO_BLDC_START_MOTOR_THRESHOLD, DISCO_BLDC_STATUS_RAMPUP, DISCO_BLDC_STATUS_RUNNING, DISCO_BLDC_STATUS_STOPPED, electrical, disco_bldc_obs::error, i2c_blocking_transceive(), i2c_blocking_transmit(), ActuatorsDisco::i2c_trans, ActuatorsDisco::motor_rpm, obs_data, disco_bldc_obs::rpm, ActuatorsDisco::rpm_obs, ActuatorsDisco::rpm_saturated, RPM_SENSOR_ID, i2c_transaction::slave_addr, disco_bldc_obs::status, and Electrical::vsupply.
void actuators_disco_init | ( | void | ) |
Definition at line 84 of file actuators.c.
References actuators_disco, ACTUATORS_DISCO_ADDR, ACTUATORS_DISCO_PWM_NB, disco_channels, ActuatorsDisco::i2c_trans, I2CTransDone, ActuatorsDisco::motor_rpm, ActuatorsDisco::pwm, pwm_sysfs_init(), i2c_transaction::slave_addr, and i2c_transaction::status.
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.
struct ActuatorsDisco actuators_disco |
Definition at line 81 of file actuators.c.
Referenced by actuators_disco_commit(), actuators_disco_init(), and actuators_disco_set().
|
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().