Camera control via PWM signal

I apologize. The following post is disorganized. I am trying to collect all the information I can find about this topic in one place.

Channel 9 is on a 3-position switch on my radio, and I have defined the following functions:

RC9_OPTION = 9
SERVO9_FUNCTION = 10
SERVO9_MAX = 2200
SERVO9_MIN = 800
SERVO9_TRIM = 1500
CAM1_TYPE = 2
CAM1_DURATION = 0.4
Coolguy.param (21.4 KB)

I have an SJ6 legend camera and an FPV cable:

https://www.aliexpress.com/item/32823190672.html

https://www.aliexpress.com/item/32811249537.html

Current behaviour:

When the camera is set to “car mode,” when it receives 5V, it powers on and starts shooting video automatically while also outputting video via the yellow wire on the USB FPV cable.

If I set it to video+photo mode, it still powers on automatically when it receives 5V, and it outputs a video signal from the yellow wire, and does not shoot photos or videos when I flick the channel 9 switch, and it powers itself off after a few minutes.

It outputs video fine and the OSD is working but I can’t get the PWM cable to work.

Intended behaviour:

3 position switch that toggles between taking a photo, doing nothing, and taking a video.

I’ve read the following:

https://ardupilot.org/copter/docs/common-pixhawk-camera-trigger-setup.html

https://ardupilot.org/copter/docs/common-camera-shutter-with-servo.html#

“The great thing is that the camera once plugged is shooting video but when you take a picture it switches to camera for the picture and then returns to record video.”

"Servo Limits:

Min : 1000

Max : 2100

Shutter:

Pushed : 950

Not Pushed : 1800

Duration : 40"

I can not replicate this behaviour. Maybe it is because the camera/gimbal control screen’s options are all greyed out but I have read the post and copied the parameters from it.

I’ve e-mailed the manufacturer and asked them if they have a list of what PWM values correspond to what behaviours. No response yet. I also contacted them via their AliExpress page and the person who answered does not know what PWM means.

Here’s the manual: https://support.sjcam.com/helpdesk/attachments/9028809477

No mention of PWM values unfortunately.

Did I miss a parameter? I’ve read a lot of posts but the knowledge doesn’t seem to be sinking in.

Also, although RC9 responds on the Radio Calibration page, it doesn’t seem to do anything on the servo output page. It says it’s defined, but when I flick the switch it doesn’t do anything.

Is that the problem? I feel like there could be more than one thing wrong here.

Edit1:
Update: If I set CAM1_TYPE to 1, (servo), the camera leaves whatever mode I put it in and goes into “still” mode and takes a photo every 5 seconds. When I set CAM1_TYPE back to 2 (relay) this behaviour ceases.

Edit2:
I tried assigning the camera trigger to a dial and slowly rotated through the whole range of PWM values and that did not cause the camera to do anything. I don’t think I’m sending any signals at all when CAM1_TYPE = 2

Channel 9 needs to be some sort of pass through action right? I think the CameraTrigger setting is for doing something autonomously like taking a photo when reaching a waypoint. What happens when you set ch9 to RCPassThru9?

1 Like

That did it!

SERVO9_FUNCTION = 59 now toggles between taking a video while low, doing nothing while mid, and taking a photo while high. You did it!

Now I have a different problem. When I flip the switch to high, it doesn’t take a photo immediately. The switch needs to be held “high” for a good 4 seconds before the camera does anything.

Actually that appears to be a setting on the camera. I can see a countdown on the screen starting at “5” and counting down to zero, when it takes a photo. This is a camera problem and not a mission planner problem as far as I’m concerned. Thank you HansHansHans. You solved the problem.

Edit1:
As for the 5 seconds before taking a photo problem: I changed SERVO9_FUNCTION to 58, which is a dial on my controller. The behaviours associated with PWM values are as follows:

PWM ranges:
1993-1757: Video
1757-1288: idle
1256-1066: “photos every 5 seconds mode”

edit2:
Go into the camera settings under “still” mode and enable “quick capture”. This makes it take a photo as soon as photo mode is enabled instead of waiting 5 seconds. It only works when the camera has been in “video” mode. If it is in “still” mode it still starts the countdown.