I made a simple test with a code where i just take the output from the rc controller and pass it to the motors using the servo library and there i saw that the motors have a little delay.
I think that, that small delay when trying to stabilized the bicopter becomes a huge delay.
I can be wrong, so any suggestion is more than welcome.
rossi86m:
I made a simple test with a code where i just take the output from the rc controller and pass it to the motors using the servo library and there i saw that the motors have a little delay.
In what way did you measure this delay?
The time frames involved look instantaneous to the human eye.
I have used RC transmitters with fast response time (Airtronics SD10G) and RC Transmitters with slow response time (Futaba 9c with a Spektrum module).
You cannot visually tell the difference.
Using these on a RC airplane, you could not tell the difference.
But using these different transmitters to fly an RC helicopter and there was a difference you could feel.
Both were flyable. But the faster transmitter let me feel more connected to the heli.
If you have delays with your bicopter control, you need to determine if it is in your code or i the servo library. What is the cycle time on your code?
Edit: I took a look at your code. I see you using atan() a lot.
When I was playing with a hexapod and inverse kinematics, I determined that atan() was too slow. I used an approximation routine to replace atan() and got better results.
And I think that I had many less calls to atan() than you do.
Put some simple time monitoring in your code. Grab millis at the top of every loop and log it to an array. You will quickly fill the array, so stop once you put in some fixed number of entries. Then dump them out so you can see the values. How long does each loop take?
Well, 400 in your init, but that is in your setup so not a problem during the loop.
4 or 5 millis is quite good. The servo library only sends a new pulse every 20 millis if my math is right.
I do understand that many in the quad hobby are going with higher refresh rates to get better (something, I don't know what). But I think that is a relatively recent tech improvement. Plenty of successful aircraft have been made with standard servos, ESCs and servo library.
Yes I saw those guys. They are awesome. But I think they didn't shared the code to have a look at it.
Edit: I tryied using OCR1A and OCR1B. I do not have a really good understanding how that works. I think i got some conflicts or interference with other components i am using that is why i went back to the servo library