Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
esc32.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) Murat Bronz <murat.bronz@enac.fr>
3
*
4
* This file is part of paparazzi
5
*
6
* paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with paparazzi; see the file COPYING. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*/
26
#ifndef ESC32_H
27
#define ESC32_H
28
29
#include "
std.h
"
30
31
extern
void
esc32_init
(
void
);
32
extern
void
esc32_periodic
(
void
);
33
extern
void
esc32_event
(
void
);
34
35
struct
esc32_parameter
{
36
float
amps
;
37
float
volts_bat
;
38
float
volts_motor
;
39
float
rpm
;
40
float
duty
;
41
};
42
43
struct
esc32
{
44
struct
esc32_parameter
params
;
45
float
energy
;
46
float
power
;
47
bool
data_available
;
48
};
49
50
extern
struct
esc32
esc32
;
51
52
enum
binaryCommands
{
53
BINARY_COMMAND_NOP
= 0,
54
BINARY_COMMAND_ARM
,
55
BINARY_COMMAND_CLI
,
56
BINARY_COMMAND_CONFIG
,
57
BINARY_COMMAND_DISARM
,
58
BINARY_COMMAND_DUTY
,
59
BINARY_COMMAND_PWM
,
60
BINARY_COMMAND_RPM
,
61
BINARY_COMMAND_SET
,
62
BINARY_COMMAND_START
,
63
BINARY_COMMAND_STATUS
,
64
BINARY_COMMAND_STOP
,
65
BINARY_COMMAND_TELEM_RATE
,
66
BINARY_COMMAND_VERSION
,
67
BINARY_COMMAND_TELEM_VALUE
,
68
BINARY_COMMAND_GET_PARAM_ID
,
69
BINARY_COMMAND_ACK
= 250,
70
BINARY_COMMAND_NACK
71
};
72
73
enum
binaryValues
{
74
BINARY_VALUE_NONE
= 0,
75
BINARY_VALUE_AMPS
,
76
BINARY_VALUE_VOLTS_BAT
,
77
BINARY_VALUE_VOLTS_MOTOR
,
78
BINARY_VALUE_RPM
,
79
BINARY_VALUE_DUTY
,
80
BINARY_VALUE_COMM_PERIOD
,
81
BINARY_VALUE_BAD_DETECTS
,
82
BINARY_VALUE_ADC_WINDOW
,
83
BINARY_VALUE_IDLE_PERCENT
,
84
BINARY_VALUE_STATE
,
85
BINARY_VALUE_AVGA
,
86
BINARY_VALUE_AVGB
,
87
BINARY_VALUE_AVGC
,
88
BINARY_VALUE_AVGCOMP
,
89
BINARY_VALUE_FETSTEP
,
90
BINARY_VALUE_NUM
91
};
92
93
enum
configParameters
{
94
CONFIG_VERSION
= 0,
95
STARTUP_MODE
,
96
BAUD_RATE
,
97
PTERM
,
98
ITERM
,
99
FF1TERM
,
100
FF2TERM
,
101
CL1TERM
,
102
CL2TERM
,
103
CL3TERM
,
104
CL4TERM
,
105
CL5TERM
,
106
SHUNT_RESISTANCE
,
107
MIN_PERIOD
,
108
MAX_PERIOD
,
109
BLANKING_MICROS
,
110
ADVANCE
,
111
START_VOLTAGE
,
112
GOOD_DETECTS_START
,
113
BAD_DETECTS_DISARM
,
114
MAX_CURRENT
,
115
SWITCH_FREQ
,
116
MOTOR_POLES
,
117
PWM_MIN_PERIOD
,
118
PWM_MAX_PERIOD
,
119
PWM_MIN_VALUE
,
120
PWM_LO_VALUE
,
121
PWM_HI_VALUE
,
122
PWM_MAX_VALUE
,
123
PWM_MIN_START
,
124
PWM_RPM_SCALE
,
125
FET_BRAKING
,
126
PNFAC
,
127
INFAC
,
128
THR1TERM
,
129
THR2TERM
,
130
START_ALIGN_TIME
,
131
START_ALIGN_VOLTAGE
,
132
START_STEPS_NUM
,
133
START_STEPS_PERIOD
,
134
START_STEPS_ACCEL
,
135
PWM_LOWPASS
,
136
RPM_MEAS_LP
,
137
SERVO_DUTY
,
138
SERVO_P
,
139
SERVO_D
,
140
SERVO_MAX_RATE
,
141
SERVO_SCALE
,
142
ESC_ID
,
143
DIRECTION
,
144
CONFIG_NUM_PARAMS
145
};
146
147
#endif
148
FF2TERM
Definition:
esc32.h:100
configParameters
configParameters
Definition:
esc32.h:93
esc32::energy
float energy
accumulated energy
Definition:
esc32.h:45
GOOD_DETECTS_START
Definition:
esc32.h:112
CL5TERM
Definition:
esc32.h:105
BINARY_VALUE_NONE
Definition:
esc32.h:74
BAD_DETECTS_DISARM
Definition:
esc32.h:113
SWITCH_FREQ
Definition:
esc32.h:115
esc32_parameter::volts_bat
float volts_bat
input battery voltage
Definition:
esc32.h:37
BINARY_VALUE_AVGA
Definition:
esc32.h:85
SERVO_P
Definition:
esc32.h:138
BLANKING_MICROS
Definition:
esc32.h:109
BINARY_VALUE_AVGB
Definition:
esc32.h:86
BINARY_VALUE_BAD_DETECTS
Definition:
esc32.h:81
BINARY_COMMAND_VERSION
Definition:
esc32.h:66
PWM_LOWPASS
Definition:
esc32.h:135
BAUD_RATE
Definition:
esc32.h:96
BINARY_VALUE_AVGCOMP
Definition:
esc32.h:88
binaryValues
binaryValues
Definition:
esc32.h:73
START_STEPS_ACCEL
Definition:
esc32.h:134
ADVANCE
Definition:
esc32.h:110
SERVO_MAX_RATE
Definition:
esc32.h:140
esc32_parameter::amps
float amps
current consumption
Definition:
esc32.h:36
FF1TERM
Definition:
esc32.h:99
BINARY_VALUE_IDLE_PERCENT
Definition:
esc32.h:83
PWM_MIN_PERIOD
Definition:
esc32.h:117
SHUNT_RESISTANCE
Definition:
esc32.h:106
CL1TERM
Definition:
esc32.h:101
BINARY_COMMAND_ARM
Definition:
esc32.h:54
BINARY_COMMAND_STOP
Definition:
esc32.h:64
esc32
Definition:
esc32.h:43
BINARY_COMMAND_PWM
Definition:
esc32.h:59
START_VOLTAGE
Definition:
esc32.h:111
BINARY_VALUE_VOLTS_MOTOR
Definition:
esc32.h:77
STARTUP_MODE
Definition:
esc32.h:95
START_ALIGN_TIME
Definition:
esc32.h:130
FET_BRAKING
Definition:
esc32.h:125
BINARY_VALUE_NUM
Definition:
esc32.h:90
BINARY_COMMAND_ACK
Definition:
esc32.h:69
BINARY_VALUE_AVGC
Definition:
esc32.h:87
CONFIG_NUM_PARAMS
Definition:
esc32.h:144
BINARY_VALUE_DUTY
Definition:
esc32.h:79
BINARY_COMMAND_DUTY
Definition:
esc32.h:58
BINARY_COMMAND_CLI
Definition:
esc32.h:55
THR2TERM
Definition:
esc32.h:129
BINARY_VALUE_RPM
Definition:
esc32.h:78
BINARY_COMMAND_TELEM_VALUE
Definition:
esc32.h:67
esc32_periodic
void esc32_periodic(void)
Definition:
esc32.c:255
esc32::params
struct esc32_parameter params
filtered data from the esc
Definition:
esc32.h:44
SERVO_SCALE
Definition:
esc32.h:141
BINARY_VALUE_STATE
Definition:
esc32.h:84
MOTOR_POLES
Definition:
esc32.h:116
START_STEPS_NUM
Definition:
esc32.h:132
START_ALIGN_VOLTAGE
Definition:
esc32.h:131
binaryCommands
binaryCommands
Definition:
esc32.h:52
CONFIG_VERSION
Definition:
esc32.h:94
BINARY_COMMAND_DISARM
Definition:
esc32.h:57
PWM_MAX_VALUE
Definition:
esc32.h:122
INFAC
Definition:
esc32.h:127
BINARY_COMMAND_RPM
Definition:
esc32.h:60
CL2TERM
Definition:
esc32.h:102
BINARY_VALUE_FETSTEP
Definition:
esc32.h:89
MAX_CURRENT
Definition:
esc32.h:114
esc32_parameter
Definition:
esc32.h:35
CL3TERM
Definition:
esc32.h:103
BINARY_COMMAND_NACK
Definition:
esc32.h:70
MIN_PERIOD
Definition:
esc32.h:107
esc32_parameter::volts_motor
float volts_motor
motor voltage (bat voltage * throttle in % in fact)
Definition:
esc32.h:38
std.h
SERVO_DUTY
Definition:
esc32.h:137
esc32_init
void esc32_init(void)
Definition:
esc32.c:235
ITERM
Definition:
esc32.h:98
BINARY_COMMAND_STATUS
Definition:
esc32.h:63
BINARY_VALUE_COMM_PERIOD
Definition:
esc32.h:80
BINARY_VALUE_ADC_WINDOW
Definition:
esc32.h:82
BINARY_COMMAND_TELEM_RATE
Definition:
esc32.h:65
PTERM
Definition:
esc32.h:97
BINARY_COMMAND_GET_PARAM_ID
Definition:
esc32.h:68
PWM_MAX_PERIOD
Definition:
esc32.h:118
esc32::power
float power
computed battery power
Definition:
esc32.h:46
BINARY_COMMAND_NOP
Definition:
esc32.h:53
PWM_MIN_VALUE
Definition:
esc32.h:119
PWM_RPM_SCALE
Definition:
esc32.h:124
PWM_HI_VALUE
Definition:
esc32.h:121
BINARY_VALUE_AMPS
Definition:
esc32.h:75
esc32_parameter::rpm
float rpm
motor rotation speed
Definition:
esc32.h:39
PNFAC
Definition:
esc32.h:126
MAX_PERIOD
Definition:
esc32.h:108
PWM_LO_VALUE
Definition:
esc32.h:120
esc32_parameter::duty
float duty
motor duty cycle (more or less throttle in %)
Definition:
esc32.h:40
BINARY_COMMAND_SET
Definition:
esc32.h:61
BINARY_COMMAND_CONFIG
Definition:
esc32.h:56
SERVO_D
Definition:
esc32.h:139
BINARY_VALUE_VOLTS_BAT
Definition:
esc32.h:76
CL4TERM
Definition:
esc32.h:104
START_STEPS_PERIOD
Definition:
esc32.h:133
esc32_event
void esc32_event(void)
Definition:
esc32.c:345
esc32::data_available
bool data_available
data updated
Definition:
esc32.h:47
DIRECTION
Definition:
esc32.h:143
PWM_MIN_START
Definition:
esc32.h:123
BINARY_COMMAND_START
Definition:
esc32.h:62
THR1TERM
Definition:
esc32.h:128
ESC_ID
Definition:
esc32.h:142
RPM_MEAS_LP
Definition:
esc32.h:136
sw
airborne
modules
esc32
esc32.h
Generated on Wed Feb 10 2021 04:34:09 for Paparazzi UAS by
1.8.8