Home Forums Everything about everything else Triflight 0.7 Beta 2

Viewing 15 posts - 121 through 135 (of 155 total)
  • Author
    Posts
  • #57387
    Kevin_Erik
    Moderator

    It’s possible that the tailtune was interrupted in flight and had to start over several times. If it’s windy outside this is common. (easier to do it with auto leveling active) I have had valid tunes complete in less then 30 seconds and then some that take up to a minute on really windy days.

    Note: Make sure that you’ve completed a valid bench tail-calibration before you attempt to do the in flight tailtune.

    Also, if you are using an OSD with your video feed, then you should see a warning notification display that looks like 4 or 5 stars in the center of the screen. Keep in mind that this may or may not be shown depending on what your OSD settings are. Anyways, having it shown is a good way to verify the tune as often the copter can not be heard if its wandered away some.

    #57388
    samp38
    Participant

    Hi again,
    Thank you for all these informations.
    I’m sure the bench tuning is fine and I don’t think the wind is a problem (i tried many times indoor ans thé result us the same).
    I’m afraid i’m not sure about the tones : what is the fail tone? And the success tone? I think I have the fail tone…
    I will try tout reverse the servo internally today. (can i do it un the code by reversing the servoDirection function?

    #57389
    Kevin_Erik
    Moderator

    David’s video should have an example of the tones.

    Silly question: I assume you have a buzzer attached?

    Far as I know of you can reverse the Servo via the Betaflight Servo tab. Not tried it myself so I am not familiar with the specifics.

    #57390
    samp38
    Participant

    Yes I have a working buzzer attached 🙂
    I reversed the servo with the following cli command : smix reverse 5 2 r which is the same as reversing it via the servo tab… I really think that I have to reverse it internally or mechanically. I will try today and let you know.

    Cheers,

    Sam

    #57391
    fomoco_44
    Participant

    To reverse the servo in BF/TF you need to use the SMIX command in the CLI tab:

    e.g. when using the TRI mixer to reverse the tail servo on a tricopter use this:

    smix reverse 5 2 r

    But I still don’t think it will work for you, as I could never get it to complete…..pretty sure there is something in the code preventing it.
    What I meant by reversing the servo is to actually open it up and re-wire the motor and potentiometer….not easy.

    #57392
    samp38
    Participant

    Yes it is what i was thinking about (rewiring the potentiometer) but it doesn’t seem doable. I tried to reverse the servoDirection function in servo.c. This way I don’t have to reverse the servo after flashing, it’s working the right direction out of the box, but Tail Tune still dosen’t complete.

    Do you know if I can find the Omnibus F4 SD build of the 0.5 version?

    Thanks

    #57395
    Kevin_Erik
    Moderator

    You maybe able to flip the PWM signal with the addition of a logic NOT circuit. (inverter) After all the PWM signal is really just a squarewave who’s length is variable.

    https://www.electronics-tutorials.ws/boolean/bool_3.html
    This will turn the positive going square-wave into a negative going one.

    However what you need is to change a long pulse-width into a short one and the short pulse-width into a long one ect. This would effectively flip the Servos direction. I’m sure there is something on the market capable of doing just that if your not able to do it via the CLI.

    #57396
    samp38
    Participant

    I managed to complete a hover tail tune by changing the code of the 0.7 beta 2 version. I modified the line 388 if mixer_tricopter.c in the feedbackServoStep function from:

    const int16_t currentAngle = ((endAngle – TRI_TAIL_SERVO_ANGLE_MID) * (ADCFeedback – midValue)

    to

    const int16_t currentAngle = ((endAngle – TRI_TAIL_SERVO_ANGLE_MID) * (-(ADCFeedback – midValue))

    I did it in order to meet the condition line 505 of the same file :

    if (averageServoAngle > 90.5f && averageServoAngle < 120.f)

    This condition seemed to be the blocking condition of the tail tune success. I disabled it and looked at the resulting thrust_factor : -150.
    I understood that, as the servo angle is reversed, the average angle is to be between 60° and 89.5° instead of 90.5° and 120°.
    I’m not sure it’s the right way to get around the problem but the tail tune is ok (i get the right beeps codes) and the calculated thrust_factor is ok (141).

    I think there is a bug here : Tail Tune with a reversed servo is impossible with the original code because the calculated average angle is not in the [90..120] interval (line 505 of mixer_tricopter.c).

    The copter flyes good (i will send a video soon) even though i encounter some yaw wagging at the end of rough yaw movements.

    I don’t manage to do the same modification with the beta 3 version…

    Cheers

    #57398
    Kevin_Erik
    Moderator

    Would love for you to add your experience with the Yaw function As very few are currently involved. Most importantly, we’d need something to help mitigate Tailwag.

    See: https://github.com/betaflight/betaflight/issues/5263

    Also this is basic logic… If then do-this ect.

    Could change it to…

    if value > 60 and < 90 then run this function

    Else

    Run standard function ect

    The danger here is that the script has no real way to know that the servo is working reversed. Hence a manfunctioning servo could also trigger the wrong part of the if-then statement resulting in a crash.

    Keep in mind that’s it’s been years since I worked on any kinda script but the form and function is basically the same.

    #57401
    samp38
    Participant

    I’m no expert in tail wagging but I encountered the same issue (stationary or under throttle wag) with 0.7 beta 3 version. My mod (reversing the sign of the current angle returned by the feedbackServoStep function) cured it but didn’t give me a complete tail tune. With the 0.7 beta 2 version I never had such wag like the copter is freaking out and i could complete the tail tune.

    As for tail tune, are you sure that reversed servos are properly handled in the code?

    I would go for something like that :

    if(triGetServoDirection() == 1) {
    manage tail tune with normal servo
    }
    else {
    manage tail tune with reversed servo
    }

    But the point is that some change must be done in the code. Obviously there is a unmanaged case here. Who is writing the code? Is it lauka?

    🙂

    #57402
    Kevin_Erik
    Moderator

    Well it was a rough example…

    Last time I scripted I was modding Supreme Commander Forged Alliance.
    Made new units, weapons, projectiles, effects and scripts to run it all.
    Been a long time and i miss it.

    https://www.youtube.com/watch?v=B6vP-_v_hRI

    #57403
    samp38
    Participant

    Wow impressive ! Sorry if I hurt you I’m sure you’re greater coder than me (I’m a quick&dirty one). What is your part in the Triflight project?

    #57404
    lauka
    Participant

    Have been really busy with other stuff recently, will resume this once the snows melt and have possibilities to do flight testing.

    For reversed servos, the calculated servo angle should be the same as for non-reversed servo, doesn’t change the angles of the servo :).

    So the problem is somewhere where the angle is calculated, in the beginning of the tricopter mixer logic. I’m quite sure that servo reversing was working at some point in time. Maybe the smix reverse command is not working anymore in the latest version?

    Store the servo angle in the debug variables and observe the value in the configurator.

    Please also do a blackbox log during the tail tune process, with set DEBUG_MODE=TRI.

    #57405
    lauka
    Participant

    @samp38: There has been many contributors to the Triflight code, check the release notes. Most of it is written by me. Help is always welcome, it doesn’t have to be only me who’s making the changes :).

    #57407
    Kevin_Erik
    Moderator

    @Samp38

    I am not a great coder by any means… just one that kept at it over several years of experimentation.

Viewing 15 posts - 121 through 135 (of 155 total)
  • The forum ‘Everything about everything else’ is closed to new topics and replies.