Help with Sbus Servo on F7 Flight Controller

I am using the Flywoo Goku 745 AIO with the latest version of Arducopter. I am trying to control a Futaba servo. I can control it just fine from the RC receiver, but when I hook up the servo to serial 4 on my FC it doesn’t work. I have set SERIAL4_PROTOCOL = 15, SERIAL4_OPTIONS = 2 (inverted TX), SERVO_SBUS_RATE = 73, BRD_PWM_COUNT = 8, and SERVOX_FUNCTION = 56 (Ch 6 on my remote). It still doesn’t work after all this, I think I am getting close but the PWM out is not correct. Attached is a picture from my oscilloscope.

The top (yellow) is the output from Serial 4 and the bottom (green) is the output from my RC receiver on channel 6. Somehow I have to get the top yellow line to look like the bottom green line. I notice that the serial 4 out looks similar but in reality, the frequency is 2.5KHz while the real output is 73Hz, this is despite me already setting SERVO_SBUS_RATE = 73

I’m also attaching my param file
no servo.param (19.0 KB)

The code has this, which seems a little suspicious to me:

    // subtract 500usec from requested frame interval to allow for latency
    sbus_frame_interval = (1000UL * 1000UL) / rate - 500;
    // at 100,000 bps, a 300 bit sbus frame takes 3msec to transfer
    // require a minimum 700usec interframe gap
    if (sbus_frame_interval < 3700) {
        sbus_frame_interval = 3700;
    }

Is your Futaba servo a normal PWM servo, or is it expecting Sbus input?
The top trace looks like Sbus, the bottom trace looks like PWM.

I believe its just PWM? since it works directly off the Futaba receiver (Not the Sbus port) Is there a way to do pure PWM out of the FC?

Just use a PWM output rather than a serial port

how do I set that up? what Params do I change?

Connect your device to a motor output above the range you are using for motors. Make sure the BRD_PWM_COUNT is set to the number of motors you have. Set SERVOx_FUNCTION to whatever you want it to do, where x is the motor number of the output. So for instance on a quad, connect to motor output 5,

BRD_PWM_COUNT=4
SERVO5_FUNCTION=somthing

The output you are using also needs to be in a different group to the rest of the motors. You can see the groups in the board docs.

The board docs are not very useful, I have 7 serial out, and the board says it has up to 10 PWMs. but I cannot figure out how to get that PWM output on the serial ports

Don’t use the serial port, use the motor outputs - that;'s what PWMs are

oh ok, I was confused since it said there are 10 PWMs on the documentation. Does this mean that there is no way to output PWM on the 7 UART ports? even with GPIO?

Not easily I don’t think - and why would you?

we are using quad configuration, so that’s motor 1-4 but we would like to be able to go up to a Hex (since the bord has an output for motors 5 and 6. But we have plenty of free UART ports. I supposed we could hook up a servo to the LED pin, however, that means we will probably lose the indicator lights.

The hwdef has support for motors 7 & 8 + LED and one other. Are there not pads for these on the board?

If this is the right board it looks like it:

You could use a serial port for sbus out, as you tried to do plus an Sbus to PWM converter as I did here:

That is the old board, the new one doesn’t seem to have those?

Seems not. I wonder why they would do that because those functions on the 4 pads were available on the top set of pins on the V1.0 board. This is the only explanation they give:
Improve the land layout. Increase the pad spacing, easier to solder

Maybe they have been talking to Airbot about how to handle [badly] board revisions :roll_eyes:

There are also cheap sbus servos available and you wouldn’t even need an adapter to use a spare serial port: Corona SB-9039 Servo - 2.7kg (37.49oz in), 0.13 sec
Of course, if you don’t want a cheap servo both FrSky and Futaba make expensive ones…

You could write a custom hwdef that remaps pins, but really you are on your own with that