Home Forums Everything about the Mini Tricopter Triflight setup guide

Viewing 15 posts - 16 through 30 (of 256 total)
  • Author
    Posts
  • #21513
    lauka
    Participant

    Could you put a timer running on the video background (on some display)? Somehow I can’t believe those results. Seems that the Yi at least is adding frames in between. On some frames the servo doesn’t move at all.

    I’ll have to redo my measurements with a timee also.

    Edit: very nice test stand btw:)

    #21518
    Terje
    Moderator

    The servo does not move for a while when reaching the endpoint, because the code waits 500us between inputs.

    Here is the code:

    /*
    Servo tail tester
    Waits for button press, then does 10 movements from 1000us to 2000us then returns to 1500us position.
    */

    #include <Servo.h>

    const int buttonPin = 2; // the number of the pushbutton pin Digital Pin 2 (D2)
    int buttonState = 0; // variable for reading the pushbutton status

    Servo myservo; // create servo object to control a servo
    // twelve servo objects can be created on most boards

    void setup() {
    // initialize the pushbutton pin as an input:
    pinMode(buttonPin, INPUT);
    myservo.attach(9, 1000, 2000); // attaches the servo on pin 9 to the servo object
    }

    void loop() {

    // myservo.writeMicroseconds(1500); // tell servo to go to midpoint position
    // delay(750); // waits 750ms for the servo to reach the position

    // read the state of the pushbutton value:
    buttonState = digitalRead(buttonPin);

    // check if the pushbutton is pressed.
    // if it is, the buttonState is HIGH:
    if (buttonState == HIGH) {
    // run loop 10 times:
    for(int i = 0; i <10; i++)
    {

    myservo.writeMicroseconds(540); // tell servo to go to lowest possible position
    delay(500); // waits 500ms for the servo to reach the position

    myservo.writeMicroseconds(2400); // tell servo to go to higest possible position
    delay(500); // waits 500ms for the servo to reach the position
    }
    }
    else {
    myservo.writeMicroseconds(1500); // tell servo to go to midpoint position
    delay(750); // waits 750ms for the servo to reach the position
    }
    }

    #21520
    lauka
    Participant

    What are you using to drive the servo, Arduino?

    Very interesting, could there be issues in cleanflight servo driver..

    Could you do same test with cleanflight driving the servo?

    #21524
    Terje
    Moderator

    Arduino Nano. Did not want to rely on me pushing the sticks back and forth at a set rate. This way I and any one else can reproduce the results 🙂

    #21529
    Terje
    Moderator

    I’m uploading a video with my iPhone doing the timing in the background. And before you ask – no I do not have a timing device with a better timing that 1/100 sec. And it is skipping numbers because the screen of the iPhone is not running at at least 100hz 🙂

    From what I can read off the iPhone, it is doing 80 degrees in 0.09 sec running at 8v. The spec sheet for the Blue Bird BMS-22HV says 0.05 sec/60 degrees at 7.4v.

    #21531
    Terje
    Moderator

    Here is the video

    #21534
    lauka
    Participant

    I could do similar code for cleanflight at some point but might be a while to get the time.

    Could you connect the test stand to a naze board? You could do the servo movement from servo tab in 0.66 configurator. Set all values (min, mid, max) to desired servo output and hit save. If you get same speedsI need to check what’s wrong with my board. The PID should not slow it down that much.

    #21536
    Terje
    Moderator

    I’ll try and channel the servo signal from the Arduino through a Flip32+ board running in PWM mode. That way I should be able to determine if there is a bottleneck somewhere in the Triflight code. I hope to find the time within a couple of days.

    #21545
    LeoTheHuman
    Participant

    If you find it to be slower on triflight, try betaflight and cleanflight, please.

    #21551
    Terje
    Moderator

    If anyone wants to replicate my setup to do their own testing, here is the setup: https://123d.circuits.io/circuits/1130531-servo-test-circuit

    #21554

    I have access to a slowmotion camera with global shutter. I could do the test in 2500 frames per second, or 10000 FPS in really low quality. Let me know if that would help

    #21570
    Terje
    Moderator

    I figured out how to connect the Arduino the the flight controller in PWM mode (just plug it in) and I get the signals through to the receiver tab in Cleanflight. – Just not when connecting to the first four connectors on the Naze32 board (TAER/AETR). Downgraded to 1.9.0 and it works on all 8 inputs. Tested with a PWM reciver – same result.

    [EDIT] Tested on BetaFlight and Triflight 0.3 – same result.

    Can anyone confirm that PWM on the first four channels is broken in Cleanflight 1.10 (Which Triflight/Betaflight is built on)?

    #21577
    lauka
    Participant

    I implemented a servo tester into Triflight code. When throttle is increased over 1400, the FW starts writing servo output between configured min and max, every 1 second. When throttle is lowered below 1400, it stops. The command bypasses all controls (including PID). I disabled motor outputs to minimize risk to tester.

    Terje, please redo your tests with this firmware. I’m still getting the same speeds than in my original tests.

    This firmware is only for servo speed testing, you can’t fly with it.

    Code is available here (in servoTester branch): https://github.com/lkaino/Triflight/commit/dfa5ebacf1763de1292dfb2f181b6f4ceec508ad.

    #21580
    lauka
    Participant

    @David: thanks for the offer. If you have time at some point to test it, it would be interesting to know how slow the servo is to start the movement compared to normal speed. I can see it from the 60 fps recording, but can’t tell how slow it is. Most likely 240fps footage shows this as well.

    #21581
    Terje
    Moderator

    Since the PWM on the first four channels seem to be broken, could you remap the function to AUX4 2000us?

Viewing 15 posts - 16 through 30 (of 256 total)
  • The forum ‘Everything about the Mini Tricopter’ is closed to new topics and replies.