fewlaps / flone-android

🚁 A remote controller for drones with CleanFlight boards
http://flone.cc
55 stars 13 forks source link

Flight Controller Core - Translation matrices #52

Closed JeremyJalpha closed 4 years ago

JeremyJalpha commented 4 years ago

Dear All,

Please may someone very kindly assist me? I have built my own drone with an android phone connected to an IOIO board (https://www.sparkfun.com/products/13613) which outputs PWM signals to my ESCs. For Controls, I have an Xbox remote BlueToothed to the flying phone.

In my android app, I am able to read the stick movements on the remote but now need to convert them to Throttle values to send to the ESCs, so far I have the below:

Given values: Throttle, DeltaX and DeltaY

BL = (((Throttle + (DeltaX - DeltaY))10)+1000) FL = (((Throttle + (DeltaX + DeltaY))10)+1000) BR = (((Throttle - (DeltaX + DeltaY))10)+1000) FR = (((Throttle - (DeltaX - DeltaY))10)+1000)

I am looking for the correct formulas to translate stick movement into a corresponding change in throttle to steer the drone. I am not sure if the above formulas are correct because if the drone is at 100% throttle then some output values would be "clipped" out.

Any advice would be greatly appreciated.

rocboronat commented 4 years ago

Hello @JeremyJalpha!

Sorry, but your issue is not related to this project... By the way, I can give you some advice: write the code by TDD! It's great when writing this kind of small logics that could crash an airplane in the real world 🚁

I hope you find those formulae!