Home › Forums › Everything about everything else › Triflight 0.7 Beta 1
- This topic has 142 replies, 32 voices, and was last updated 6 years, 9 months ago by bhuism.
-
AuthorPosts
-
27 April, 2017 at 21:50 #37423bhuismParticipant
Ok, I’m out of options in getting the servo feedback wire working on bff3. Custom bff3 firmware’s with (target.c):
#define EXTERNAL1_ADC_PIN PA8 (let strip)
or
#define EXTERNAL1_ADC_PIN PB7 (ppm)and
set tri_servo_feedback = EXT1
did not work.
Wat happens is, the servo speed calibration throws the servo one time full deflection then centers and stops (not a couple of throws as normal). The voltages I measure on the feedbackpin are correct, pulse 1086 = 1.021v (min deflection) and pulse 1973 = 2.460v (max defection).
I guess there needs to be more software configuration in order for these pins to be readable by the tailtune logic?
27 April, 2017 at 23:55 #37424jihleinParticipant@bhuism, from what I found testing, the EXT1 analog inputs don’t work in this release. I made some quick code patches for the Naze32, and now I can get functional tail servo feedback on that board via EXT1, as evidenced by the un-armed tail tune completing the servo speed calibration. I need to clean up the code changes some, and I’ll send a PR to @lauka. These changes may also fix your issues with the BFF3 board not working with EXT1.
28 April, 2017 at 04:51 #37426jihleinParticipant@lauka, I created a PR that fixes EXT1 ADC input functionality. Checked out on NAZE32 hardware, but I’m unable to test other targets.
28 April, 2017 at 08:46 #3743028 April, 2017 at 11:18 #37431laukaParticipant@jihlein: Great! I will merge it in and probably create beta 2 for it.
@bhuism: The problem with BFF3 analog inputs is that they are tied to ADC2 in code.
ADC2 pins are:
– CH1: PA4 (used by VBAT)
– CH2: PA5 (used by CURRENT)
– CH3: PA6 (used by PWM1)
– CH4: PA7 (used by PWM2)
– CH12: PB2 (used by RSSI)You would have to move the servo and motor outputs around to free either PA6 or PA7 for EXT1.
One of the motor or servo output can be moved to the PPM input pin for example.
28 April, 2017 at 15:06 #37434jihleinParticipantHere’s how to get the servo fdbk on PWM Output #1 pin. Note that this change takes over the use of that pin, and you will have to remap the other resources accordingly. The PWM2 pin will actually now be PWM1, etc., and there are only 7 PWM outputs now.
In target.h, add this line to the adc setup block:
#define EXTERNAL1_ADC_PIN PA6
Change the last line from:
#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(15) | TIM_N(16) | TIM_N(17) )
to:
#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(15) | TIM_N(17) )In target.c, comment out the following line:
// DEF_TIM(TIM16,CH1, PA6, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED), // PWM1
I can say the target builds with these changes, not sure if it works, needs testing.
28 April, 2017 at 15:42 #37435bhuismParticipantThanks guys, I think I get it now. I also see why only these pins are eligible for ADC2 work in the f3 datasheet. I can’t just use the resource command to set PWM1 (PA6) to NONE, and move PWM1 to PPM (PB7)?.
I didn’t think it would be this much work to get feedbackwire working, since there are no free ADC2 pins left. Maybe I’ll try removing the components which screw up the normal feedbackwire working on the RSSI pin on the bff3, and find out where I can solder the PB2 pin.
28 April, 2017 at 16:37 #37436jihleinParticipant“use the resource command to set PWM1 (PA6) to NONE, and move PWM1 to PPM (PB7)”
You could try this along with just #define EXTERNAL1_ADC_PIN PA6 and see if it works. That’s a cleaner solution.
28 April, 2017 at 17:51 #37437LitterBugParticipantAll this remapping talk makes me SOOOOooooo glad I am using the RCExplorer F3FC controller on my Tricopters. Works right out of the box.
Cheers!
LitterBug28 April, 2017 at 18:09 #3743828 April, 2017 at 22:34 #37440TheZoq2ParticipantI have been having some trouble tuning the yaw on my tricopter (custom 3d printed, about the same size as the mini) which is running the latest triflight beta. I got it working decently however, when quickly changing the throttle, it doesn’t keep straight. When analyzing the blackbox data, I noticed that the yaw P compensation has a weird pattern. Here is a screenshot of what im talking about http://imgur.com/tmFFqfa. Here is the full blackbox log https://drive.google.com/open?id=0B-ZjOK5GhXS_SlBkdkVOT0xQRVk
As you can see, the P curve seems to follow a line but it has a ton of drops from that value which don’t seem to correspond to any gyro value. The I and D gain don’t have this effect, however there was a ton of noise on the D value until I lowered the gain from 105 to 60.
Is this a configuration issue or some strange software/hardware issue?
28 April, 2017 at 22:46 #37442laukaParticipantOn my phone now, I’ll check the log later during the weekend. I have seen the same occasionally on my copter, but in much smaller magnitude.
If you’re going out flying again, you could try setting tri_motor_acc_yaw_correction to 0. Check if it reduces the drops in the p term.
29 April, 2017 at 01:10 #37444TheZoq2ParticipantAlright, I’ll try that tomorrow
29 April, 2017 at 10:27 #37448TheZoq2ParticipantThat seems to have fixed both the choppy P values and the yaw when quickly changing throttle. Thanks
29 April, 2017 at 12:17 #37449 -
AuthorPosts
- The forum ‘Everything about everything else’ is closed to new topics and replies.