Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Barnabybear
#55593 Hi, you may well have a fix now, if not.
If you consider the basic functions of a processor it can only add, subtract and compare. So whilst square root may not exist as a function it’s not too hard to replicate. Basically multiply two numbers that are the same and compare the result to the number you need the square root of. If the answer is to large reduce the starting number, if to small increase the starting number. How quickly you arrive at your answer depends on feedback, how much you adjust your starting value each time you calculate.
You have an advantage in that if you are working in degrees you know the maximum and minimum values, so you can produce a guessing table starting in the middle @180 deg. Then guesses at 90 deg higher or lower dependant on the previous answer. So the guesses would go:
90, 45, 22, 11, 6, 3, 1.5, 0.7 you could get to just better than 1 deg in 8 attempts (which basically all a processor function does).
And yes I said it could only add, subtract and compare so how can it multiply;
For (x - x; x = x; x++); {
x+=x;
}
or something like that with some bit shifting thrown in – its late , but it works for whole numbers & you get the idea.
User avatar
By dwindey1
#55811
RichardS wrote:
mrburnette wrote:
ESP8266 as a flight controller. In theory is could work. - See more at: viewtopic.php?f=32&t=11880#sthash.lvIVIuo4.dpuf


I think you have failed to consider that the 'user' timeslice for the Arduino code must relinquish control every 50mS to the RF section of the chip to handle the networking features. Having 50mS gaps (or more often if your loop() structure executes faster than every 50mS) is going to play havoc with any flight-controller functionality! IMO.

Ray


My thoughts also....

RichardS


RichardS,
I downloaded a more recent version, and the angles can be calculated now. thanks !

Can you give a bit more info on the above thought ?

Didier
User avatar
By RichardS
#56535 The ESP8266 can not have you hog the processor and you need to let it do its thing at least every 50mS, and it takes time away from the flight mathematics.... it needs this time to service the WIFI and TCP/IP stack.....

RichardS