Servers by jDrones

Configuring relay switch on F405 for camera switcher - RCx_OPTION unavailable

I’m trying to figure out how to control a camera switcher (Bick’s Multiview Duo) via a switch on my remote so that I can have a downward facing view during flight. The camera switcher looks for a PWM signal for 5 seconds after being powered on; if it doesn’t see a PWM signal within that time, it expects a digital signal. Since the F405 board takes longer than 5 seconds to boot up and output PWM signals, I have to figure out how to output a digital signal to it (if you can think of a way around this that doesn’t include a mechanical power switch, let me know).

The F405 is running V3.9.11 with BRD_PWM_COUNT = 4 and RELAY_PIN2 = 54 (corresponds to PC8 TIM8_CH3 TIM8 PWM(5) GPIO(54) pin from the “hwdef.dat” file). I believe I’m on the right track, but I can’t figure out how to control that pin from my remote. It appears that Arducopter has a RCx_OPTION where a radio input can be mapped to the “Relay2 on/off” option, but arduplane has no such feature. Any ideas on how I can get around this?

Support for the RCn_OPTION set of parameters has been added to Plane with firmware version 4.0.

I personally have had sufficiently good results with the hobbyking-type video switcher, that one uses PWM only.

if you’re using a traditional RC system, another option might be to directly connect the video-switch to your RC receiver, bypassing the FC. it will likely supply a valid PWM well within 5 seconds after power up, but this option comes at the cost of losing auto mission support for the video switcher.

Just realized that the stable Plane 4.0 was released today so I’m going to explore that option. To be clear, setting the RCn_OPTION to relay2 control and connecting the signal wire to the PWM(5) connection on the board should do the trick?

I found a post in rcgroups relating to camera trggering which may be of use.
https://www.rcgroups.com/forums/showpost.php?p=41432233&postcount=1028

I have not got a camera setup, but my observations are he used:

Cam_trigg_type 1 (relay)
Brd_pwm_count 7
Relay_pin 57 (servo 8)

RCn_option would then be 9 (camera trigger)

additionally to what you wrote, to use a PWM pin as a relay, you‘ll have to free it from its PWM assignment and make it a general purpose input / output (GPIO).
as per hwdef convention, PWM pins have an alternate GPIO number assigned starting with no 50 for the first PWM pin. that‘ll make it:
PWM 1 = GPIO 50
PWM 2 = GPIO 51
etc.

to free PWM pins for relay (GPIO) use, you‘ll need to adjust parameter BRD_PWM_COUNT accordingly. for example by setting BRD_PWM_COUNT to 4 you will free all PWM pins above 4 to be used as relay pins (GPIO). they can be adressed as GPIO 54 and up then, following the above mentioned convention.
on a board that defaults to 6 PWM pins, you’ll have pins 1-4 as servo / motor ouputs then, plus pins 5 & 6 freed for relay use by setting RELAY_PIN and RELAY_PIN2 to 54 & 55 as required.
you can then assign an RC channel‘s option to each pin and / or use a mission command or your GCS to switch the relay.

@vierfuffzig updating to V4.0.0 and setting my RCn_OPTION = 34 was the final piece of the puzzle. It works flawlessly now, thank you for your help. For anyone following along, the settings I had to change were the following:

BRD_PWM_COUNT = 4
RELAY_PIN2 = 54
RCn_OPTION=34

Note that the Units, Options, and Desc. columns in the full parameter list are currently blank for all of the RCn_OPTIONs. My signal wire to the camera switcher is wired to the PWM5 output on the board, and the newly assigned relay pin outputs 3.3v when triggered.

@rsilk I don’t think camera trigger would work here because I want the relay signal to stay high when the switch is toggled, whereas camera trigger applies a momentary pulse to snap a picture. The same general structure of steps still applies, though.

@jpgblin hey i know this is old, im trying to do the same, but my f405 will not budge, same settings

BRD_PWM_COUNT = 4
RELAY_PIN2 = 54
RCn_OPTION=34

i have mapped my channel 9 to the rcn_option and i have tested that everything wotrks, by assigning option 41 to arm/disarm and it works fine, so im assuming the trasmitter is fine. However if a i take a multimeter to to pins g and vx of s5 i get no changes when i flip the switch…any ideas you can share

Servers by jDrones