Paraglider, with its own pwm regulator

Hi,

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) {
pulseOut(1500);
}
else if (desiredVal<actualVal) {
pulseOut(1500-kp*(actualVal-desiredVal))
}
else{
pulseOut(1500+kp*(desiredVal-actualVal))
}
}

Any help will be highly appreciated.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • 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
This reply was deleted.

Activity

Gremsy liked Gremsy's profile
Mar 12
DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
More…