Pixhawk4 relay control

Hello ı have a question about relay module with pixhawk 4. We have a problem about controlling the relay module. We want to control (on/off) the voltage passing through the regulator with RC stick. We applied the method which is written in website:Relay Switch — Copter documentation but it didn’t work. Regulator connected to FMU port with signal distrubuter at 6. Parameters that we use : Servo6.Function = RC7 , RC7_Option = Relay_Pin1 (on/off) , Relay_Pin1 = MainOut6.

Is the servo rail powered by 5V externally? It should.

What version of Ardupilot are you using? If its 4.2+, you’ll need to set SERVO6_FUNCTION to -1 rather than RC7. Also have you got it wired to the signal and ground pins? The 5V doesn’t need to be powered.

We do not have a problem with powering it; on the contrary, we cannot turn off the relay (it is always on when we power the plane). Also, we want to control the relay from the remote control. Why do I need to use RC7?

So the question still stands, what version of Ardupilot are you using? Relay is configured differently if you are pre 4.2 and post 4.2.

For MainOut/Servo6 with the relay, RC channel 7 operating the relay


Check RELAY_DEFAULT is 0 for off at boot up.

I obtained the pin number from the hwdef file (hardware definition) for fmu5, which is the basis of the Pixhawk4. I’ve got a similar setup on Servo8, GPIO pin 57 and that is working, albeit on a CUAV V5, which is essentially the same.

# PWM AUX channels
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
PA10 TIM1_CH3 TIM1 PWM(2) GPIO(51)
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
PE9  TIM1_CH1 TIM1 PWM(4) GPIO(53)
PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
# we need to disable DMA on the last 2 FMU channels
# as timer 12 doesn't have a TIMn_UP DMA option