Naze32 AirPlane no Servo Output

markus2066

New member
Hi All,

I am scratch building my first plane and have an old naze32 running betaflight 3.2.1 (most recent compatible version) which I am hoping to use for stabilisation, my tx/rx is a Turnigy 9X. I can see the output from the rx register in the in the "receiver" tab of baseflight, I have selected the "airplane" mode from the config menu. No matter what I do I don't seem to be able to get the servo's to move at all, all servos work fine when connected directly to the receiver. The motor/esc responds when connected to the naze, a servo will respond when connected to the the output for the motor.

I should be able to post a dump from my config tomorrow but does anyone have any suggestions as to what might be the issues here? I'm hoping this is something simple like a box i havn't ticked somewhere but info for plane setup on the naze is understandably difficult to come across.

Thanks

Mark
 

markus2066

New member
First apologies for the low quality late night post, things were getting desperate.

But just for record I managed to resolve this issue after finding this link.

May still need some tweaking but the following CLi commands allowed me to configure a motor and 4 servo outputs (for which outputs see below) and map them physical outputs 2-6:

mmix reset
mmix 0 1 0 0 0 0

smix reset
smix 0 2 0 100 0 0 100 0
smix 1 3 0 100 0 0 100 0
smix 2 4 1 100 0 0 100 0
smix 3 5 2 100 0 0 100 0

resource MOTOR 1 A11
resource SERVO 1 B06
resource SERVO 2 B07
resource SERVO 3 B08
resource SERVO 4 B09

Result
Yaw = OUT6
Roll = OUT3/4
Elevator = OUT5
Throttle = OUT2

For Naze32 rev6:

const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH1, A0, TIM_USE_PPM | TIM_USE_PWM, 0), // PWM1 - RC1
DEF_TIM(TIM2, CH2, A01, TIM_USE_PWM, 0), // PWM2 - RC2
DEF_TIM(TIM2, CH3, A02, TIM_USE_PWM, 0), // PWM3 - RC3
DEF_TIM(TIM2, CH4, A03, TIM_USE_PWM, 0), // PWM4 - RC4
DEF_TIM(TIM3, CH1, A06, TIM_USE_PWM | TIM_USE_LED, 0), // PWM5 - RC5
DEF_TIM(TIM3, CH2, A07, TIM_USE_PWM, 0), // PWM6 - RC6
DEF_TIM(TIM3, CH3, B0, TIM_USE_PWM, 0), // PWM7 - RC7
DEF_TIM(TIM3, CH4, B01, TIM_USE_PWM, 0), // PWM8 - RC8
DEF_TIM(TIM1, CH1, A08, TIM_USE_MOTOR, 0), // PWM9 - OUT1
DEF_TIM(TIM1, CH4, A11, TIM_USE_MOTOR, 0), // PWM10 - OUT2
DEF_TIM(TIM4, CH1, B06, TIM_USE_MOTOR, 0), // PWM11 - OUT3
DEF_TIM(TIM4, CH2, B07, TIM_USE_MOTOR, 0), // PWM12 - OUT4
DEF_TIM(TIM4, CH3, B08, TIM_USE_MOTOR, 0), // PWM13 - OUT5
DEF_TIM(TIM4, CH4, B09, TIM_USE_MOTOR, 0), // PWM14 - OUT6
 
Im doing the same thing and having the same problem. how and what exactly do I need to change in my cli to make the servos respond on pwm 3and 4 output pads?
20201018_154301.jpg
 

markus2066

New member
Hi Vinnie,

Sorry totally forgot to respond to this.

You need to head into the cleanflight/baseflight UI (they both have this option) and set it from "quad" to "custom airplane" mode.

Then head over to the cli and paste in:

mmix reset
mmix 0 1 0 0 0 0

smix reset
smix 0 2 0 100 0 0 100 0
smix 1 3 0 100 0 0 100 0
smix 2 4 1 100 0 0 100 0
smix 3 5 2 100 0 0 100 0

