crazyflie: fix PWM channel ordering

Channels belonging to a certain timer were not all grouped together.
This is required by the .first_channel_index and .last_channel_index data
members.

We introduce a new mixer geometry to solve the problem.
This commit is contained in:
Beat Küng
2020-01-13 10:57:31 +01:00
committed by David Sidrane
parent 17ab617877
commit 73bd90ddd5
6 changed files with 47 additions and 10 deletions
@@ -17,7 +17,7 @@
# #
sh /etc/init.d/rc.mc_defaults sh /etc/init.d/rc.mc_defaults
set MIXER quad_x set MIXER quad_x_cw
set PWM_OUT 1234 set PWM_OUT 1234
if [ $AUTOCNF = yes ] if [ $AUTOCNF = yes ]
then then
@@ -71,6 +71,7 @@ px4_add_romfs_files(
quad_+_vtol.main.mix quad_+_vtol.main.mix
quad_w.main.mix quad_w.main.mix
quad_x.main.mix quad_x.main.mix
quad_x_cw.main.mix
quad_x_vtol.main.mix quad_x_vtol.main.mix
stampede.main.mix stampede.main.mix
tri_y_yaw-.main.mix tri_y_yaw-.main.mix
@@ -0,0 +1,5 @@
# @board px4_fmu-v2 exclude
# Quad X with clock-wise motor assigment
R: 4xcw 10000 10000 10000 0
+9 -9
View File
@@ -92,6 +92,15 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
.ccr_offset = STM32_GTIM_CCR2_OFFSET, .ccr_offset = STM32_GTIM_CCR2_OFFSET,
.masks = GTIM_SR_CC2IF | GTIM_SR_CC2OF .masks = GTIM_SR_CC2IF | GTIM_SR_CC2OF
}, },
{
// M2
.gpio_out = GPIO_TIM2_CH4OUT,
.gpio_in = GPIO_TIM2_CH4IN,
.timer_index = 0,
.timer_channel = 4,
.ccr_offset = STM32_GTIM_CCR4_OFFSET,
.masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF
},
{ {
// M3 // M3
.gpio_out = GPIO_TIM2_CH1OUT, .gpio_out = GPIO_TIM2_CH1OUT,
@@ -110,13 +119,4 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
.ccr_offset = STM32_GTIM_CCR4_OFFSET, .ccr_offset = STM32_GTIM_CCR4_OFFSET,
.masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF .masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF
}, },
{
// M2
.gpio_out = GPIO_TIM2_CH4OUT,
.gpio_in = GPIO_TIM2_CH4IN,
.timer_index = 0,
.timer_channel = 4,
.ccr_offset = STM32_GTIM_CCR4_OFFSET,
.masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF
},
}; };
@@ -48,6 +48,7 @@ set(geometry_files
quad_s250aq.toml quad_s250aq.toml
quad_vtail.toml quad_vtail.toml
quad_wide.toml quad_wide.toml
quad_x_cw.toml
quad_x.toml quad_x.toml
quad_x_pusher.toml quad_x_pusher.toml
quad_y.toml quad_y.toml
@@ -0,0 +1,30 @@
# Generic Quadcopter in X configuration
# with clock-wise motor numbering
[info]
key = "4xcw"
description = "Quadcopter in X configuration with clock-wise motor numbering"
[rotor_default]
direction = "CW"
axis = [0.0, 0.0, -1.0]
Ct = 1.0
Cm = 0.05
[[rotors]]
name = "front_right"
position = [0.707107, 0.707107, 0.0]
direction = "CCW"
[[rotors]]
name = "rear_right"
position = [-0.707107, 0.707107, 0.0]
[[rotors]]
name = "rear_left"
position = [-0.707107, -0.707107, 0.0]
direction = "CCW"
[[rotors]]
name = "front_left"
position = [0.707107, -0.707107, 0.0]