Jason Short's Posts (62)

Sort by
Developer

Navigation algorithm for wind drift

I've been putting together my own UAV and live in SF so I'm always flying in high winds. Not over SF of course...I built a simulator in flash to hone my algorithm, but I wanted to put it out there to see if anyone had any suggestions. My idea is to basically calculate the optimal position, drift from the position and create a new virtual waypoint to target using a scaled version of the drift vector. It works well, but it does tend to hunt when turning into the wind. I could limit the offset of the virtual waypoint which should help a tad.Here's a link to the Flash Sim. (Requires Flash 10)Here's the Source with updated code to address wind better than the original.Click the image to run the Flash simulator:DriftComp.png
Read more…
Developer
I've been needing a simple RTL for my Easy Star based FPV system, so I bought the ArduPilot. Unfortunately, as Chris pointed out, the ArduPilot code doesn't handle the Fasst's way of setting an out of range PWM signal to be detected by the Ardupilot.So, last weekend I decided to start writing one from scratch specifically for my radio ( 7C 2.4GHz) and I flew it successfully today at Candlestick point in some decent 10mph winds. Things went so well I even had the plane deadstick landing on it's own in decent wind without toughing the controls. Here are some details...version .1 Features:- Auto-calibrate IR sensors, no Z used- Auto-calibrate Stick limits- Stabilization with proportional mixing - no thresholds- Futaba Fasst 2.4 failsafe detect through throttle- Plane will circle when in failsafe and maintain a 40% throttlenext up:- GPS code integrated from Ardupilot- proportional mixing for navigation mode when in autopilotApproach:To start I wanted to have full control at all times with the sticks, full resolution, and no dropped PWMs(@ 50Hz) from the receiver. I hooked up the 3 channels in from the radio to the ardupilot (I had to add a wire for throttle in.) Then I set up an interrupt to watch for ch1 to go high. After that I start timing the cascade of channels with a custom timer function. I also output the throttle while simultaneously watching for a failsafe. This all happens in approximately 3000-6000 µs.Next I read in the IR sensors, scale the input and apply a proportion of about .65 to them. Then I look at the ch1 and ch2 stick position to see how much pitch and roll to apply. Each channel calculates a mix independently and uses that mix to influence the final position. This way I can fly fully stabilized though I'm fully in control.For example:45° to 27° = 100% to 0%< 27° = no stabilizationFor failsafe, I currently just tilt the rudder slightly to the right to do a gentle turn. Next I'll add in the navigation code for RTL capability.Next week I'll hopefully have the RTL functionality in the air for testing. If you try this code out let me know how it works for you.Use:The code is self explanatory, and some wires need to be added to the AruPilot HW.You need to aim each IR sensor window at the ground and sky before each flight (or reset!!! be careful!!!)You need to move the rudder and elevator sticks with each reset to set the servo limits.Download XFPilotJason/
Read more…