resource MOTOR 1 A11
resource SERVO 1 B06
resource SERVO 2 B07
resource SERVO 3 B08
resource SERVO 4 B09

Then connect the servo's/motor as follows:

Yaw = OUT6
Roll = OUT3/4
Elevator = OUT5
Throttle = OUT2
Not Connected = OUT1

You can find more info on these commands in the manuals. I understand them somewhat so in a nutshell:



# Mixing Motors = I think this part sets how much powering up a specific motor will cause either Throttle, Roll, Pitch, Yaw input. For mine to have configured a single rule (rule 0) that says this motor will have no impact on Throttle, Roll, Pitch, Yaw input. Perhaps on a traditional plane with large prop this may introduce some roll input, but I will see soon enough also learning fast here ;)
#mmix Motor No. Thr Roll Pitch Yaw
mmix reset
mmix 0 1 0 0 0 0

# Servo Mixing = Syntax below, this sets the speed, mix/max points which the servo will move to.
# smix <rule> <servo> <source> <rate> <speed> <min> <max> <box>
smix reset
smix 0 2 0 100 0 0 100 0
smix 1 3 0 100 0 0 100 0
smix 2 4 1 100 0 0 100 0
smix 3 5 2 100 0 0 100 0

#Other useful commands:
mixer <<< show currently selected mixer
mixer list
resource list <<< view current running assignments.

More details can be found here:
https://cleanflight.readthedocs.io/en/stable/Mixer/?q=mmix&check_keywords=yes&area=default
 

markus2066

New member
Also the table I posted previously:

For Naze32 rev6:

const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM2, CH1, A0, TIM_USE_PPM | TIM_USE_PWM, 0), // PWM1 - RC1
DEF_TIM(TIM2, CH2, A01, TIM_USE_PWM, 0), // PWM2 - RC2
DEF_TIM(TIM2, CH3, A02, TIM_USE_PWM, 0), // PWM3 - RC3
DEF_TIM(TIM2, CH4, A03, TIM_USE_PWM, 0), // PWM4 - RC4
DEF_TIM(TIM3, CH1, A06, TIM_USE_PWM | TIM_USE_LED, 0), // PWM5 - RC5
DEF_TIM(TIM3, CH2, A07, TIM_USE_PWM, 0), // PWM6 - RC6
DEF_TIM(TIM3, CH3, B0, TIM_USE_PWM, 0), // PWM7 - RC7
DEF_TIM(TIM3, CH4, B01, TIM_USE_PWM, 0), // PWM8 - RC8
DEF_TIM(TIM1, CH1, A08, TIM_USE_MOTOR, 0), // PWM9 - OUT1
DEF_TIM(TIM1, CH4, A11, TIM_USE_MOTOR, 0), // PWM10 - OUT2
DEF_TIM(TIM4, CH1, B06, TIM_USE_MOTOR, 0), // PWM11 - OUT3
DEF_TIM(TIM4, CH2, B07, TIM_USE_MOTOR, 0), // PWM12 - OUT4
DEF_TIM(TIM4, CH3, B08, TIM_USE_MOTOR, 0), // PWM13 - OUT5
DEF_TIM(TIM4, CH4, B09, TIM_USE_MOTOR, 0), // PWM14 - OUT6

I sort of understand this from what i've read, basically there are 4 "timers" in the stm...mcu and they are used to produce the required control signals for servo's/motors. As i understand it servo's use pwm and esc's sometimes use different protocols which have different signal/timings to regular pwm, so devices which require different signals need to use different timers.
The parts which say B09,A07,A0,B06 etc. seem to be a means of referencing the different lines/outputs (bottom 6 are listed as outputs).

So this section below is what maps the timers/channels to outputs:

resource MOTOR 1 A11
resource SERVO 1 B06
resource SERVO 2 B07
resource SERVO 3 B08
resource SERVO 4 B09

Hopefully you can gauge from this that my understand is somewhat limited but it seems to be working as required but my plane isn't finished and have not completed first flight yet. Someone else may be able to offer further advice/clarification of these points.

Mark