Browse Source

pwm: change default_value for all boards from 1000 to 0

the value '1000' is not really magic, and it was resulting in sending
a single 1ms pulse on all IO channels for a brief instant on
startup. With some servos this led to the control surfaces being at
extremes (and straining) on startup. It may also contribute to making
ESC calibration harder on multi-rotors

In the worst case it could cause a IC motor with reverse throttle to
go full throttle on startup

A logic analyser shows the problem very clearly. Changing the
default_value fields to 0 from 1000 fixes the issue and no pulses are
generated until an explicit value suitable for the airframe is
provided via one of the many methods PWM output values can be
generated

Conflicts:
	src/drivers/boards/px4fmu-v4/px4fmu_pwm_servo.c
	src/lib/ecl
sbg
Andrew Tridgell 9 years ago committed by Lorenz Meier
parent
commit
b8a60f2501
  1. 8
      src/drivers/boards/px4fmu-v1/px4fmu_pwm_servo.c
  2. 12
      src/drivers/boards/px4fmu-v2/px4fmu_pwm_servo.c
  3. 12
      src/drivers/boards/px4fmu-v4/px4fmu_pwm_servo.c
  4. 16
      src/drivers/boards/px4io-v1/px4io_pwm_servo.c
  5. 16
      src/drivers/boards/px4io-v2/px4io_pwm_servo.c

8
src/drivers/boards/px4fmu-v1/px4fmu_pwm_servo.c

@ -64,24 +64,24 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = { @@ -64,24 +64,24 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = {
.gpio = GPIO_TIM2_CH1OUT,
.timer_index = 0,
.timer_channel = 1,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM2_CH2OUT,
.timer_index = 0,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM2_CH3OUT,
.timer_index = 0,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM2_CH4OUT,
.timer_index = 0,
.timer_channel = 4,
.default_value = 1000,
.default_value = 0,
}
};

12
src/drivers/boards/px4fmu-v2/px4fmu_pwm_servo.c

@ -70,36 +70,36 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = { @@ -70,36 +70,36 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = {
.gpio = GPIO_TIM1_CH4OUT,
.timer_index = 0,
.timer_channel = 4,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM1_CH3OUT,
.timer_index = 0,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM1_CH2OUT,
.timer_index = 0,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM1_CH1OUT,
.timer_index = 0,
.timer_channel = 1,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH2OUT,
.timer_index = 1,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH3OUT,
.timer_index = 1,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
}
};

12
src/drivers/boards/px4fmu-v4/px4fmu_pwm_servo.c

@ -70,36 +70,36 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = { @@ -70,36 +70,36 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = {
.gpio = GPIO_TIM1_CH4OUT,
.timer_index = 0,
.timer_channel = 4,
.default_value = 900,
.default_value = 0,
},
{
.gpio = GPIO_TIM1_CH3OUT,
.timer_index = 0,
.timer_channel = 3,
.default_value = 900,
.default_value = 0,
},
{
.gpio = GPIO_TIM1_CH2OUT,
.timer_index = 0,
.timer_channel = 2,
.default_value = 900,
.default_value = 0,
},
{
.gpio = GPIO_TIM1_CH1OUT,
.timer_index = 0,
.timer_channel = 1,
.default_value = 900,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH2OUT,
.timer_index = 1,
.timer_channel = 2,
.default_value = 900,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH3OUT,
.timer_index = 1,
.timer_channel = 3,
.default_value = 900,
.default_value = 0,
}
};

16
src/drivers/boards/px4io-v1/px4io_pwm_servo.c

@ -76,48 +76,48 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = { @@ -76,48 +76,48 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = {
.gpio = GPIO_TIM2_CH1OUT,
.timer_index = 0,
.timer_channel = 1,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM2_CH2OUT,
.timer_index = 0,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH3OUT,
.timer_index = 2,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH4OUT,
.timer_index = 2,
.timer_channel = 4,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH1OUT,
.timer_index = 1,
.timer_channel = 1,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH2OUT,
.timer_index = 1,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH3OUT,
.timer_index = 1,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH4OUT,
.timer_index = 1,
.timer_channel = 4,
.default_value = 1000,
.default_value = 0,
}
};

16
src/drivers/boards/px4io-v2/px4io_pwm_servo.c

@ -76,48 +76,48 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = { @@ -76,48 +76,48 @@ __EXPORT const struct pwm_servo_channel pwm_channels[PWM_SERVO_MAX_CHANNELS] = {
.gpio = GPIO_TIM2_CH1OUT,
.timer_index = 0,
.timer_channel = 1,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM2_CH2OUT,
.timer_index = 0,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH3OUT,
.timer_index = 2,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM4_CH4OUT,
.timer_index = 2,
.timer_channel = 4,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH1OUT,
.timer_index = 1,
.timer_channel = 1,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH2OUT,
.timer_index = 1,
.timer_channel = 2,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH3OUT,
.timer_index = 1,
.timer_channel = 3,
.default_value = 1000,
.default_value = 0,
},
{
.gpio = GPIO_TIM3_CH4OUT,
.timer_index = 1,
.timer_channel = 4,
.default_value = 1000,
.default_value = 0,
}
};

Loading…
Cancel
Save