lkaino / triflight Goto Github PK
View Code? Open in Web Editor NEWThis project forked from cleanflight/cleanflight
Triflight flight controller firmware for tricopters
Home Page: http://rcexplorer.se
License: GNU General Public License v3.0
This project forked from cleanflight/cleanflight
Triflight flight controller firmware for tricopters
Home Page: http://rcexplorer.se
License: GNU General Public License v3.0
I've build a tricopter with a Kakute F4 V2 FC. I've build my own triflight hexfile based on the BF 3.2 rebase.
Everything works fine, but the servo is moving in the wrong direction. Changing the rates to -100% in the servo tab of BF doesn't work. Is there any other way to reverse the servo that i missed, or is it not implemented or broken in the new firmware?
Would it be possible to list what the recommended PID / filter defaults are on the "release" page for a update? Currently this is not shown and often this information is not easily found in forums. (If at all) This is especially true for some of the older releases.
Edit: Currently after loading up Triflight it appears to use the Betaflight defaults.
Tricopter looses control while doing “air jumps”.
Use case:
Expected result:
Experienced result:
This occurred two times today, last crash was a really bad one (time to upgrade hw :)). I could not recover the flight in both occasions. It felt like something in the controller saturated somehow.
Normal flight felt quite ok.
Occurrence rate 2/10. Seems that requires a a significant amount of time at full throttle.
Source code used was f6d8753 from master.
cli settings:
99_tmp_cli_settings_before_autotune.txt
Hi,
First, thanks for your work. It's amazing how Triflight drives my Trifecta. However, i can't remap I2C (whose pins are shared with UART3 on the Omnibus F4) to B10 - B11 pins. It seems that i2C is not active on the Omnibus F4 target. Is there a way around? I need to connect an i2C magnetometer to my flight controller.
Thanks
Here is my resource output:
resource BEEPER 1 B04
resource MOTOR 1 B00
resource MOTOR 2 B01
resource MOTOR 3 A03
resource MOTOR 4 A02
resource MOTOR 5 A08
resource SERVO 1 A01
resource PPM 1 B08
resource PWM 1 B08
resource PWM 2 B09
resource PWM 3 C06
resource PWM 4 C07
resource PWM 5 C08
resource PWM 6 C09
resource LED_STRIP 1 B06
resource SERIAL_TX 1 A09
resource SERIAL_TX 3 B10
resource SERIAL_TX 6 C06
resource SERIAL_RX 1 A10
resource SERIAL_RX 3 B11
resource SERIAL_RX 6 C07
resource list:
A00: FREE
A01: SERVO 1
A02: FREE
A03: MOTOR 3
A04: MPU_CS
A05: SPI_SCK 1
A06: SPI_MISO 1
A07: SPI_MOSI 1
A08: FREE
A09: FREE
A10: FREE
A11: USB
A12: USB
A13: FREE
A14: FREE
A15: OSD_CS
B00: MOTOR 1
B01: MOTOR 2
B02: FREE
B03: BARO_CS
B04: BEEPER
B05: LED 1
B06: FREE
B07: SDCARD_DETECT
B08: FREE
B09: FREE
B10: FREE
B11: FREE
B12: SDCARD_CS
B13: SPI_SCK 2
B14: SPI_MISO 2
B15: SPI_MOSI 2
C00: FREE
C01: FREE
C02: ADC_BATT
C03: FREE
C04: MPU_EXTI
C05: FREE
C06: FREE
C07: FREE
C08: FREE
C09: FREE
C10: SPI_SCK 3
C11: SPI_MISO 3
C12: SPI_MOSI 3
C13: FREE
C14: FREE
C15: FREE
D00: FREE
D01: FREE
D02: FREE
D03: FREE
D04: FREE
D05: FREE
D06: FREE
D07: FREE
D08: FREE
D09: FREE
D10: FREE
D11: FREE
D12: FREE
D13: FREE
D14: FREE
D15: FREE
DMA1 Stream 0: FREE
DMA1 Stream 1: FREE
DMA1 Stream 2: FREE
DMA1 Stream 3: FREE
DMA1 Stream 4: SDCARD
DMA1 Stream 5: FREE
DMA1 Stream 6: FREE
DMA1 Stream 7: FREE
DMA2 Stream 0: FREE
DMA2 Stream 1: FREE
DMA2 Stream 2: FREE
DMA2 Stream 3: FREE
DMA2 Stream 4: ADC
DMA2 Stream 5: FREE
DMA2 Stream 6: FREE
DMA2 Stream 7: FREE
I am trying (maybe too much) to understand this tuning.
The code is complex and it's not so easy to translate back into normal math. So I made a little sketch.
Geometry.pdf
Servo angle A from vertical
X = Thrust force. Horisontal component = X * sin(A)
Y = Torque force (perpendicular to X). Horisontal component = Y * cos(A)
These must be in balance, so Y * cos(A) = X * sin(A)
Using X/Y = K, leads to K = 1/tan(A)
Example numbers:
K = 13.8 => A = 4.1 deg
Hm..
I have ignored pitch. I see that the lifting force will vary by A to require a pitch compensation, but I don't see how that would affect yaw.
If this is correct the tuning calculation can be simplified.
I feel I'm missing something important here so I don't know if I should trust my own words. Please tell me what is wrong.
I cant get a tail servo to move on any of the 5 non motor outputs. it just goes to center pos and stays there. I think that servo 5 does not get mapped to a PWM output anywhere for that board.
I can see that some is because of the added tri mixer, but maybe not all.
config_unittest
Failed test:
ConfigUnittest.TestResetConfigZeroValues
flight_mixer_unittest
undefined reference to triInitMixer undefined reference to
triEnableServoUnarmed
undefined reference to triServoMixer undefined reference to
triGetMotorCorrection
pid_unittest
Failed tests:
PIDUnittest.TestPidLuxFloat
PIDUnittest.TestPidLuxFloatIntegrationForLinearFunction
PIDUnittest.TestPidLuxFloatIntegrationForQuadraticFunction
PIDUnittest.TestPidMultiWiiRewriteITermConstrain
rx_ranges_unittest
unit/rc_controls_unittest.cc:240:5: warning: missing initializer for member 'controlRateConfig_s::tpa_breakpoint' [-Wmissing-field-initializers]
unit/rc_controls_unittest.cc:240:5: warning: missing initializer for member 'controlRateConfig_s::tpa_yaw_breakpoint' [-Wmissing-field-initializers]
unit/rc_controls_unittest.cc:313:5: warning: missing initializer for member 'controlRateConfig_s::tpa_breakpoint' [-Wmissing-field-initializers]
unit/rc_controls_unittest.cc:313:5: warning: missing initializer for member 'controlRateConfig_s::tpa_yaw_breakpoint' [-Wmissing-field-initializers]
Hi,
after reading the release note for 0.5 Beta 3 i thought about the problem cutting the motor in fast forward flight.
Some ideas came to my mind:
1.) Disabling damped light in the ESCs so the motor will not stop that fast. (floaty feeling?)
More time for yaw correction?
2.) Detect fast motor cut and slow down motor after the yaw was corrected. (floaty feeling too?)
3.) The yaw mechanics turn the motor to the left to compensate a CCW rotation. But the motor is not only rotating to the left. It's also moved to the left which gives a force to the tail boom and push the tail boom to the right ( more CCW turning force).
Motor off:
https://www.youtube.com/watch?v=NxXuu7b3hxc
Motors on:
https://www.youtube.com/watch?v=VuT6SHdVV3Q
another observation its not only yawing its rolling a little bit. Seen on the second video.
Solution: change the turn point of the yaw mechanism up to compensate the effect or even turn it to the other side and help yawing. Impossible tilt mechanism might be the solution.
This is the next video test i will so.
Another Idea: If you cut throttle not on all motors at the same time. You have two CCW and one CW motors to Yaw a bit. Do a Yaw like on the quadcopter with different rotation speeds. If air is fast and the propellers dont have much grip it might not roll/nick very much.
My flying skills are not good enough to feel the problem in real world flying. I'm happy not crashing, but i can change a broken prop in under 10 seconds now :-)
I like doing bench tests. If you have another idea for testing. Tell me.
Tell me what you think.
Thanks Jan
Please update the check-list if needed after Beta3 and put pointer in the release note
Crazybee F3FS is a great all in one board and a great opportunity to make the baby tricopter, micro baby tricopter!
There exists a betaflight for it already:
https://github.com/betaflight/betaflight/blob/master/docs/boards/Board%20-%20CrazyBeeF3FS.md
I have tried the Gtune feature as soon as I took off I punched the throttle a little and experienced the issue reported in #7.
Question, is GTUNE supported to work with the new tricopter mixer?
Activating servo_tilt no longer working on F3 board. Works fine on naze32. Which outputs are the servo pins on the F3FC (besides the tail servo)? On the naze32 it was the first 2 output pins.
I am using the Naze32 and had no problems with the sending VBAT telemetry on RC5/RC6 pins with TriFlight 0.4. This no longer works on TriFlight 0.5 Beta 3.
tri_servo_feedback is set to VIRTUAL so pin RC6 should be free. I noticed that EXT1 uses the ADC pin RC6. Is it possible the pin is not being released?
When configuring gps, the following options are unavailable in CLI: gps_provider, gps_auto_config and so on. Also, in cleanflight, GPS options (in Configuration tab) do not persist.
I have the mini tri and electronics kit. I found that the default config does not support oneshot, so I wanted to update it via the latest blhelisuite.
I'm not experienced with blheli in particular, but know what needs to be done and had a vague idea of how to get there. I plugged in my FC and opened up blhelisuite, told it I had an AVR with cleanflight as the interface. On "check" the motors will beep in sequence and I'll get a report that there are no ESCs.
If I try to read config from a specific ESC, it will beep it forever asking me to power cycle. Power cycling doesn't help. It just wakes up and keeps beeping. This is the closest to a sign of progress I've got.
Discussion in #cleanflight points to a possible workaround:
00:30 ducktaperules well if you have a linker tool, you can go into cleanflgiht CLI use the "1wire 1" comand, disconect in the configurator, then touch your linker tool on top of the esc contacts for esc 1 and connect to it in blheli. update / change settings. then when your done power cycle the fc
00:30 ducktaperules rinse and repeat for each esc using "1wire 2" and "1wire 3"
00:40 Simon-- that just tristates the pwm output pin?
00:40 Simon-- I could also just finish the abandoned usblinker branch :)
00:42 Simon-- or merge the other crap over softserial, which is probably better, since it should be tiny..
01:00 ducktaperules either option would be great
01:01 ducktaperules and yeah it just tristates the output pin, but thtas enough to reprogram if you need to
01:02 ducktaperules even a dedicated hex that you could flash to, update esc then flash back, without wiping eprom would be good
It seems the bl20s may have a simonk bootloader. In any case, stuff doesn't seem to work well (for me at least).
Are there any plans to release this for the BFF4 target ?
https://www.fpvmodel.com/betaflightf4-flight-controller_g1351.html
Hi guys!
Looks like you guys are doing some good work here. Cleanflight v1.13.0-RC1 was created yesterday and is a stable codebase from which to further develop your changes.
Could you start creating pull requests so that we can get the TriFlight changes merged back into Cleanflight if you think they are ready?
Hi,
I have finished building the Quanum Trifiecta with the F3 Deluxe board.
In beta 2 I had a problem with the yaw servo turning left every time I lowered throttle,
but in beta 3 it has been 99% solved! Great work.
Now I have another problem. When the servo is centered it starts oscillating badly,
but when I start turning it to the left or the right, the oscillation goes away. During
flight the problem is still there but to a lesser degree.
Small clip showing the problem : https://youtu.be/ferMhxt82DA
I am using the EMAX ES09md digital servo but I have not used any feedback wire.
Do you think that this might help to solve the problem? Any other suggestions?
Thank you.
Tried the new 0.5 beta2 fw today on my 190-size tricopter (custom frame).
The yaw oscillated like crazy, changing PIDs doesn't seem to make a difference. Flashed back to 0.4 and everything works perfectly. Same PIDs and controller were used. I am using the standard BMS-210 servo. Any ideas?
Awesome work on triflight btw.
Hello,
tested Triflight 0.5 on a Naze32 Rev.5 board with following results:
triflight_0_5_NAZE.hex --> verry slow response in Cleanflight Configurator (lag about 20seconds) - not usable - could not arm the copter.
triflight_0_5_NAZE32PRO.ex (just tried this one) --> blue led solid on, no connection with CF Configurator possible. Configurator Version: 1.2.4
What could be the issue here?
Best,
Lorenz
The Sparky hex corrupts the board prompting an unrecognised target message in windows devices, the bootloader bins must be shorted to allow re-flashing of cleanflight.
(It's a shame as I was looking forward to trying it)
The beeping during tail tune is too frequent, copter doesn't beep at all.
Add a delay/counter for the beeping to make it less frequent.
Tricopter mixer logic doesn't support servo reversing.
Able to change Yaw servo directdion in iNav output tab, but with Triflight enabled the iNav change doesn't come to Triflight. If there's not a CLI command, would it be possible to get a Kakute F7 HDV build for 2.4x? Thank you.
So I tried the new 0.5B3 today but I cant control the servo. It's all the way to the right and nothing happens when I use yaw. I cant tune the yaw with yawtuning either.
I use naze32 and a servo without feedback
I've done roughly Two Hundred Plasmatree step response plots and the one thing that has been common with all of them is that the Roll debug is never shown. Even Betaflights Blackbox Explorer fails to show this information.
Note: Debug "Notch" enabled via CLI while using the latest version of Triflight.
Never mind the plot itself or how the Tricopter is tuned, the Roll data is missing!
LOG00002.zip
Had my Tricopter-Mini Flip upon Arming due to Motor #1 instantly surging to 100% throttle. After recovering the craft and doing in-house testing I soon discovered that the loss of the Servo feedback voltage resulted in such a surge. (0 VDC) I can only surmise that my Servo's quick disconnect adaptor wasn't fully seated and is the likely cause of the Flip.
Note: I was able to reproduce the failure and have verified that the loss of feedback was the cause.
Question: Would it be possible to script an event upon the loss of the feedback voltage, where the copter either refuses to arm or switches to virtual mode?
Instead of specific CLI parameter, use the servo 5 configured max angles (-45, 45 by default). Change the defaults to -40,40.
These parameters were not available when the CLI parameter was implemented.
I tried everything but I could not get the tail servo working at all (No signal)
My setup:
Flip32 (same as Naze32)
Receiver connected with PPM (Gui see it working correct)
Motor connected to OUT1, 2, 3 (i checked it work)
but i tried all pin... Servo tail not working
If i check in CLI, the resource list is this:
IO
A00: PPM
A01: FREE
A02: FREE
A03: FREE
A04: ADC_BATT
A05: FREE
A06: FREE
A07: ADC_EXT
A08: MOTOR 1
A09: SERIAL_TX 1
A10: SERIAL_RX 1
A11: MOTOR 2
A12: BEEPER
A13: FREE
A14: FREE
A15: FREE
B00: FREE
B01: FREE
B02: INVERTER 1
B03: LED 1
B04: LED 2
B05: FREE
B06: MOTOR 3
B07: FREE
B08: FREE
B09: FREE
B10: I2C_SCL 2
B11: I2C_SDA 2
B12: SPI_CS 2
B13: SPI_SCK 2
B14: SPI_MISO 2
B15: SPI_MOSI 2
C13: MPU_EXTI
C14: FREE
C15: FREE
DMA:
DMA1 Channel 1: ADC
DMA1 Channel 2: FREE
DMA1 Channel 3: FREE
DMA1 Channel 4: SERIAL_TX 1
DMA1 Channel 5: SERIAL_RX 1
DMA1 Channel 6: FREE
DMA1 Channel 7: FREE
I tried to manualy assign a resource to SERVO 6, but nothing... (i tried on some pin)
I tried to lower the servo refresh rate... nothing
its a bug????
PS: I tried TriFlight V0.5... Servo work on OUT2.... but the GUI (Cleanflight and Betaflight) not allow me to configure without CLI
PPS: I tried to remap all the OUT (Motor to OUT 4, 5, 6) and the servo to OUT 2... NO working...
flight/Mixer.c in three places.
Line 414 and 749 and 774 (0.5-beta1)
currentMixerMode == MIXER_TRI
should add " || currentMixerMode == MIXER_CUSTOM_TRI"
I think that's it.
When tuning for 6S LiPo's, seeing a rather large amount of Pitch bounce-back regardless of Terms used or filter settings applied. (See red circled image below)
https://farm2.staticflickr.com/1744/41849129875_de83dfa757_h.jpg
In the above Plasmatree image, the trace should quickly rise to "1", with minimum overshoot and then flatten out. This graph shows the relation between the PID inputs and the what the Gyro experiences in the real world. From what I can tell, the Pitch and Yaw are overshooting causing oscillations on the other Axis. After about a week of testing various PID combinations, I'm thinking that maybe the Yaw compensation while using a 6S-LiPo is off somehow.
The video example is shown with increasing values of D by "2" for each frame. D-Term 17 shows twice as one is with stock filtering and the other is using Dynamic filtering. (Pitch "baseline" starts at 9/10/0) Yaw smooths out as Pitch improves, which is normal for a Tricopter.
https://youtu.be/YgQUPb1tRBE
Quick test using 4S-LiPo, please notice the same bounce-back is present just not as strong as before.
https://farm1.staticflickr.com/892/42032384814_2828c2f135_h.jpg
Here is a video with I & D at ZERO and P scaling upwards.
https://youtu.be/WMkpUDe8STY
Here is an animation of a recent test to slowly increase P & D proportionally by a value of "2".
https://youtu.be/m1zagikCYNE
Thus far I've completed in excess of 60 - 80 test flights for Plasmatree.
Most of which can be viewed here with log files:
https://drive.google.com/file/d/1J7MG7rEGm9G5l-QOjyDGtQk5mqs7V0I_/view?usp=sharing
Hello! I have an old flip32 FC board with latest triflight on. Beside some servo jitter I noticed that on motor page in Cleanflight Servo is on channel 6 and also while movin yaw to the right it is also on ch 7. Only when I move yaw to the right. The range when it goes to the ch 7 is missing and therefore servo doesn`t reach right endpoint. How can I put servo only to one channel? Thanks. I can put dump file on, but right now I am not at home....
I am using the 0.5 version of Triflight on my CC3D. By the way, I checkedout the version 0.5 tag and used this command make TARGET=CC3D
So after flashing, cycled the power and connected the battery, the servo was stuck, tilted left (if the tricopter is facing at you) I don't understand why but in betaflight, it's working perfectly.
Can someone take a look at this?
Servo is connected at M4 by the way so I assume this is correct.
HI,
Since the inav code will soon be getting merged with cleanflight, will it be possible to have these advantages with triflight, too?
I believe the issue discussed in this post +/- is still there.
There was a guy reporting about spinning not so long ago and maybe it's related. Hard to know.
Please look again.
The unit tests fail. Its a tiny error but probably accumulative (not random noise). Thousand times every second and it may add up.
The original committer @digitalentity, who I think introduced the fast math, had it commented it out originally. Then something happened in a BF detour. In current CF it is commented out again.
See math.h, line 26, or use attached patch which also updates the names to current CF.
/B
Math.patch.txt
I am running a somewhat standard setup on David's mini-tricopter:
Triflight-0.5_beta2
Savox SH0255 servo running at 6.0 volt, with a feedback wire connected via voltage divider.
Motors: BE2208-1300
ESC: 20A running BL-HELI
FC: Naze32 rev6
Props: HQ6x4.5
I did run tailtune, and this is what I got:
set tri_servo_angle_at_max = 400
set tri_tail_motor_thrustfactor = 92
tri_tail_servo_speed = 366
PIDs are out of the box.
Here is the video of one of my flights: https://www.youtube.com/watch?v=OjOqRi3jyDQ
Drone is very stable and flies great, except for when I give it yaw right. Yaw left works great.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.