I am currently making a paraglider(Several cons and pros for that approach, but I wanted todo something different:) I want to use pixhawk to control it. So the paraglider is like a plane with rudder,elevator and motor. My problem is that the rudder is operated by a brushless motor with a gearbox and a potentiometer as feedback. So I could attach an arduino nano read in the pwm signal from pixhawk and potentiometer and generate a modified pwm out. However I would rather modify the arduplane code, the question is which file to modify:)

So if the potentiometer reads out a value of 512 the esc should get a pulse of 1500 if the stick is in neutral, if the stick is slightly to the left then the potentiometer should read less then 512 and so on.

My pseudo code is shown below:

void setup() {
// put your setup code here, to run once:
deadVal = 50; //if we are close to desired value we will
//save energy by not running motor, i.e a dead pulsewidt
kp = 0.5; //gain to adjust motor input

void loop() {
// put your main code here, to run repeatedly:
actualVal = map(analogRead(A0),1000,2000);
desiredVal = pwmRead();//Where can this value be read??

if (abs(desiredVal-actualVal)<deadVal) {
else if (desiredVal<actualVal) {

Any help will be highly appreciated.

Views: 216

Reply to This

Replies to This Discussion

any updates of your project? I am the same thought as well, apm does not support paragliders yet but we can use arduino to modify the signals from pixhawk, i think we can use arduplane firmware

Reply to Discussion



Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service