RTH and "stabilized mode" with the arduimuv3

This is a schematic of my wiring of the ArduIMU v3. I hope to be able to use this soon as my own personal and custom RTH and 'stabilized mode' solution with some extra benefits highlighted below. One extra analog pin will be used in the future to read out the RSSI level from the attached RC receiver.

This setup demonstrates how far you can push this remarkable board. The W5100 chip provides 30Hz telemetry over wifi to the ground (just make sure to use the sparkfun one, I've seen other implementations with a hardware bug that only allow that SPI device on the bus). It requires a wifi AP specifically designed for long-range connections that allows you to set some specific parameters for your intended range, up to 50km. I still need to see how this performs in the field though, but theoretically it should work nicely.

I'm using this setup in combination with an HD IP camera for a 720p video feed that has 150-200ms latency. The weight of that cam is 160g, so about the same as a gopro+analogcam. The two IP devices onboard are then connected to the onboard LR wifi station by a stripped down ethernet hub I found that fit the requirements. Regular, non-shielded, ethernet cables are stripped down (2x twisted pairs without grey insulation), which over these short distances and bitrate aren't any problem (20-40cm). All in all, it's about 100g heavier than a full analog setup on the same platform (2.3kg).

The benefit of digital over analog is that it's much easier to integrate both the vehicle and sensors into more complex ground station applications. The tasks for piloting, navigation and mission execution for example can be cleanly separated in either machines or persons.This opens up a range of possibilities of how people with different responsibilities interact with the platform or how they use the data that the plane is sending down at high bitrates.

I hope this ignites interest a bit in higher speed datalinks. Although I did manage to find the electronics for connecting stuff together, the hubs and other fairly simple electronics leave many things to be desired. Hopefully more people will consider adding a magjack instead of a serial port on their boards. The advantage of connecting everything on the plane on a single databus is that you can recalibrate *everything* in the air. This opens up ways to use resources more effectively and redirect resources depending on the context within which they are needed. There's something to say for one databus connection that everything is connected to. This facilitates integration and makes interoperability a lot easier.

Views: 916

Comment by Gerard Toonstra on May 15, 2012 at 1:27pm

This is the W5100 breakout: http://www.sparkfun.com/products/9473

MagJack goes to LR wifi, which are strippable COTS systems. See Microtik or ubiquiti. I use the excellent picostation here and experiment with CP antennas to keep the impact of reflections low (reflections really hurt wifi badly). Adjust output power appropriately according to local regulations. Nice thing of ubiquiti is you can start a browser-based spectrum analyzer and they have the AirOS http API that allows you to call scripts on the local and remote router to query noise floor, signal strength and ccq from the GS. It's really easy to add this to the OSD from there.

The ArduIMU just uses the Ethernet library for communications and opens a udp multicast socket. The Arduino ethernet shield uses the same chip. There's a theoretical limit of 2Mb/s, mostly based on the SPI clock frequency and what frequencies other SPI devices may accept. I'm at around 1200 bytes/sec now, which I believe on the serial modem would in this case also equal an unattainable 288,000 bps.

There's room for two open sockets, one multicast and the other accepting incoming control messages of low frequency (calibration request, pid settings, home set, etc.).

Comment by Gerard Toonstra on May 15, 2012 at 3:14pm

I haven't gone further than 500m so far and still need to verify the range in the field and the impact of reflections and interference from other wifi stations. I've looked at DVB-S before this, but couldn't find an affordable module in terms of price and weight, or allowed me to run custom data next to some mpeg video stream of some kind. Clear skies should increase your chances of getting wifi to work, but I have no data to give you an informed opinion.

Comment by Runar on May 15, 2012 at 3:17pm

This looks really interesting, I will probably contact you for details in the next few weeks some time. It's just to much other projects going right now.

Runar

Comment by Rigel on May 16, 2012 at 12:30am

@Gerard and Rana:  Interested in both your setups.  Could you please provide more info on the camera models and setup?  Thanks

Comment by Gerard Toonstra on May 16, 2012 at 2:50am

Rana, it's not necessarily enough to increase output power, as many of these devices assume up to a certain distance away from the base station. So they hardcode the timeout between acknowledgements that the device expects. If that's too low, unnecessary retransmissions will occur and you'd see the transfer performance drop like crazy. Just a heads up there to be aware of that potential issue.


Developer
Comment by John Arne Birkeland on May 16, 2012 at 3:35am

Great stuff.. The older ArduIMU V1&2 was my favorite boards for a long time and would support 8 channel PPM input and solid 6ch servo output with a bit of trickery (more channels possible but pulse timing would suffer).

I used it as a 3 axis head-hold gyro in planes, Helicopter fly-bar less mixer etc.

Comment by Gerard Toonstra on May 16, 2012 at 5:08am

John, this board has two timers available. One is easily used for ppm sum analysis, but that consumes the 16-bit timer. Did you use an 8-bit timer to drive the servo's or the same timer for driving the servo's as well?  I did try to use the same 16bit for both, but that didn't work. This will be an improvement for the v4 version I reckon (which I believe is coming up), as I'd expect at least 2 16-bit timers in there. Interested in what you did there and how good the performance of the servo's was.


Developer
Comment by John Arne Birkeland on May 16, 2012 at 5:54am

I ended up the other way, using 8 bit timer for PPM input using the overflow interrupt to make a 16bit timer. Just add CNT (255) to a uint16 every overflow. And when a PPM pulse triggers the external interrupt, add the current CNT with the uint16 to get the current time.

Servo output is done quickly by cascading the output pins of a PORT using the 16bit timer (also used for ADC timing).

I don't have exact performance numbers but I remember it was in the 1us (1000 servo steps) range.

Comment by Gerard Toonstra on May 16, 2012 at 6:30am

Thanks!  I may well try that out. Indeed, the performance should be around that figure. Not sure if you could achieve 0.5us using something similar to:

------------------------------------

  TCCR1A = ((1WGM10)|(1WGM11));
  TCCR1B = ((1WGM13)|(1WGM12)|(1CS11)|(1ICES1));
  OCR1A = 40000; // 0.5us tick => 50hz freq. The input capture routine
                 // assumes this 40000 for TOP.
  // Enable Input Capture interrupt
  TIMSK1 |= (1ICIE1);

ISR(TIMER1_CAPT_vect){
  static uint16_t prev_icr;
  static uint8_t frame_idx;
  uint16_t icr;
  uint16_t pwidth;

  icr = ICR1;
  // Calculate pulse width assuming timer overflow TOP = 40000
  if ( icr < prev_icr ) {
    pwidth = ( icr + 40000 ) - prev_icr;
  } else {
    pwidth = icr - prev_icr;
  }

  // Was it a sync pulse? If so, reset frame.
  if ( pwidth > 8000 ) {
    frame_idx=0;
  } else {
    // Save pulse into _PWM_RAW array.
    if ( frame_idx < NUM_CHAN ) {
      serinp[ frame_idx++ ] = pwidth;
      if ( frame_idx >= NUM_CHAN ) {
         radio_status = 1;
         last_capture = millis();
      }
    }
  }
  // Save icr for next call.
  prev_icr = icr;

}

------------------

but that's probably not even needed. I tried to find a piece of code where this problem was resolved, but only found the apm2.0 so far. If I get this working, do you mind if I opensource this afterwards?


Developer
Comment by John Arne Birkeland on May 16, 2012 at 7:21am

Why should I mind? As long as it's your work and/or based on already open sourced code.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service