Home › Forums › Everything about the Mini Tricopter › Triflight setup guide
- This topic has 255 replies, 71 voices, and was last updated 4 years, 2 months ago by
danieee.
-
AuthorPosts
-
18 October, 2015 at 17:50 #21513
lauka
ParticipantCould 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:)
18 October, 2015 at 17:58 #21518Terje
ModeratorThe 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 statusServo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boardsvoid 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 positionmyservo.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
}
}18 October, 2015 at 18:02 #21520lauka
ParticipantWhat 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?
18 October, 2015 at 18:06 #21524Terje
ModeratorArduino 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 🙂
18 October, 2015 at 18:44 #21529Terje
ModeratorI’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.
18 October, 2015 at 19:15 #21531Terje
ModeratorHere is the video
18 October, 2015 at 20:15 #21534lauka
ParticipantI 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.
18 October, 2015 at 21:49 #21536Terje
ModeratorI’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.
19 October, 2015 at 03:28 #21545LeoTheHuman
ParticipantIf you find it to be slower on triflight, try betaflight and cleanflight, please.
19 October, 2015 at 08:46 #21551Terje
ModeratorIf anyone wants to replicate my setup to do their own testing, here is the setup: https://123d.circuits.io/circuits/1130531-servo-test-circuit
19 October, 2015 at 09:45 #21554RCExplorer – David
KeymasterI 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
19 October, 2015 at 16:17 #21570Terje
ModeratorI 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)?
19 October, 2015 at 17:14 #21577lauka
ParticipantI 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.
Attachments:
19 October, 2015 at 17:19 #21580lauka
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.
19 October, 2015 at 17:23 #21581Terje
ModeratorSince the PWM on the first four channels seem to be broken, could you remap the function to AUX4 2000us?
-
AuthorPosts
- The forum ‘Everything about the Mini Tricopter’ is closed to new topics and replies.