All Posts (11086)

Sort by
Developer

Ardupilot 2.5 preview part 5

Merry Christmas everyone.I wanted to talk about a new aspect of 2.5 that enables coders to easily program missions through a simple API. The main idea is that many common events are sent to functions in the event.pde file to be handled by you in any way you see fit. You can do anything and access any variable in the system - within reason. The events.pde file can be swapped out with a different mission and uploaded to the the hardware.The first and most important event is the switch_event. This event is called when the 3-position switch on the radio has changed. The function set_mode(MODE) is called and the argument is one of the following flight modes:MANUAL - complete radio controlSTABILIZE - uses IR sensors to stabilize the aircraftFLY_BY_WIRE - allows the user to "steer" the aircraft using autopilot control loopsAUTO - exactly what you thinkRTL - Fly home nowLOITER - Circle around current location (set when aircraft arrives at home during RTL)An example of setting the current waypoint back to the index 1 is shown when the switch is in manual position.
void switch_event(byte switchPosition){        switch(switchPosition)        {                case 1: // First position                set_mode(MANUAL);                // this is handy function to restart your mission:                reset_waypoint_index();                break;                case 2: // middle position                set_mode(AUTO);                break;                case 3: // last position                set_mode(STABILIZE);                break;        }}
The next most important event is a waypoint event. There are a few basic events called (more will be added as necessary.) In the example below Loiter mode is turned on when we load WP 3. The variable elapsedTime is set to 0 ( elapsedTime is a user defined timer that increments in milliseconds.) If you want to stop Loitering after a set number of seconds, see the next example below.
void waypoint_event(byte event){        switch(event)        {                case EVENT_WILL_REACH_WAYPOINT:                        // called just before wp_index is incemented                        Serial.print("Reached WP:");                        Serial.println(wp_index,DEC);                        break;                case EVENT_SET_NEW_WAYPOINT_INDEX:                        // called just after wp_index is incemented                        Serial.print("Now going to WP:");                        Serial.println(wp_index,DEC);                        break;                case EVENT_LOADED_WAYPOINT:                        // called just after wp is loaded from memory                        Serial.print("Loaded WP index: ");                        Serial.println(wp_index,DEC);                        print_current_waypoint();                        // custom loitering code                        if (wp_index == 3){                                set_mode(LOITER);                                elapsedTime = 0;                        }                        break;                // called when the pattern to be flown is automatically restarted                case EVENT_LOOP:                         Serial.println("Looped WP Index");                        print_current_waypoint();                        break;                  }}
The mainLoop_event is called with every execution of the control loop. Here is a good place to check the elapsedTime variable to escape Loiter mode and continue on with the mission.
// called AFTER every control loopvoid mainLoop_event(void){        if (control_mode == LOITER){                if (wp_index == 2 && elapsedTime > 120000 ){ // 2 minutes                        elapsedTime = 0;                        // our waypoints index is not altered during LOITER                        // All we need to do is reload the waypoint                        load_waypoint();                        // and return to Autopilot mode!                        set_mode(AUTO);                }        }}
Other events include:void gps_event(void)void low_battery_event(void)void failsafe_event()More will be added as necessary, and of course, you can add your own.JasonNext installment - The Mission Simulator
Read more…
Developer

ArduIMU v1 hardware users - Firmware help

It just came to my attention that people trying to use the latest revision firmware with the older ArduIMU hardware were having problems. The current revision firmware has lots of goodies in it that the pre-v2 hardware firmware did not have such as much better vibration resistance, euler angle output, binary message output for Ardu-IMU-Pilot, etc. We had included code in recent revisions to allow use of either hardware, but I guess neither Jordi, Jose, or myself had checked it on the v1 hardware.There was an error in the sensor_sign[ ] declaration. It has been corrected in revision R19.If you have had trouble downloading all the individual files of the latest revision source code I have added a zipped download file of R19. To select between v1 and v2 hardware you need to pick one of two pairs of of declaration lines to comment out at around line 53. They are commented so you can see which you need. Just place the // in front of the pair you do not need....
Read more…
3D Robotics

Finally, a working Osprey-like RC model?

GAUI TG-609 from Michael Yang on Vimeo.

The civilian version of the Osprey V22 tilt rotor is the TG-609. Such a vertical take off, fixed wing flight platform has long been a UAV dream, but it's proven too tricky for RC modeling to date. Now Gaui seems to have cracked the code. After more than a year of development, mostly on working on the transition from heli mode to fixed wing mode, it appears ready to release the plane. The above video gives a sense of how it will fly; although it doesn't show full fixed wing mode yet, it's at least half-way there. It's not for sale yet, but apparently Empire RC will be the distributor in the US. I'm not sure this is the ideal UAV platform, due to limited payload capacity and very sensitive CG. But if you want something with the launch flexibility of a heli and the duration and flight effeciency of a plane, maybe this is worth checking out. Here's a bunch of pictures of the aircraft on the ground and in flight.
Read more…
3D Robotics
If you've been following Tom Pyke's progress on his impressive Gluonpilot, you will have seen that he's implementing it with a realtime operating system (RTOS), rather than programming "straight to the iron" the way most autopilots are done, to gain maximum control over interrupts, timing and the like. He's using a relatively powerful dsPIC chip, which can handle the overhead of the RTOS (I think he's using FreeRTOS, but I've pinged him to find outUPDATE: yes, it's FreeRTOS. See below). Here, he makes the case for a RTOS: "The main advantage of a real time OS is that you can use threads (which we will use tasks from now on). You don't need to bother anymore about the delay your telemetry processing can cause to your Kalman filter or PID control. No more need for timed loops or Timer interrupt routines. It looks perfect! There are some things you need to keep in mind: You need to prioritize every task Every task has a separate stack. This stack is used for the task itself AND every interrupt routine that may be called during this task's execution Thats about it! Let's take a look at the different tasks in gluonpilot: --Telemetry: All the output needed for our groundstation --ConsoleInput: Processing and answering all the commands you send to the autopilot --Sensors: Gathers and processes (filters!) all the sensors (gyroscope, accelerometer, gps, pressure sensor) on our autopilot module --Control: Sends the correct position to the servos! This handles both manual, stabilized and full autopilot modes." The prioritization of the tasks is as follows:

Read on here. UPDATE: In an email, Tom explains more: "Yes I'm using FreeRTOS. Whether you should need to consider it [I had asked him if it would work on a 16Mhz Atmega--chris] is not easy to answer. 16MHz doesn't seem a lot. The dsPic runs at 80MHz (40MIPS) and - I think - has more memory. Using an RTOS does not cause an extreme amount of overhead, but you can no longer push the processor to its limits: - You need more memory because interrupts can be executed (and use the stack) of any running task/thread (and you need to assign a stack size to every task) - You need enough spare CPU cycles to make sure all tasks can always be handled in time. - And the RTOS needs memory, flash and CPU time of its own It may sound contradictory, but I started using FreeRTOS to make sure people can easier add code to the autopilot. In the last version without it, the code became complex and critical to change, because of all the timing-critical code and timed loops. Now with the RTOS, people can add lower priority tasks and I'm sure the manual control and time-critical filtering still works. However, you need to keep the design as simple as possible. The only features I'm currently using is the scheduler (because it's easier than a timed loop) and a queue mechanism for pushing data from an interrupt to a sleeping thread. There are some RTOS pitfalls such as priority inversions. But it's really up to you how far you want to go. Replacing your timer interrupt routine by a threads wonn't give you any problems you didn't have already. If you use mutexes for mutual exclusion all over your code, than you're down to a more challenging task :-) In the end, I can only suggest that you play with it for a day or two... port some existing code to FreeRTOS and see how comfortable you are using it. It's not really that complex."
Read more…
3D Robotics

$30 laser rangefinder!

Cool news for those interested in SLAM (Simultaneous Localization and Mapping) for indoors robotics. From Hizook: "A commercially-available ultra low-cost laser rangefinder is finally set to hit department store shelves in February! I'm speaking of the laser rangefinder presented at ICRA 2008 that costs $30 to build that sits atop the recently announced Neato Robotics XV-11 vacuum cleaner. Others have thoroughly discussed the XV-11's competitiveness with iRobot products, the possible patent infringement of iRobots square-front design, and its ability to perform SLAM. But everyone has glossed over the coolest part: Forget the $400 robot, $60 batteries, $30 wheels (etc.) available for pre-order on Neato's website... if made available, sub-$100 laser rangefinders would revolutionize hobby robotics! Read on for a description of this compelling (future?) component. Neato sponsored an ICRA 2008 research paper entitled, "A Low-Cost Laser Distance Sensor," that detailed the design of laser rangefinder that costs only $30 to build. Called the "Revo LDS", it is pictured above. Diagram of operation below:

Unlike the more expensive (many thousands of dollars) laser rangefinders that use time of flight measurements, such as those discussed here and here, the Revo LDS triangulates the distance to an object using a fixed-angle laser pointer and a CMOS imager, with a known baseline between the two. To quote: `A compact, rigid point-beam triangulation module incorporating laser, imager, and electronics. With a low-cost CMOS imager and a DSP for subpixel interpolation, we get good range resolution out to 6 m with a 5 cm baseline, at a 4 KHz rate. The key insight to the Revo is that high precision is possible with a small baseline, because of the digital image sensor.` A motor spins the unit at 10Hz to give a full 360-degree field of view. An optical encoder gives 1-degree angular accuracy. Not exactly Earth-shattering, but simple and low-cost. An enclosed, robust USB version of this sensor would have broad appeal, and open up the world of hobby robotics to a sensor that is ubiquitous on research robots. Oh, and I suppose the XV-11 isn't half-bad either: I seriously hope that Neato makes the laser rangefinder component available separately, but it is currently not listed on their website for purchase. At the moment, I am a bit worried about the possibility of litigation due to similarities between the XV-11 and an iRobot patent (see below). Hopefully they see the light and avoid destructive lawsuits." Read the whole thing here.
Read more…

Careers in Aerospace

Hello everyone! I'm fascinated by the work you all do! www.JustAerospaceJobs.com is a site that aggregates all aerospace jobs in the US from a variety of sources, making it a highly efficient tool for finding careers in the aerospace industry. I hope some of you can benefit from it!
Read more…

Basic understanding of ESC

I'm trying to find out what is the maximum update rate for a typical ESC is. I saw that most quad copter designed require the ESC update rate to be very high, i.e 100Hz or more.My understanding a ESC takes a PPM signal from 1ms to 2ms with a 20ms duty cycle. So a max of 50Hz update rate, is that correct? Is there some "play" in the duty cycle maybe max of 10ms. Or I'm way off base? Looking at ESC data sheets seem to be missing this information.
Read more…
Developer

Ardupilot 2.5 preview part 4

Just like in the previous version of Ardupilot, throttle control maintains speed and altitude. I've made a little demo to help demystify the behavior of throttle control. This loop uses a special scaling feature that brings up the throttle to a high level when the airspeed dips below the desired cruising speed. Altitude of the plane is also maintained with the throttle by increasing the desired airspeed. Finally airspeed is scaled to match a throttle output %.Here is the Flash Source: PID Throttle.fla.zipNext installment: Events API
Read more…
Developer

Ardupilot 2.5 preview part 3

Ardupilot 2.5 has the same heading control as before with the addition of a simple controller to adjust the rate or turn for the rudder. To give you a better tool for setting gains and for understanding what happens where and why, here is a handy interactive version of the PID code.Mouse the mouse left or right to indicate which direction the plane should be turning. Up and down control the current roll of the plane.
Read more…
3D Robotics
Free video streaming by Ustream Tonight (Sunday) we'll do podcast #12, which everyone here is welcome to participate in by listening to the chat live above and commenting and asking questions via the DIY Drones chat function. We'll be starting at 9:00 PM PST and will probably go about 40 minutes. This week we'll by joined by Abe Bachrach of MIT's quadcopter/indoors navigation team, talking about their platform and technology. Here's a video to remind you: As always you can subscribe to the podcast here. Tonight's livecast will be recorded and available as a podcast on Monday.
Read more…
Developer

Ardupilot 2.5 preview part 2

Ok this post is about crosstrack error. Ardupilot 2.5 has a basic system for adjusting the plane's bearing when it has steered off of its intended path due to wind. Thanks to Doug Weibel for the code.
XTRACK_GAIN = .2if (abs(bearing_error) < 25) {        bearing_error += sin(radians(crosstrack_heading - bearing_error)) * wp_distance * XTRACK_GAIN;}
We set the crosstrack from our starting location as the angle toward the waypoint. As we get blown from side to side, that angle changes. We run that through sine to get a nice ratio and multiply it to get an angle to add to our heading.Depending on the gain and bearing error, we can get wild results, so we need to limit the effect to a range of degrees. In this case 25°. If we go outside of 25° by a lot, we can reset the crosstrack to be from the current location.Here is an example:
Read more…
Developer

Ardupilot 2.5 preview part 1

Hey all,I thought I would start featuring what's new in 2.5. As you might know it's more than bug fixes. It's an entirely rewritten version that's intended to scale up and be customizable for all sorts of fun things including future projects like Mega. I just finished the loitering code so I thought I'd post that feature first.On a tip from Ryan Beall, I implemented a simple vector field algorithm that holds the orbit around a location by specifying the radius to hold.Here is the code:
if(LOITER){        if (WP_distance < radius){                power = WP_distance / radius;        }else if (WPDistance < (radius * 2)){                power = (radius - WP_distance) / radius;        }        bearing_error += power * -90;}
This says the closer we are to the radius the more we turn 90 to the waypoint. The sign can be changed to adjust the direction of orbit for things like implementing turn prediction. Simple!In Ardupilot 2.5 you will be able to loiter over any location or specific waypoints.That's it.-Jason
Read more…

C++ or Java?

I ahve been a passive member of this community a while, but greatly inspired by knowledge and igenuity of the members on this forum. I am gearing up to go for Grad school and do MS in Computer Science hoping to specailize in AI. Its been years since I finished undergrad and that was the last time I worked with programing languages. I am now trying to sharpen my programming skills and get them to speed and am wondering which programming language I should develop proficiency in. Iam thinking of C++ or Java. Anyone knows what the trends are and which programing languages are most common within the AI community?
Read more…
3D Robotics
From the latest AUVSI magazine, Unmanned Systems, comes a fascinating article about the early history of UAVs, then target drones. An excerpt (issue is not online): "Radioplane Co. opened up an assembly facility in Van Nuys to begin mass production. With World War II in full gear by 1945, Yank magazine, an Army weekly, was keen on covering women working on production lines for the effort. Army photographer David Conover asked his commanding officer Ronald Reagan (yes that one) for a lead, and he sent him down to his acting buddy Denny's facility. When he got there, he was taken with a young woman spraying plane parts with fire retardant and inspecting parachutes. Her name was Norma Jean Dougherty. While her husband was in the Merchant Marines, she worked 10-hour days for the Radioplane Munitions Factory." After photographing Norma Jean (above), Conover advised her to apply for a job at the Blue Book Modelling Agency. They were looking for girls with lighter hair, so she bleached hers, joined the agency and eventually changed her name to Marilyn Monroe. And the rest is history....
Read more…
Developer

Final Beta of the Ardupilot 2.5 Airframe Test

I finally had some quality time with the Ardupilot Airframe Tester in the air and would like to report, after a few bug fixes and tweaking, I finally have a nice solution.Why this matters and why you should fly it:- It will help you set up your plane properly and give you vital debugging information.- It will help you adjust your stabilization gains- It is a very nice flight stabilizer- It will let you test your Autopilot setup (more on this below)You can read this post to learn about the debugging aspects.What I really wanted to explain is the new Fly-By-Wire mode. It essentially lets you input the relative waypoint location in space, and the plane will try to go there. Now, other than being fun, it is really helpful for debugging and adjusting your gain settings.The new FBW input is proportional and controlled with your radio:Hard right = waypoint is 35° to the right; centered = waypoint is dead ahead; left = -35°Hard up means the waypoint is below you (hey, you can reverse that if you want.) Centered means the waypoint is at the same altitude.While in FBW, the airspeed controller will try and maintain a constant airspeed.Here is the last beta. After this the tester will be final and appear in the download section.Ardupilot_25_Airframe_test_beta4.zipA note about radios - In the header file you can specify radios. Futaba Faast radios can be scanned at 50hz and others at only 25hz. This has to do with how they setup the signals. So there is an option in the header file to use Fubata or other radios. Default is "other." (Spectrum's won't work with the Futaba setting. You need to specify 'other')The events.pde file contains the code for managing your radio's 3 position switch. Instructions are in there as well.The full version of 2.5 should be right around the corner.Jason
Read more…
3D Robotics

Commercial antenna tracker unit ($90)

Here's a good looking ground antenna tracking unit with pan and tilt servos for $90. From the product description: "Antenna pan/tilt assembly kit designed to work with the ImmersionRC EZ Antenna Tracker. Designed to hold patch antennas, with direct mounting points for L-Com 8dBi, 14dBi, and diversity Patch antennas. May work with other antennas as well. Includes two HS-485HB Servos, Gears and rotation hardware, 1/4-20 tripod mount, hook-and-loop and double sided tape for holding Duo2400 and EZ Antenna Tracker, standard 1/2" 1/4-20 and 10-24 bolts for antenna mounting." Although it's designed to work with a custom electronics unit, which in turn works with EzOSD, it looks like it would work as well with ArduStation. Here's a video of it in action. Check it out--it's really cool:

Antenna Pan Tilt Test Flight from Mr.Pibb on Vimeo.

Read more…