mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
*** empty log message ***
This commit is contained in:
+12
-9
@@ -1,10 +1,10 @@
|
||||
<airframe name="BOOZ">
|
||||
|
||||
<servos min="0" neutral="0" max="0x3ff">
|
||||
<servo name="MOTOR_FRONT" no="1" min="1200" neutral="1200" max="1850"/>
|
||||
<servo name="MOTOR_BACK" no="0" min="1200" neutral="1200" max="1850"/>
|
||||
<servo name="MOTOR_LEFT" no="3" min="1200" neutral="1200" max="1850"/>
|
||||
<servo name="MOTOR_RIGHT" no="2" min="1200" neutral="1200" max="1850"/>
|
||||
<servos min="0" neutral="0" max="0xff">
|
||||
<servo name="MOTOR_FRONT" no="0" min="0" neutral="0" max="255"/>
|
||||
<servo name="MOTOR_BACK" no="1" min="0" neutral="0" max="255"/>
|
||||
<servo name="MOTOR_RIGHT" no="3" min="0" neutral="0" max="255"/>
|
||||
<servo name="MOTOR_LEFT" no="2" min="0" neutral="0" max="255"/>
|
||||
</servos>
|
||||
|
||||
<commands>
|
||||
@@ -52,7 +52,7 @@ ctl.TARGETDIR = ctl
|
||||
ctl.CFLAGS += -DCONTROLLER -DCONFIG=\"conf_booz.h\"
|
||||
ctl.srcs = main_booz.c
|
||||
|
||||
ctl.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(4e-3)'
|
||||
ctl.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(4e-3)' -DTIME_LED=1
|
||||
ctl.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c
|
||||
|
||||
ctl.CFLAGS += -DLED
|
||||
@@ -73,10 +73,13 @@ ctl.srcs += spi.c $(SRC_ARCH)/spi_hw.c link_imu.c
|
||||
|
||||
ctl.srcs += booz_estimator.c booz_control.c booz_autopilot.c
|
||||
|
||||
ctl.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING
|
||||
ctl.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
|
||||
#ctl.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING
|
||||
#ctl.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
|
||||
|
||||
#ctl.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c $(SRC_ARCH)/mb_twi_controller.c
|
||||
ctl.CFLAGS += -DACTUATORS=\"actuators_buss_twi_blmc_hw.h\" -DUSE_BUSS_TWI_BLMC
|
||||
ctl.srcs += $(SRC_ARCH)/actuators_buss_twi_blmc_hw.c actuators.c
|
||||
ctl.CFLAGS += -DI2C_SCLL=150 -DI2C_SCLH=150 -DI2C_VIC_SLOT=10
|
||||
ctl.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c
|
||||
|
||||
ctl.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA -DRC_LED=4
|
||||
ctl.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
<airframe name="QuadRotorJP" ctl_board="V1_2" gps="SAM_LS">
|
||||
<section name="IMU_ANALOG" prefix="IMU_">
|
||||
<define name="INIT_EULER_DOT_VARIANCE_MAX" value="5"/>
|
||||
<define name="INIT_EULER_DOT_NB_SAMPLES_MIN" value ="10"/>
|
||||
<define name="GYROS_CONNECTED_TO_AP" value="1"/>
|
||||
<define name="ADC_ROLL_DOT" value="6"/>
|
||||
<define name="ADC_PITCH_DOT" value="4"/>
|
||||
<define name="ADC_YAW_DOT" value="0"/>
|
||||
<define name="ADC_ROLL_DOT_SIGN" value="-"/>
|
||||
<define name="ADC_PITCH_DOT_SIGN" value="+"/>
|
||||
<define name="ADC_YAW_DOT_SIGN" value="+"/>
|
||||
<define name="ADC_ROLL_DOT_ZERO" value="0x01BB"/>
|
||||
<define name="ADC_PITCH_DOT_ZERO" value="0x02CE"/>
|
||||
<define name="ADC_YAW_DOT_ZERO" value="0X0102"/>
|
||||
<define name="ADC_ROLL_DOT_SCALE" value="(0.9444*3.14159/180.0)"/>
|
||||
<define name="ADC_PITCH_DOT_SCALE" value="(0.9444*3.14159/180.0)"/>
|
||||
<define name="ADC_YAW_DOT_SCALE" value="(0.9444*3.14159/180.0)"/>
|
||||
<define name="ADC_ACCELX" value="1"/>
|
||||
<define name="ADC_ACCELY" value="2"/>
|
||||
<define name="ADC_ACCELZ" value="3"/>
|
||||
<define name="ADC_ACCELX_SIGN" value="+"/>
|
||||
<define name="ADC_ACCELY_SIGN" value="-"/>
|
||||
<define name="ADC_ACCELZ_SIGN" value="+"/>
|
||||
<define name="ADC_ACCELX_ZERO" value="0x1F1"/>
|
||||
<define name="ADC_ACCELY_ZERO" value="0x1C0"/>
|
||||
<define name="ADC_ACCELZ_ZERO" value="0x1EC"/>
|
||||
<define name="ADC_ACCELX_SCALE" value="(9.81*2.0/436)"/>
|
||||
<define name="ADC_ACCELY_SCALE" value="(9.81*2.0/425)"/>
|
||||
<define name="ADC_ACCELZ_SCALE" value="(9.81*2.0/441)"/>
|
||||
</section>
|
||||
<section name="RATE_LOOP">
|
||||
<define name="ROLL_DOT_PGAIN" value="-100."/>
|
||||
<define name="ROLL_DOT_IGAIN" value="0."/>
|
||||
<define name="ROLL_DOT_DGAIN" value="0."/>
|
||||
<define name="PITCH_DOT_PGAIN" value="-100."/>
|
||||
<define name="PITCH_DOT_IGAIN" value="0."/>
|
||||
<define name="PITCH_DOT_DGAIN" value="0."/>
|
||||
<define name="YAW_DOT_PGAIN" value="-100."/>
|
||||
<define name="YAW_DOT_IGAIN" value="0."/>
|
||||
<define name="YAW_DOT_DGAIN" value="0."/>
|
||||
</section>
|
||||
<section name="DESIRED_OF_RADIO" prefix="DESIRED_OF_RADIO_">
|
||||
<define name="ROLL_DOT" value="0.015"/>
|
||||
<define name="PITCH_DOT" value="0.015"/>
|
||||
<define name="YAW_DOT" value="0.015"/>
|
||||
</section>
|
||||
<section name="adc" prefix="ADC_CHANNEL_">
|
||||
<define name="IR1" value="0"/>
|
||||
<define name="IR2" value="1"/>
|
||||
<define name="VSUPPLY" value="6"/>
|
||||
</section>
|
||||
<section name="servo">
|
||||
<define name="SERVOS_FALLING_EDGE" value="1"/>
|
||||
</section>
|
||||
<servos min="1000" neutral="1500" max="2000">
|
||||
<servo name="MOTOR_FRONT" no="1" min="1250" neutral="1250" max="1850"/>
|
||||
<servo name="MOTOR_BACK" no="2" min="1250" neutral="1250" max="1850"/>
|
||||
<servo name="MOTOR_LEFT" no="3" min="1250" neutral="1250" max="1850"/>
|
||||
<servo name="MOTOR_RIGHT" no="4" min="1250" neutral="1250" max="1850"/>
|
||||
</servos>
|
||||
<command>
|
||||
<let var="roll" value="0.3 * @ROLL"/>
|
||||
<let var="pitch" value="0.3 * @PITCH"/>
|
||||
<let var="yaw" value="-0.4 * @YAW"/>
|
||||
<let var="throttle" value="2.0 * @THROTTLE"/>
|
||||
<set servo="MOTOR_FRONT" value="$throttle + $pitch - $yaw"/>
|
||||
<set servo="MOTOR_BACK" value="$throttle - $pitch - $yaw"/>
|
||||
<set servo="MOTOR_RIGHT" value="$throttle + $roll + $yaw"/>
|
||||
<set servo="MOTOR_LEFT" value="$throttle - $roll + $yaw"/>
|
||||
</command>
|
||||
<section name="INFRARED" prefix="IR_">
|
||||
<define name="ADC_ROLL_NEUTRAL" value="0"/>
|
||||
<define name="ADC_PITCH_NEUTRAL" value="1024"/>
|
||||
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
|
||||
<define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
|
||||
<define name="DEFAULT_CONTRAST" value="200"/>
|
||||
<define name="RAD_OF_IR_CONTRAST" value="0.75"/>
|
||||
<linear name="RollOfIrs" arity="2" coeff1="-1" coeff2="1"/>
|
||||
<linear name="PitchOfIrs" arity="2" coeff1="1" coeff2="1"/>
|
||||
</section>
|
||||
<section name="PID">
|
||||
<define name="ROLL_PGAIN" value="23000."/>
|
||||
<define name="PITCH_OF_ROLL" value="0.0"/>
|
||||
<define name="PITCH_PGAIN" value="23000."/>
|
||||
<define name="MAX_ROLL" value="0.35"/>
|
||||
<define name="MAX_PITCH" value="0.35"/>
|
||||
<define name="MIN_PITCH" value="-0.35"/>
|
||||
<define name="AILERON_OF_GAZ" value="-0.13"/>
|
||||
</section>
|
||||
<section name="ALT" prefix="CLIMB_">
|
||||
<define name="PITCH_PGAIN" value="-0.1"/>
|
||||
<define name="PITCH_IGAIN" value="0.025"/>
|
||||
<define name="PGAIN" value="-0.03"/>
|
||||
<define name="IGAIN" value="0.1"/>
|
||||
<define name="MAX" value="1."/>
|
||||
<define name="LEVEL_GAZ" value="0.31"/>
|
||||
<define name="PITCH_OF_VZ_PGAIN" value="0.05"/>
|
||||
<define name="GAZ_OF_CLIMB" value="0.2" unit="%/(m/s)"/>
|
||||
</section>
|
||||
<section name="NAV">
|
||||
<define name="COURSE_PGAIN" value="-0.2"/>
|
||||
<define name="ALTITUDE_PGAIN" value="-0.025"/>
|
||||
<define name="NAV_PITCH" value="0."/>
|
||||
</section>
|
||||
<section name="BAT">
|
||||
<define name="MILLIAMP_PER_PERCENT" value="2.16"/>
|
||||
<define name="VOLTAGE_ADC_A" value="0.0175"/>
|
||||
<define name="VOLTAGE_ADC_B" value="0.088"/>
|
||||
<define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)"/>
|
||||
<define name="LOW_BATTERY" value="93" unit="1e-1V"/>
|
||||
</section>
|
||||
<section name="MISC">
|
||||
<define name="NOMINAL_AIRSPEED" value="10." unit="m/s"/>
|
||||
<define name="CARROT" value="5." unit="s"/>
|
||||
</section>
|
||||
</airframe>
|
||||
+29
-12
@@ -430,11 +430,13 @@
|
||||
</message>
|
||||
|
||||
<message name="BOOZ_STATUS" ID="215">
|
||||
<field name="link_imu_nb_err" type="uint32"/>
|
||||
<field name="imu_status" type="uint8" values="NO_LINK|UNINIT|RUNNING|CRASHED"/>
|
||||
<field name="rc_status" type="uint8" values="OK|LOST|REALLY_LOST"/>
|
||||
<field name="ap_mode" type="uint8" values="FAILSAFE|RATE|ATTITUDE|NAV"/>
|
||||
<!-- <field name="vsupply" type="uint8" unit="decivolt"/> -->
|
||||
<field name="link_imu_nb_err" type="uint32"/>
|
||||
<field name="imu_status" type="uint8" values="NO_LINK|UNINIT|RUNNING|CRASHED"/>
|
||||
<field name="rc_status" type="uint8" values="OK|LOST|REALLY_LOST"/>
|
||||
<field name="ap_mode" type="uint8" values="FAILSAFE|RATE|ATTITUDE|NAV"/>
|
||||
<field name="vsupply" type="uint8" unit="decivolt"/>
|
||||
<field name="cpu_time" type="uint16" unit="s"></field>
|
||||
<field name="blmc_nb_err" type="uint8"/>
|
||||
</message>
|
||||
|
||||
<message name="BOOZ_DEBUG" ID="216">
|
||||
@@ -444,16 +446,31 @@
|
||||
<field name="sp_t" type="float"/>
|
||||
</message>
|
||||
|
||||
<message name="BOOZ_ATT_LOOP" ID="217">
|
||||
<message name="BOOZ_RATE_LOOP" ID="217">
|
||||
<field name="m_p" type="float"/>
|
||||
<field name="sp_p" type="float"/>
|
||||
<field name="m_q" type="float"/>
|
||||
<field name="sp_q" type="float"/>
|
||||
<field name="m_r" type="float"/>
|
||||
<field name="sp_r" type="float"/>
|
||||
</message>
|
||||
|
||||
<message name="BOOZ_ATT_LOOP" ID="218">
|
||||
<field name="m_phi" type="float"/>
|
||||
<field name="sp_phi" type="float"/>
|
||||
<field name="m_theta" type="float"/>
|
||||
<field name="sp_theta" type="float"/>
|
||||
</message>
|
||||
|
||||
<message name="BOOZ_RPMS" ID="219">
|
||||
<field name="front" type="float"/>
|
||||
<field name="back" type="float"/>
|
||||
<field name="left" type="float"/>
|
||||
<field name="right" type="float"/>
|
||||
</message>
|
||||
|
||||
|
||||
<message name="ENOSE_STATUS" ID="218">
|
||||
<message name="ENOSE_STATUS" ID="230">
|
||||
<field name="val1" type="uint16"/>
|
||||
<field name="val2" type="uint16"/>
|
||||
<field name="val3" type="uint16"/>
|
||||
@@ -461,12 +478,12 @@
|
||||
<field name="heat" type="uint8[]"/>
|
||||
</message>
|
||||
|
||||
<message name="DPICCO_STATUS" ID="219">
|
||||
<message name="DPICCO_STATUS" ID="231">
|
||||
<field name="humid" type="uint16"/>
|
||||
<field name="temp" type="uint16"/>
|
||||
</message>
|
||||
|
||||
<message name="ANTENNA_DEBUG" ID="220">
|
||||
<message name="ANTENNA_DEBUG" ID="240">
|
||||
<field name="mag_xraw" type="int32"/>
|
||||
<field name="mag_yraw" type="int32"/>
|
||||
<field name="mag_xcal" type="float"/>
|
||||
@@ -478,14 +495,14 @@
|
||||
<field name="mag_cal_status" type="uint8"/>
|
||||
</message>
|
||||
|
||||
<message name="ANTENNA_STATUS" ID="221">
|
||||
<message name="ANTENNA_STATUS" ID="241">
|
||||
<field name="azim_sp" type="float"/>
|
||||
<field name="elev_sp" type="float"/>
|
||||
<field name="id_sp" type="uint8"/>
|
||||
<field name="mode" type="uint8"/>
|
||||
</message>
|
||||
|
||||
<message name="MOTOR_BENCH_STATUS" ID="230">
|
||||
<message name="MOTOR_BENCH_STATUS" ID="250">
|
||||
<field name="time_ticks" type="uint32"/>
|
||||
<field name="throttle" type="float" format="%.3f"/>
|
||||
<field name="rpm" type="float"/>
|
||||
@@ -497,7 +514,7 @@
|
||||
|
||||
</message>
|
||||
|
||||
<message name="DC_MC_STATUS" ID="231">
|
||||
<message name="DC_MC_STATUS" ID="251">
|
||||
<field name="time_sec" type="uint16"/>
|
||||
<field name="time_ticks" type="uint16"/>
|
||||
<field name="command" type="uint16"/>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_setting var="booz_control_rate_pq_pgain" min="-2000" step="10" max="-100" module="booz_control" shortname="pq_p"/>
|
||||
<dl_setting var="booz_control_rate_pq_dgain" min="0" step="0.1" max="10" module="booz_control" shortname="pq_d"/>
|
||||
<dl_setting var="booz_control_rate_r_pgain" min="-500" step="10" max="-10" module="booz_control" shortname="r_p"/>
|
||||
<dl_setting var="booz_control_rate_r_dgain" min="0" step="0.1" max="10" module="booz_control" shortname="r_d"/>
|
||||
<dl_setting var="booz_control_attitude_phi_theta_pgain" min="-20000" step="500" max="-500" module="booz_control" shortname="att_p"/>
|
||||
<dl_setting var="booz_control_attitude_phi_theta_dgain" min="-20000" step="500" max="-500" module="booz_control" shortname="att_d"/>
|
||||
<dl_setting var="booz_control_rate_pq_dgain" min="0" step="0.5" max="30" module="booz_control" shortname="pq_d"/>
|
||||
<dl_setting var="booz_control_rate_r_pgain" min="-250" step="10" max="-10" module="booz_control" shortname="r_p"/>
|
||||
<dl_setting var="booz_control_rate_r_dgain" min="0" step="0.5" max="20" module="booz_control" shortname="r_d"/>
|
||||
<dl_setting var="booz_control_attitude_phi_theta_pgain" min="-2000" step="50" max="-50" module="booz_control" shortname="att_p"/>
|
||||
<dl_setting var="booz_control_attitude_phi_theta_dgain" min="-2000" step="50" max="-50" module="booz_control" shortname="att_d"/>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
<process name="Main">
|
||||
<mode name="default">
|
||||
<message name="BOOZ_STATUS" period="1."/>
|
||||
<message name="BOOZ_FD" period="0.05"/>
|
||||
<!-- <message name="BOOZ_FD" period="0.05"/> -->
|
||||
<message name="BOOZ_DEBUG" period="0.25"/>
|
||||
<message name="ACTUATORS" period="0.5"/>
|
||||
<message name="BOOZ_RATE_LOOP" period="0.05"/>
|
||||
<message name="BOOZ_ATT_LOOP" period="0.05"/>
|
||||
<message name="DL_VALUE" period="1."/>
|
||||
</mode>
|
||||
<mode name="debug">
|
||||
</mode>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "actuators.h"
|
||||
|
||||
uint8_t buss_twi_blmc_motor_power[BUSS_TWI_BLMC_NB];
|
||||
volatile bool_t buss_twi_blmc_status;
|
||||
volatile bool_t buss_twi_blmc_i2c_done;
|
||||
volatile uint8_t buss_twi_blmc_nb_err;
|
||||
volatile uint8_t buss_twi_blmc_idx;
|
||||
|
||||
const uint8_t buss_twi_blmc_addr[BUSS_TWI_BLMC_NB] = { 0x52, 0x54, 0x56, 0x58 };
|
||||
|
||||
void actuators_init ( void ) {
|
||||
uint8_t i;
|
||||
for (i=0; i<BUSS_TWI_BLMC_NB;i++)
|
||||
buss_twi_blmc_motor_power[i] = 0;
|
||||
buss_twi_blmc_status = BUSS_TWI_BLMC_STATUS_IDLE;
|
||||
buss_twi_blmc_i2c_done = TRUE;
|
||||
buss_twi_blmc_nb_err = 0;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef ACTUATORS_BUSS_TWI_BLMC_HW_H
|
||||
#define ACTUATORS_BUSS_TWI_BLMC_HW_H
|
||||
|
||||
#include <string.h>
|
||||
#include "std.h"
|
||||
#include "i2c.h"
|
||||
|
||||
#define ChopServo(x,a,b) Chop(x, a, b)
|
||||
#define Actuator(i) buss_twi_blmc_motor_power[i]
|
||||
#define ActuatorsCommit() { \
|
||||
if ( buss_twi_blmc_status == BUSS_TWI_BLMC_STATUS_IDLE) { \
|
||||
buss_twi_blmc_idx = 0; \
|
||||
buss_twi_blmc_motor_power[0] = 0; \
|
||||
buss_twi_blmc_motor_power[1] = 0; \
|
||||
buss_twi_blmc_motor_power[2] = 0; \
|
||||
buss_twi_blmc_motor_power[3] = 0; \
|
||||
buss_twi_blmc_status = BUSS_TWI_BLMC_STATUS_BUSY; \
|
||||
ActuatorsBussTwiBlmcSend(); \
|
||||
} \
|
||||
else \
|
||||
buss_twi_blmc_nb_err++; \
|
||||
}
|
||||
|
||||
#define SERVOS_TICS_OF_USEC(s) ((uint8_t)(s))
|
||||
|
||||
#define BUSS_TWI_BLMC_STATUS_IDLE 0
|
||||
#define BUSS_TWI_BLMC_STATUS_BUSY 1
|
||||
#define BUSS_TWI_BLMC_NB 4
|
||||
extern uint8_t buss_twi_blmc_motor_power[BUSS_TWI_BLMC_NB];
|
||||
extern volatile bool_t buss_twi_blmc_status;
|
||||
extern volatile bool_t buss_twi_blmc_i2c_done;
|
||||
extern volatile uint8_t buss_twi_blmc_nb_err;
|
||||
extern volatile uint8_t buss_twi_blmc_idx;
|
||||
extern const uint8_t buss_twi_blmc_addr[];
|
||||
|
||||
#define ActuatorsBussTwiBlmcNext() { \
|
||||
/* buss_twi_blmc_idx++; */ \
|
||||
/* if (buss_twi_blmc_idx < BUSS_TWI_BLMC_NB) { */ \
|
||||
/* ActuatorsBussTwiBlmcSend(); */ \
|
||||
/* } */ \
|
||||
/* else */ \
|
||||
buss_twi_blmc_status = BUSS_TWI_BLMC_STATUS_IDLE; \
|
||||
}
|
||||
|
||||
#define ActuatorsBussTwiBlmcSend() { \
|
||||
const uint8_t msg[] = { buss_twi_blmc_addr[buss_twi_blmc_idx], \
|
||||
buss_twi_blmc_motor_power[buss_twi_blmc_idx]}; \
|
||||
memcpy((void*)i2c_buf, msg, sizeof(msg)); \
|
||||
i2c_transmit(buss_twi_blmc_addr[buss_twi_blmc_idx], sizeof(msg), &buss_twi_blmc_i2c_done); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* ACTUATORS_BUSS_TWI_BLMC_HW_H */
|
||||
@@ -16,6 +16,18 @@
|
||||
#define I2C_SCLH 200
|
||||
#endif
|
||||
|
||||
#ifndef I2C_VIC_SLOT
|
||||
#define I2C_VIC_CNTL VICVectCntl9
|
||||
#define I2C_VIC_ADDR VICVectAddr9
|
||||
#else
|
||||
#define __I2C_VIC_CNTL(idx) VICVectCntl##idx
|
||||
#define __I2C_VIC_ADDR(idx) VICVectAddr##idx
|
||||
#define _I2C_VIC_CNTL(idx) __I2C_VIC_CNTL(idx)
|
||||
#define _I2C_VIC_ADDR(idx) __I2C_VIC_ADDR(idx)
|
||||
#define I2C_VIC_CNTL _I2C_VIC_CNTL(I2C_VIC_SLOT)
|
||||
#define I2C_VIC_ADDR _I2C_VIC_ADDR(I2C_VIC_SLOT)
|
||||
#endif
|
||||
|
||||
void i2c0_ISR(void) __attribute__((naked));
|
||||
|
||||
|
||||
@@ -36,8 +48,8 @@ void i2c_hw_init ( void ) {
|
||||
// initialize the interrupt vector
|
||||
VICIntSelect &= ~VIC_BIT(VIC_I2C0); // I2C0 selected as IRQ
|
||||
VICIntEnable = VIC_BIT(VIC_I2C0); // I2C0 interrupt enabled
|
||||
VICVectCntl9 = VIC_ENABLE | VIC_I2C0;
|
||||
VICVectAddr9 = (uint32_t)i2c0_ISR; // address of the ISR
|
||||
I2C_VIC_CNTL = VIC_ENABLE | VIC_I2C0;
|
||||
I2C_VIC_ADDR = (uint32_t)i2c0_ISR; // address of the ISR
|
||||
}
|
||||
|
||||
#define I2C_DATA_REG I2C0DAT
|
||||
|
||||
@@ -4,10 +4,22 @@
|
||||
|
||||
#include "LPC21xx.h"
|
||||
|
||||
#ifdef USE_BUSS_TWI_BLMC
|
||||
#include "actuators_buss_twi_blmc_hw.h"
|
||||
#define I2cStopHandler() ActuatorsBussTwiBlmcNext()
|
||||
#else
|
||||
#define I2cStopHandler() {}
|
||||
#endif
|
||||
|
||||
extern void i2c_hw_init(void);
|
||||
|
||||
#define I2cSendAck() { I2C0CONSET = _BV(AA); }
|
||||
#define I2cSendStop() { I2C0CONSET = _BV(STO); if (i2c_finished) *i2c_finished = TRUE; i2c_status = I2C_IDLE; }
|
||||
#define I2cSendStop() { \
|
||||
I2C0CONSET = _BV(STO); \
|
||||
if (i2c_finished) *i2c_finished = TRUE; \
|
||||
i2c_status = I2C_IDLE; \
|
||||
I2cStopHandler(); \
|
||||
}
|
||||
#define I2cSendStart() { I2C0CONSET = _BV(STA); }
|
||||
#define I2cSendByte(b) { I2C_DATA_REG = b; }
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ void booz_autopilot_init(void) {
|
||||
}
|
||||
|
||||
void booz_autopilot_periodic_task(void) {
|
||||
|
||||
switch (booz_autopilot_mode) {
|
||||
case BOOZ_AP_MODE_FAILSAFE:
|
||||
SetCommands(commands_failsafe);
|
||||
@@ -27,3 +28,15 @@ void booz_autopilot_periodic_task(void) {
|
||||
}
|
||||
|
||||
|
||||
void booz_autopilot_event_task(void) {
|
||||
|
||||
switch (booz_autopilot_mode) {
|
||||
case BOOZ_AP_MODE_RATE:
|
||||
booz_control_rate_compute_setpoints();
|
||||
break;
|
||||
case BOOZ_AP_MODE_ATTITUDE:
|
||||
booz_control_attitude_compute_setpoints();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,10 +11,14 @@
|
||||
extern uint8_t booz_autopilot_mode;
|
||||
|
||||
extern void booz_autopilot_init(void);
|
||||
void booz_autopilot_periodic_task(void);
|
||||
|
||||
|
||||
|
||||
extern void booz_autopilot_periodic_task(void);
|
||||
extern void booz_autopilot_event_task(void);
|
||||
|
||||
#define TRESHOLD_RATE_PPRZ (MIN_PPRZ / 2)
|
||||
#define TRESHOLD_ATTITUDE_PPRZ (MAX_PPRZ/2)
|
||||
#define BOOZ_AP_MODE_OF_PPRZ(mode) \
|
||||
((mode) < TRESHOLD_RATE_PPRZ ? BOOZ_AP_MODE_RATE : \
|
||||
(mode) < TRESHOLD_ATTITUDE_PPRZ ? BOOZ_AP_MODE_ATTITUDE : \
|
||||
BOOZ_AP_MODE_ATTITUDE )
|
||||
|
||||
#endif /* BOOZ_AUTOPILOT_H */
|
||||
|
||||
@@ -18,11 +18,11 @@ float booz_control_rate_last_err_r;
|
||||
|
||||
pprz_t booz_control_commands[COMMANDS_NB];
|
||||
|
||||
#define BOOZ_CONTROL_RATE_PQ_PGAIN -1000.
|
||||
#define BOOZ_CONTROL_RATE_PQ_DGAIN 0.
|
||||
#define BOOZ_CONTROL_RATE_PQ_PGAIN -350.
|
||||
#define BOOZ_CONTROL_RATE_PQ_DGAIN 30.
|
||||
|
||||
#define BOOZ_CONTROL_RATE_R_PGAIN -100.
|
||||
#define BOOZ_CONTROL_RATE_R_DGAIN 0.
|
||||
#define BOOZ_CONTROL_RATE_R_PGAIN -170.
|
||||
#define BOOZ_CONTROL_RATE_R_DGAIN 10.
|
||||
|
||||
/* setpoints for max stick throw in degres per second */
|
||||
#define BOOZ_CONTROL_RATE_PQ_MAX_SP 200.
|
||||
@@ -34,8 +34,8 @@ float booz_control_theta_sp;
|
||||
float booz_control_attitude_phi_theta_pgain;
|
||||
float booz_control_attitude_phi_theta_dgain;
|
||||
|
||||
#define BOOZ_CONTROL_ATTITUDE_PHI_THETA_PGAIN -15000.
|
||||
#define BOOZ_CONTROL_ATTITUDE_PHI_THETA_DGAIN -15000.
|
||||
#define BOOZ_CONTROL_ATTITUDE_PHI_THETA_PGAIN -1200.
|
||||
#define BOOZ_CONTROL_ATTITUDE_PHI_THETA_DGAIN -600.
|
||||
|
||||
/* setpoints for max stick throw in degres */
|
||||
#define BOOZ_CONTROL_ATTITUDE_PHI_THETA_MAX_SP 30.
|
||||
|
||||
@@ -13,18 +13,24 @@
|
||||
#include "booz_autopilot.h"
|
||||
#include "booz_control.h"
|
||||
|
||||
#include "actuators_buss_twi_blmc_hw.h"
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
#include "downlink.h"
|
||||
|
||||
#define PERIODIC_SEND_BOOZ_STATUS() DOWNLINK_SEND_BOOZ_STATUS(&link_imu_nb_err, &link_imu_status, &rc_status, &booz_autopilot_mode)
|
||||
#define PERIODIC_SEND_BOOZ_STATUS() DOWNLINK_SEND_BOOZ_STATUS(&link_imu_nb_err, &link_imu_status, &rc_status, &booz_autopilot_mode, &buss_twi_blmc_idx, &cpu_time_sec, &buss_twi_blmc_nb_err)
|
||||
#define PERIODIC_SEND_BOOZ_FD() DOWNLINK_SEND_BOOZ_FD(&booz_estimator_p, &booz_estimator_q, &booz_estimator_r,\
|
||||
&booz_estimator_phi, &booz_estimator_theta, &booz_estimator_psi);
|
||||
#define PERIODIC_SEND_BOOZ_DEBUG() DOWNLINK_SEND_BOOZ_DEBUG(&booz_control_p_sp, &booz_control_q_sp, &booz_control_r_sp, &booz_control_power_sp);
|
||||
|
||||
#define PERIODIC_SEND_ACTUATORS() DOWNLINK_SEND_ACTUATORS(SERVOS_NB, actuators);
|
||||
|
||||
#define PERIODIC_SEND_BOOZ_RATE_LOOP() DOWNLINK_SEND_BOOZ_RATE_LOOP(&booz_estimator_p, &booz_control_p_sp, &booz_estimator_q, &booz_control_q_sp, &booz_estimator_r, &booz_control_r_sp );
|
||||
|
||||
#define PERIODIC_SEND_BOOZ_ATT_LOOP() DOWNLINK_SEND_BOOZ_ATT_LOOP(&booz_estimator_phi, &booz_control_phi_sp, &booz_estimator_theta, &booz_control_theta_sp);
|
||||
|
||||
|
||||
#define PERIODIC_SEND_DL_VALUE() PeriodicSendDlValue()
|
||||
|
||||
extern uint8_t telemetry_mode_Main;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "led.h"
|
||||
|
||||
#include "commands.h"
|
||||
#include "i2c.h"
|
||||
#include "actuators.h"
|
||||
#include "radio_control.h"
|
||||
|
||||
@@ -28,6 +29,7 @@ static inline void main_event_task( void );
|
||||
int16_t trim_p = 0;
|
||||
int16_t trim_q = 0;
|
||||
int16_t trim_r = 0;
|
||||
uint8_t vbat = 0;
|
||||
|
||||
int main( void ) {
|
||||
main_init();
|
||||
@@ -44,6 +46,7 @@ static inline void main_init( void ) {
|
||||
led_init();
|
||||
sys_time_init();
|
||||
|
||||
i2c_init();
|
||||
actuators_init();
|
||||
SetCommands(commands_failsafe);
|
||||
|
||||
@@ -60,6 +63,8 @@ static inline void main_init( void ) {
|
||||
uart1_init_tx();
|
||||
|
||||
int_enable();
|
||||
|
||||
DOWNLINK_SEND_BOOT(&cpu_time_sec);
|
||||
}
|
||||
|
||||
static inline void main_periodic_task( void ) {
|
||||
@@ -103,12 +108,10 @@ static inline void main_event_task( void ) {
|
||||
if (ppm_valid) {
|
||||
ppm_valid = FALSE;
|
||||
radio_control_event_task();
|
||||
// if (rc_values_contains_avg_channels) {
|
||||
// fbw_mode = FBW_MODE_OF_PPRZ(rc_values[RADIO_MODE]);
|
||||
// }
|
||||
booz_autopilot_mode = BOOZ_AP_MODE_RATE;
|
||||
/* setpoints */
|
||||
booz_control_rate_compute_setpoints();
|
||||
if (rc_values_contains_avg_channels) {
|
||||
booz_autopilot_mode = BOOZ_AP_MODE_OF_PPRZ(rc_values[RADIO_MODE]);
|
||||
}
|
||||
booz_autopilot_event_task();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ extern uint8_t ck_a, ck_b;
|
||||
#define PprzTransportHeader(payload_len) { \
|
||||
PprzTransportPut1Byte(STX); \
|
||||
uint8_t msg_len = PprzTransportSizeOf(payload_len); \
|
||||
PprzTransportPut1Byte(msg_len); \
|
||||
PprzTransportPut1Byte(msg_len); \
|
||||
ck_a = msg_len; ck_b = msg_len; \
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
struct BoozFlightModel bfm;
|
||||
|
||||
//static void motor_model_run( double dt );
|
||||
//static void motor_model_derivative(VEC* x, VEC* u, VEC* xdot);
|
||||
|
||||
static VEC* booz_get_forces_body_frame( VEC* X, VEC* M, MAT* dcm, VEC* omega_square);
|
||||
@@ -19,6 +18,7 @@ static VEC* booz_get_moments_body_frame( VEC* X, VEC* M, VEC* omega_square );
|
||||
static void booz_flight_model_get_derivatives(VEC* X, VEC* u, VEC* Xdot);
|
||||
|
||||
void booz_flight_model_init( void ) {
|
||||
bfm.time = 0.;
|
||||
bfm.bat_voltage = BAT_VOLTAGE;
|
||||
bfm.mot_voltage = v_get(SERVOS_NB);
|
||||
|
||||
@@ -39,10 +39,10 @@ void booz_flight_model_init( void ) {
|
||||
bfm.props_moment_matrix->me[AXIS_X][SERVO_MOTOR_RIGHT] = -L * bfm.thrust_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Y][SERVO_MOTOR_BACK] = -L * bfm.thrust_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Y][SERVO_MOTOR_FRONT] = L * bfm.thrust_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_LEFT] = -bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_RIGHT] = -bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_BACK] = bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_FRONT] = bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_LEFT] = bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_RIGHT] = bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_BACK] = -bfm.torque_factor;
|
||||
bfm.props_moment_matrix->me[AXIS_Z][SERVO_MOTOR_FRONT] = -bfm.torque_factor;
|
||||
|
||||
bfm.Inert = m_get(AXIS_NB, AXIS_NB);
|
||||
m_zero(bfm.Inert);
|
||||
@@ -64,8 +64,9 @@ void booz_flight_model_run( double dt, double* commands ) {
|
||||
int i;
|
||||
for (i=0; i<SERVOS_NB; i++)
|
||||
bfm.mot_voltage->ve[i] = bfm.bat_voltage * commands[i];
|
||||
// motor_model_run(dt);
|
||||
rk4(booz_flight_model_get_derivatives, bfm.state, bfm.mot_voltage, dt);
|
||||
// rk4(motor_model_derivative, bfm.mot_omega, bfm.mot_voltage, dt);
|
||||
rk4(booz_flight_model_get_derivatives, bfm.state, bfm.mot_voltage, dt);
|
||||
bfm.time += dt;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,10 +224,6 @@ static void booz_flight_model_get_derivatives(VEC* X, VEC* u, VEC* Xdot) {
|
||||
|
||||
|
||||
#if 0
|
||||
static void motor_model_run( double dt ) {
|
||||
rk4(motor_model_derivative, bfm.mot_omega, bfm.mot_voltage, dt);
|
||||
}
|
||||
|
||||
static void motor_model_derivative(VEC* x, VEC* u, VEC* xdot) {
|
||||
static VEC *temp1 = VNULL;
|
||||
static VEC *temp2 = VNULL;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
|
||||
struct BoozFlightModel {
|
||||
double time;
|
||||
/* battery voltage in V */
|
||||
double bat_voltage;
|
||||
/* motors supply voltage in V */
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
#define BOOZ_FLIGHT_MODEL_PARAMS_H
|
||||
|
||||
/* drag coefficient of the body */
|
||||
#define C_d_body .2
|
||||
#define C_d_body .005
|
||||
/* thrust aerodynamic coefficient */
|
||||
#define C_t 0.132
|
||||
#define C_t 0.297
|
||||
/* moment aerodynamic coefficient */
|
||||
#define C_q 0.01
|
||||
#define C_q 0.0276
|
||||
/* propeller radius in m */
|
||||
#define PROP_RADIUS 0.125
|
||||
/* propeller area in m2 */
|
||||
#define PROP_AREA (M_PI * PROP_RADIUS * PROP_RADIUS)
|
||||
#define PROP_AREA 0.005
|
||||
/* air density in kg/m3 */
|
||||
#define RHO 1.225
|
||||
/* gravity in m/s2 */
|
||||
#define G 9.81
|
||||
/* mass in kg */
|
||||
#define MASS 0.5
|
||||
/* inertia on x axis in m2 */
|
||||
#define Ix .5
|
||||
/* inertia on y axis in m2 */
|
||||
#define Iy .5
|
||||
/* inertia on z axis in m2 */
|
||||
#define Iz 1.
|
||||
/* inertia on x axis in kg * m2 */
|
||||
#define Ix .007
|
||||
/* inertia on y axis in kg * m2 */
|
||||
#define Iy .0137
|
||||
/* inertia on z axis in kg * m2 */
|
||||
#define Iz .0073
|
||||
/* lenght between centers of vehicle and prop in m */
|
||||
#define L 0.25
|
||||
/* height between cg and prop plane in m */
|
||||
@@ -38,9 +38,9 @@
|
||||
*/
|
||||
#define BAT_VOLTAGE 11.
|
||||
|
||||
#define THAU 25.
|
||||
#define Kq 0.02
|
||||
#define Kv 1500.
|
||||
#define THAU 10.
|
||||
#define Kq 0.0079
|
||||
#define Kv 1000.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,12 +44,14 @@ void booz_flightgear_send() {
|
||||
|
||||
gui.latitude = lat;
|
||||
gui.longitude = lon;
|
||||
gui.altitude = 10 - bfm.state->ve[BFMS_Z];
|
||||
gui.altitude = 30 - bfm.state->ve[BFMS_Z];
|
||||
|
||||
gui.phi = bfm.state->ve[BFMS_PHI];
|
||||
gui.theta = bfm.state->ve[BFMS_THETA];
|
||||
gui.psi = bfm.state->ve[BFMS_PSI];
|
||||
|
||||
gui.cur_time += (unsigned long)bfm.time;
|
||||
|
||||
if (sendto(fg_socket, (char*)(&gui), sizeof(gui), 0,
|
||||
(struct sockaddr*)&fg_addr, sizeof(fg_addr)) == -1)
|
||||
printf("error sending\n");
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
#include <Ivy/ivy.h>
|
||||
#include <Ivy/ivyglibloop.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "booz_flight_model.h"
|
||||
#include "booz_flightgear.h"
|
||||
|
||||
|
||||
|
||||
char* fg_host = "127.0.0.1";
|
||||
//char* fg_host = "10.31.4.107";
|
||||
//char* fg_host = "127.0.0.1";
|
||||
char* fg_host = "10.31.4.107";
|
||||
unsigned int fg_port = 5501;
|
||||
|
||||
/* 250Hz <-> 4ms */
|
||||
@@ -20,7 +22,6 @@ double sim_time;
|
||||
#define DT_DISPLAY 0.04
|
||||
double disp_time;
|
||||
|
||||
|
||||
double foo_commands[] = {0., 0., 0., 0.};
|
||||
|
||||
static gboolean timeout_callback(gpointer data);
|
||||
@@ -40,6 +41,9 @@ static void airborne_periodic_task(void);
|
||||
static void airborne_event_task(void);
|
||||
|
||||
#include "booz_estimator.h"
|
||||
#include "radio_control.h"
|
||||
volatile bool_t ppm_valid;
|
||||
#define RPM_OF_RAD_S(a) ((a)*60./M_PI)
|
||||
|
||||
static gboolean timeout_callback(gpointer data) {
|
||||
|
||||
@@ -49,6 +53,11 @@ static gboolean timeout_callback(gpointer data) {
|
||||
if (sim_time >= disp_time) {
|
||||
disp_time+= DT_DISPLAY;
|
||||
booz_flightgear_send();
|
||||
IvySendMsg("148 BOOZ_RPMS %f %f %f %f",
|
||||
RPM_OF_RAD_S(bfm.state->ve[BFMS_OM_F]),
|
||||
RPM_OF_RAD_S(bfm.state->ve[BFMS_OM_B]),
|
||||
RPM_OF_RAD_S(bfm.state->ve[BFMS_OM_L]),
|
||||
RPM_OF_RAD_S(bfm.state->ve[BFMS_OM_R]) );
|
||||
}
|
||||
|
||||
booz_estimator_p = bfm.state->ve[BFMS_P];
|
||||
@@ -59,7 +68,10 @@ static gboolean timeout_callback(gpointer data) {
|
||||
booz_estimator_theta = bfm.state->ve[BFMS_THETA];
|
||||
booz_estimator_psi = bfm.state->ve[BFMS_PSI];
|
||||
|
||||
/* post a radio control event */
|
||||
ppm_valid = TRUE;
|
||||
airborne_event_task();
|
||||
|
||||
airborne_periodic_task();
|
||||
|
||||
|
||||
@@ -125,7 +137,7 @@ int main ( int argc, char** argv) {
|
||||
#include <linux/joystick.h>
|
||||
|
||||
static void joystick_init(void) {
|
||||
const char* device = "/dev/input/js1";
|
||||
const char* device = "/dev/input/js0";
|
||||
int fd = open(device, O_RDONLY | O_NONBLOCK);
|
||||
if (fd == -1) {
|
||||
printf("opening joystick serial device %s : %s\n", device, strerror(errno));
|
||||
@@ -231,6 +243,11 @@ uint16_t ppm_pulses[PPM_NB_PULSES];
|
||||
|
||||
|
||||
static void airborne_init(void) {
|
||||
ppm_pulses[RADIO_THROTTLE] = 1223 + 0.62 * (2050-1223);
|
||||
ppm_pulses[RADIO_PITCH] = 1498 + 0. * (2050-950);
|
||||
ppm_pulses[RADIO_ROLL] = 1500 + 0. * (2050-950);
|
||||
ppm_pulses[RADIO_YAW] = 1500 + 0. * (2050-950);
|
||||
ppm_pulses[RADIO_MODE] = 1500 + 0.25 * (2050-950);
|
||||
|
||||
ppm_init();
|
||||
radio_control_init();
|
||||
@@ -244,6 +261,18 @@ static void airborne_init(void) {
|
||||
|
||||
static void airborne_periodic_task(void) {
|
||||
|
||||
#if 0
|
||||
int foo = sim_time/10;
|
||||
if (!(foo%2)) {
|
||||
ppm_pulses[RADIO_YAW] = 1500 + 0.1 * (2050-950);
|
||||
ppm_pulses[RADIO_PITCH] = 1498 + 0. * (2050-950);
|
||||
}
|
||||
else {
|
||||
ppm_pulses[RADIO_YAW] = 1500 - 0. * (2050-950);
|
||||
ppm_pulses[RADIO_PITCH] = 1498 + 0.1 * (2050-950);
|
||||
}
|
||||
#endif
|
||||
|
||||
booz_autopilot_periodic_task();
|
||||
|
||||
SetActuatorsFromCommands(commands);
|
||||
@@ -277,15 +306,16 @@ static void airborne_event_task(void) {
|
||||
|
||||
// DlEventCheckAndHandle();
|
||||
|
||||
// if (ppm_valid) {
|
||||
// ppm_valid = FALSE;
|
||||
radio_control_event_task();
|
||||
booz_autopilot_mode = BOOZ_AP_MODE_ATTITUDE;
|
||||
if (booz_autopilot_mode == BOOZ_AP_MODE_RATE)
|
||||
booz_control_rate_compute_setpoints();
|
||||
else if (booz_autopilot_mode == BOOZ_AP_MODE_ATTITUDE)
|
||||
booz_control_attitude_compute_setpoints();
|
||||
//}
|
||||
if (ppm_valid) {
|
||||
ppm_valid = FALSE;
|
||||
radio_control_event_task();
|
||||
booz_autopilot_mode = BOOZ_AP_MODE_ATTITUDE;
|
||||
if (rc_values_contains_avg_channels) {
|
||||
booz_autopilot_mode = BOOZ_AP_MODE_OF_PPRZ(rc_values[RADIO_MODE]);
|
||||
}
|
||||
booz_autopilot_event_task();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -299,6 +329,7 @@ static void airborne_event_task(void) {
|
||||
#define JS_ROLL 0
|
||||
#define JS_PITCH 1
|
||||
#define JS_YAW 5
|
||||
#define JS_MODE 2
|
||||
|
||||
static gboolean on_js_data_received(GIOChannel *source, GIOCondition condition, gpointer data) {
|
||||
|
||||
@@ -322,6 +353,10 @@ static gboolean on_js_data_received(GIOChannel *source, GIOCondition condition,
|
||||
case JS_YAW:
|
||||
ppm_pulses[RADIO_YAW] = 1500 + (js.value - 112) * (float)(2050-950) / (float)(224 - 1);
|
||||
break;
|
||||
case JS_MODE:
|
||||
ppm_pulses[RADIO_MODE] = 1500 + (js.value - 112) * (float)(2050-950) / (float)(224 - 1);
|
||||
rc_values_contains_avg_channels = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user