Home Forums Everything about the Bicopter BiCopter + F3FC + Betaflight

This topic contains 44 replies, has 8 voices, and was last updated by  Cshep70 8 months, 1 week ago.

Viewing 15 posts - 1 through 15 (of 45 total)
  • Author
    Posts
  • #59051

    Frederoo
    Participant

    Hello!

    I got my BiCopter yesterday, put it together, but then ran into Betaflight setup issues. I have everything soldered like in the Build Video (motors on top tabs, servos on bottom) but it seems the left part is refusing to cooperate. The left motor controller is making sounds when I turn the copter, and the servo is not making any movements at all (the other one is countering the movement as expected). That made me think the servo and motor outputs are switched.
    Here I ran into a Betaflight/F3FC documentation issue: there seems to be no diagram showing which pad goes to which logical output (1 -> A00, 4 -> A01, T1 -> B01 etc.).
    I wonder if anyone else ran into this issue? Or has this tab diagram?

    [code]
    # resource
    resource BEEPER 1 A00
    resource MOTOR 1 B00
    resource MOTOR 2 A04
    resource SERVO 1 A07
    resource SERVO 2 A08
    resource PPM 1 A01
    resource LED_STRIP 1 B08
    resource SERIAL_TX 1 B06
    resource SERIAL_TX 2 A02
    resource SERIAL_TX 3 B10
    resource SERIAL_RX 1 B07
    resource SERIAL_RX 2 A03
    resource SERIAL_RX 3 B11
    resource I2C_SCL 2 A09
    resource I2C_SDA 2 A10
    resource LED 1 B04
    resource LED 2 B05
    resource SPI_SCK 2 B13
    resource SPI_MISO 2 B14
    resource SPI_MOSI 2 B15
    resource ADC_BATT 1 A05
    resource ADC_RSSI 1 A06
    resource ADC_CURR 1 B02
    resource SPI_PREINIT_IPU 1 B12
    [/code]

    I played around wyth switching outputs a bot and swapped servo 2 and motor 1: when I live tested the motors, one of them spun up, the other didn’t. In the setup above, none of them do. The diagram/pad mappings would be so helpful…

    PS You can see above that I use CPPM, that also needed a pin switch – the default setup in the video uses SBus so R1 Rx pad needed to be swapped with pad labeled 6 as per BetaFlight docs.

    • This topic was modified 1 year ago by  Frederoo.
    • This topic was modified 1 year ago by  Frederoo.
    • This topic was modified 1 year ago by  Frederoo. Reason: Swapping results
    #59058

    jihlein
    Participant

    My best guess:

    PWM1 A08 TIM1 Ch1
    PWM2 A07 TIM17 Ch1
    PWM3 B00 TIM3 Ch3
    PWM4 A04 TIM3 Ch2
    PWM5 B01 TIM3 Ch4
    PWM6 A01 TIM2 Ch2
    R1 B07
    T1 B06
    R2 A03
    T2 A02
    R3 B11
    T3 B10
    FB A06
    SDA A10
    SCL A09
    Current B02
    LED Not Sure
    Beeper A00

    Note – I haven’t watched the build video in any detail, but it’s important that the servos be on outputs PWM 1/2 and motors be on PWM 3/4, or vice versa, I’m not sure which betaflight prefers. The reason for this is so the internal servo timers and internal motor timers can be independently set, allowing the servos to be updated at 270 Hz and the motors updated with one shot, for example. I “think” the servos should be on PWM 1/2.

    #59059

    Frederoo
    Participant

    Thank you so much! This gives me an idea what might be wrong at least – PWM timers. I tried swapping motors/serwos and didnt get far (apart from having that one usable ESC and servo). To be sure I even desoldered the servo to check if it works, and it does. The ESC also works, as it produces the init tune.

    So, from Betaflight code:
    [code]
    const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
    DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, 0),
    DEF_TIM(TIM17, CH1, PA7, TIM_USE_MOTOR, 0),
    DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0),
    DEF_TIM(TIM3, CH2, PA4, TIM_USE_MOTOR, 0),
    DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0),
    DEF_TIM(TIM2, CH2, PA1, TIM_USE_PPM, 0),
    DEF_TIM(TIM16, CH1, PB8, TIM_USE_LED, 0),
    };
    [/code]

    Looks like the PWM channel definitions with associated timers. So, the ESCs should be on the same timer, or different? The current setup wyth one working servo and one functional ESC is:

    [code]
    resource MOTOR 1 A04
    resource MOTOR 2 A07
    resource SERVO 1 B00
    resource SERVO 2 A08
    [/code]

    #59061

    jihlein
    Participant

    Here’s your timer mapping then:

    [code]
    resource MOTOR 1 A04 TIM3 Ch2
    resource MOTOR 2 A07 TIM17 Ch1
    resource SERVO 1 B00 TIM3 Ch3
    resource SERVO 2 A08 TIM1 Ch1
    [/code]

    This won’t work, all channels controlled by timer 3 have to use the same protocol and timing. I suspect the motor protocol is either too fast of incompatible with the servo, and since both motor 1 and servo one are on pins controlled by timer 3, this creates a problem.

    I don’t know how betaflight internally distinguishes between servos and motors, which is going to be critical. But the bottom line is servos need to be on output pads 1/2 or 3/4, and motors the opposite, either 3/4 or 1/2.

    Ahhh wait a minute – found this under “Starting PIDSs” on the Bi Copter store page:

    resource MOTOR 1 B00
    resource MOTOR 2 A04
    resource MOTOR 3 NONE
    resource MOTOR 4 NONE
    resource SERVO 1 A07
    resource SERVO 2 A08

    So:

    Servo 1 to PWM out 2
    Servo 2 to PWM out 1
    Motor 1 to PWM out 3
    Motor 2 to PWM out 4

    I don’t know of 1 = right or left, which will be critical.

    #59062

    All I did with mine was to change these resources:
    resource MOTOR 1 B00
    resource MOTOR 2 A04
    resource MOTOR 3 NONE
    resource MOTOR 4 NONE
    resource SERVO 1 A07
    resource SERVO 2 A08

    #59074

    Frederoo
    Participant

    This does not work for me at all (which I still find strange and unusual). I can start the left motor in the Servo tab, by setting the midpoint value of SERVO 2 low, than high again (after that I have to unplug the power to reset the ESC). I also managed to swap the working servo to the other side, but can’t get all of them to work at once. :/

    I did apply all the “Starting PIDs” as per the video, I wouldn’t be writing here if I didn’t.

    I’ll try errasing flash and starting over, maybe I did something to another setting. Is it correct if I have the working servo under Servo 3 in the Servo tab? I kind of expected “resource SERVO 1” to map to “Servo 1”. Is that how the smix settings work?

    #59077

    Frederoo
    Participant

    Ok, I got the servos working by unsoldering the motor connection and swapping cables. BUT the right motor is still not spinning. I guess from the diagram it is number 2.

    [code]
    resource MOTOR 1 B00
    resource MOTOR 2 A04
    resource SERVO 1 A07
    resource SERVO 2 A08
    [/code]

    As you can guess, the erase did nothing to fix the issue. It actually showed motor 5 in the resources (I wondered why @david unset motors 3 and 4 – now I know).

    Now, as you can see above, the resources are stock. The problem is I still don’t have control over one motor, and I don’t have anything to swap with, as all the rest works as expected. That got me thinking about the pad to CPU mappings, perhaps motor 5 was actually connected to something? Or maybe auto-detected? I don’t remember what the mapping was, but will errase again to check.

    EDIT: So, the defaults after errase are:
    [code]
    # resource
    resource BEEPER 1 A00
    resource MOTOR 1 A08
    resource MOTOR 2 A07
    resource MOTOR 3 B00
    resource MOTOR 4 A04
    resource MOTOR 5 B01
    resource PPM 1 A01
    resource SONAR_TRIGGER 1 A06
    resource SONAR_ECHO 1 B01
    resource LED_STRIP 1 B08
    resource SERIAL_TX 1 B06
    resource SERIAL_TX 2 A02
    resource SERIAL_TX 3 B10
    resource SERIAL_RX 1 B07
    resource SERIAL_RX 2 A03
    resource SERIAL_RX 3 B11
    resource I2C_SCL 2 A09
    resource I2C_SDA 2 A10
    resource LED 1 B04
    resource LED 2 B05
    resource SPI_SCK 2 B13
    resource SPI_MISO 2 B14
    resource SPI_MOSI 2 B15
    resource ESCSERIAL 1 A08
    resource ADC_BATT 1 A05
    resource ADC_RSSI 1 A06
    resource ADC_CURR 1 B02
    resource SPI_PREINIT_IPU 1 B12
    [/code]

    So, I’ll be trying B01 for the other motor. If this works, I suggest making a new diagram and putting it on the store product page somewhere, probably in the BiCopter + electronics page. 😉 After applying the “Starting PIDs” settings on a clean BetaFlight 3.5 resources look like this:
    [code]
    resource MOTOR 1 B00
    resource MOTOR 2 A04
    resource MOTOR 5 B01
    resource SERVO 1 A07
    resource SERVO 2 A08
    [/code]

    • This reply was modified 1 year ago by  Frederoo. Reason: defaults after errase
    #59084

    jihlein
    Participant

    @frederoo – I’m going to suggest that the left servo goes to PWM 1, right servo goes to PWM 2, left motor to PWM 3, and right motor to PWM 4.

    I know that this does not match the wiring diagram, but I think it matches the resource map and the motor mixing/servo mixing rules.

    It also follows from what what we’ve been using on the dRonin firmware successfully (well almost, we have the left/right motors on 1/2 and left/right servos on 3/4). What this does help prove is the timer assignments are correctly allowing independent servo and motor protocols with a 1/2 and 3/4 split.

    Beyond that, I’ll bow out of the betaflight discussion because I’m not familiar enough with the internal workings of the code and may just add to the confusion……

    • This reply was modified 1 year ago by  jihlein. Reason: Changed response
    #59092

    jihlein
    Participant

    Just for grins and giggles, I rebuilt betaflight 3.5.0 to include the built in bicopter mixer on F3 targets, and compiled it for the DTFc and F3Fc targets. It fits with taking up too much more flash space. Doing this eliminates the need for the mmix and smix cli changes.

    I have a spare DTFc board and I tested with that, and can get proper motor and servo operation in both the servo 1/2 motor 3/4 and servo 3/4 motor 1/2 configurations with only minor changes to the resource allocations.

    I’ll check the F3Fc when my kit arrives, hopefully this weekend. This is not, and won’t become, an official part of betaflight, but if it works, I could post the hex file here if desired.

    I’m suspicious of the wiring diagram, I really think the servos have to be on 1/2 or 3/4 physical pads with the motors on 3/4 or 1/2 physical pads respectively in order to get the timer allocation correct and the proper protocols going to the servos and motors. Particularly so since there’s another report of a bicopter not functioning correctly.

    Until I can check this with a logic analyzer I wouldn’t recommend changing anything until I verify what works and doesn’t work.

    #59094

    Kevin_Erik
    Moderator

    Awesome work J !
    In about a month or so I’ll order a Bi-Copter. Can’t really do too much too fast without drawing wife-agro.

    #59100

    Frederoo
    Participant

    Great news @jihlein! I would be willing to test that build if you share. Or I might look into building it myself, is there a branch on GitHub for that?

    About wifes… (translated)
    Anna: Why did you buy another copter?
    Fred: I wanted to have one that is well designed and actually flies.
    Anna: Unlike those that could fly but don’t?

    Well, its the fourth day and it still does not. 😛 But I feel we are getting there. 😉

    Back on topic, the other motor output does not work (which is not a real surprise for me, but I kind of hoped it would). I’ll be looking carefully at what @jihlein wrote in the first reply to this topic and try to get both motors on Timer 3. Right now, after swapping wires I do have servos on pads labeled 1 and 2, and motors on 3 and 4.

    #59101

    jihlein
    Participant

    Here’s the BetaFlight 3.5.0 firmware for the F3Fc with the restored bicopter mixer. The changes are not on my git repository yet, but I will commit/push them after we know this works. Note the hex file had to be compressed as the straight hex file was too large to attach.

    I will post what I think the necessary CLI commands are shortly.

    Edit:

    Before we charge off in a new direction, please try this test. Reset the F3Fc configuration to defaults, then configure the board as a quadcopter, but change the motor output protocol from oneshot (the default) to 50 Hz PWM. The reason for this is both the motors and servos should respond to this protocol, where the servos can’t respond to oneshot. Then on the motor tab, test each “motor” individually and observe what happens. When slider #1 is activated, does the device attached to physical output pad #1 respond? Same questions for sliders #2 thru #4. This will accomplish a few things. We’ll know that all the hardware is good, and we’ll know what virtual widget (motor or servo) numbers respond to what physical output numbers in the default configuration.

    As far as the built in bicopter mixer goes, we can hook this up two ways after selecting the bicopter mixer:

    Output 1/2/3/4 <-> left motor/right motor/left servo/right servo

    resource motor 3 none
    resource motor 4 none
    resource servo 1 B00
    resource servo 2 A04

    or:

    Output 1/2/3/4 <-> left servo/right servo/left motor/right motor

    resource motor 3 none
    resource motor 4 none
    resource motor 1 B00
    resource motor 2 A04
    resource servo 1 A08
    resource servo 2 A07

    If I’ve got the left/right positions backwards, simply swap the pin resources, or move the physical wires. This mirrors my testing with the DTFc, just substituting the appropriate F3Fc resource pins for the DTFc pins.

    Until I get my F3Fc, this is my best guess as to what will get you operating correctly.

    • This reply was modified 1 year ago by  jihlein. Reason: Add output test, cli commands
    #59105

    Oh no. I think I messed up the schematic/pins 🙁
    Crap. I’m not home for another week, so I can’t test it.
    Ah man 🙁

    @jihlein knows what he’s talking about! Try his suggestions.
    I’ll see if I can check stuff remotely with the help of Johanna.

    #59108

    Frederoo
    Participant

    @jihlein your BetaFlight build seems to work without issues, as far as I could test. 🙂 I copied the recommended config without all the mixes and with my resource mappings and it worked the same as vanilla 3.5 build. Unfortunately…

    I think I found the final issue with my BiCopter – there is something wrong with one of the ESCs – it produces the init sound, but does not want to start the motor. I tested both ESCs unsoldered on a PWM servo tester, and the other spun up. So this final issue is probably faulty electronics… :/

    Thanks for all the help! @jihlein your advice about timers and the pad map was spot on. Both combinations of servos/motors work as long as they are in pairs on either pads 1/2 or 3/4. I made an updated schematic, and will probably do a better one when I have time next week…

    #59110

    jihlein
    Participant

    ESC maybe out of calibration?

Viewing 15 posts - 1 through 15 (of 45 total)

You must be logged in to reply to this topic.