Menu

ArduinoRCLib / Blog: Recent posts

Look what the mailman brought me!

All I need for release 0.5 :)

Posted by dvdouden 2012-11-28

Happy birthday to me!

Well, sorta. It's still about month away but I already ordered my birthday presents, just to make sure they'll be there on time (sure...). But anyway, I'll be the proud owner of an Arduino Mega 2560 (Atmega2560) and a clone Nano (with an Atmega168), so I can finally test whether or not my code actually works on some other hardware than an Atmega328p. I'm especially interested in the 2560 with its truckload of pins.... read more

Posted by dvdouden 2012-11-27

Quick update

Release 0.4 is coming along nicely, a ton of work has been done, loads of features have been added and just a few tickets are open.

Here's a list of new features that have already been completed:

  • Programmable mixes (input to input and output to output); master slave mix with separate rates on positive and negative master input, master offset and offset mix.
  • Offsets; aka conditional trims
  • Hovering adjustments; Trim curves at low, center and high
  • Governor; three rates (switch selectable) and throttle hold supported
  • AIPin calibration
  • Multi engine support; rudder to throttle mixing, throttle cut, throttle idle level
  • Trainer port; teacher student mixing, full processing or copy directly to output, per channel settings
  • Gimbal classes, supports mode 1, 2, 3 and 4
  • Input system for switches, supports 2 and 3 position switches
  • Debugging features; asserts, warnings, debug logging using stdio
  • UART implementation of stdio; use any stdio function over serial
  • Input/output system for channels, PPMIn/Out and ServoIn/Out refactored
  • Programmable flight timer; 1 second to 5 hours, count up or down, audible alerts, supports Buzzer and Speaker
  • Servo speed (configurable from 0.1 to 10 seconds)... read more
Posted by dvdouden 2012-11-27

ArduinoRCLib 0.3 Released!

Phew, finally!

Here's what's new in 0.3:

  • reworked input and output system, most classes can now read from or write to two global arrays using defined indices. You can specify which index/indices to use in the constructor of those classes, or through some getters and setters. See the TX example for a good idea how to use it.
  • Added a DAIPin class which allows you to use digital pins as analog input. Changes from high to low are handled smoothly over a user defined duration, great for smooth flaps or landing gear
  • Added support for the FlycamOne Eco V2 on board camera; easy functions for recording and changing camera modes.
  • Loads of fixed wing options, various wing, tail and rudder types are supported as well as flaps and air brake. Aileron differential is included as well.
  • Support for retractable landing gear, fully configurable.
  • PPMIn now detects loss of signal!
  • Throttle hold
  • Basic input to input mixing; a generic linear master slave mix which you can use to create things like aileron to rudder, or elevator to flaps mixes.
  • Most examples have a lot more comments now to explain things better... read more
Posted by dvdouden 2012-11-14 Labels: release

Release 0.3 a bit delayed

There I was, happy with my working homemade Esky Transmitter setup, and then I just had to break it. I modified bits of code and now it's not doing anything anymore. Can't remember what I changed and forgot to version it... Anyway, my test rig is not working anymore, so I'm unable to test most of the 0.3 features. I hope I can get everything up and running again today so I can release 0.3 this Wednesday.... read more

Posted by dvdouden 2012-11-12

Doing cool stuff

Lately I ran into some issues with the ServoOut class; sometimes servos wouldn't respond or would jitter a lot. At first I suspected the ServoOut code to be buggy, but even stripping it down to the bare minimum didn't solve my problems. After many frustrating hours of trial and error I decided to analyze the generated servo signal with an oscilloscope. Wish I had done that sooner.

As it turns out, the motors in the servos are generating a lot of electrical noise, which in turn messes up the servo signals. The Arduino lacks the filters to filter out this noise. These filters are present on most receivers, as such they have no problems with moving servos at all. Since I have little knowledge about building filters, I decided to stick to using real receivers to test anything that uses servos. Having to deal with a big transmitter and sticking jumper cables in the trainer port is anything but handy.... read more

Posted by dvdouden 2012-11-07

Reworking the output system

Something has been bothering me ever since I started this project: how to handle output of various functions. If you take a look at the Swashplate code you can see the problem: depending on the configuration you get two to four integers as output. Back then I solved this by having the user pass references to variables in which to store the result of swashplate mixing. The problem with this is that the user will have to pass references for all four result integers and was stuck with defining and passing dummy variables for results he doesn't need; ugly.... read more

Posted by dvdouden 2012-11-01

Back to work! 0.3 is on its way!

It's been a while! Renewed interest and a bit of free time can do miracles for a hobby project :) Anyway, I hope to be able to release version 0.3 somewhere this weekend. This release will add the following new features:
- Plane functionality!
- Basic support for multiple wing, tail and rudder types
- Basic support for flaps and air brakes
- A system for simple and more complex retracts (usable for both plane and heli)
On a more technical level I've added a few bits and listened to some requests:
- added a generic mix function (which will be used for programmable mixes in 0.4)
- made PPMOut able to use any pin for output, pins 9 and 10 are still highly recommended, but the other pins should work as well.... read more

Posted by dvdouden 2012-10-31

ArduinoRCLib 0.2 released!

Version 0.2 has been released! Grab it now from the Downloads section! I also finally figured out how to change the "looking for the latest version?" button, so that's pointing to the correct file now.

All new features have been discussed in my previous blog post and they're also in the readme file.

What's next? The next release will be aimed at adding plane specific features. I'll be adding various mixes to support the most common types of airplanes. If you have any suggestions, feel free to post them in the forums or create a ticket. I'm open to all comments and suggestions.

Posted by dvdouden 2012-02-23

0.2 almost ready for release!

I'm really close to releasing version 0.2 of ArduinoRCLib! This release will add Servo signal input/output and PPM input. These are the building blocks you want when you're interested in building a receiver or a flight controller. They allow you to easily read data coming from a receiver and control servos, for example.

Quite a few bits have been refactored, the use of Timer 1 for example, and the use of normalized values vs microseconds.... read more

Posted by dvdouden 2012-02-22

Frustrations. Or: why the Arduino IDE is a mess

It's official, I hate the Arduino IDE. There's just so much wrong with it that I hardly know where to begin...

First and foremost: the build pipeline. Who came up with this anyway? I know Arduino is aimed at beginners, but that's no excuse to make a mess of things. What happens when you hit the 'Verify' button (compile) is the following:

  1. Create a temporary folder somewhere in your user directory, in my case (WinXP) Documents And Settings\User\Local Settings\Temp\build-somerandomnumber. All compiled files end up here, I guess that reduces clutter in your project folder, but what's the problem in having an obj, lib or bin folder in there anyway?
  2. Do some pre-processing on the PDE file, i.e.: add an include for the Arduino header, and create forward declarations for each function in the file. Now I understand why they do this: to keep things simple for beginning programmers; no need to include a platform header and no need to have functions declared before calling them. But in my opinion educating new programmers is a much better idea, and will make life a lot easier for those of us who already know what we're doing.
    • Oh yeah, one tiny little detail: generated function declarations are placed above typedefs. So typedef struct { blah } Sometype; and then using Sometype* as a parameter in a function signature will give you some nice unexplainable compiler errors, since the function declaration will be placed above the typedef. But of course, none of this process is shown to you, you just end up with the errors.
  3. Compile the pre-processed file. There's some magic involved here as well. The pre-processor also scans for includes and tries to figure out which libraries are used. It will add all the necessary include paths to the compiler arguments. I'll explain why this is a problem later on. In Arduino 0.22, compiler warnings are turned off, that's right, no warnings. Seriously? Turns out I was missing a return in one of my functions, great..
  4. Compile all library files that are used.
  5. Link
  6. Upload... read more
Posted by dvdouden 2012-02-21

PPMIn and ServoOut added

I've added a PPMIn class which will help you decode an incoming PPM signal. This can be used for implementing a trainer port, or for building a receiver. It relies on being called by an external interrupt handler, like PCINT0/1/2 or INT0/1. This gives you the freedom to use your own, or some other interrupt handling mechanism (like the pcint library).

Another class that's been added is the ServoOut class. This can be used to control servos. It's kind of like the 'official' Servo library that comes with the Arduino IDE, but that library won't play nicely with the ArduinoRCLib. Also, I hope my implementation performs a bit better, I've done all I can to keep the interrupt handler as small as possible.

Posted by dvdouden 2012-02-18

Another lesson learned...

Never ever ever ever put crucial initialization code (like timer initialization) in the constructor of a class, especially when such a class will be used as a global variable. You simply can't rely on the static initializers, there's no defined order in which static data will be initialized, but you can be pretty sure it will be before your setup() function is called (and even before the Arduino's init code). Chaos ensues. Just spent several hours trying to figure out why the heck my code wouldn't functions properly. You've been warned...
The easiest solution is to introduce a start function to the class to do all the initialization and call it from the setup() function.

Posted by dvdouden 2012-02-17

Whoops... 0.1.1 released.

So much for testing... When I was implementing and testing a PPM decoder I accidentally discovered I made a mistake in the PPM generator; I forgot to subtract the pulse length from the channel length, so instead of a channel value of 1500, I was sending a channel value of 2000 (for a pulse length of 500). Whoops... Next time I'd better hook my test rig up to an oscilloscope, instead of relying on a blinking LED ;)... read more

Posted by dvdouden 2012-02-13

ArduinoRCLib 0.1 released!

Version 0.1 has been released! Check out the downloads section for the zip, it includes Doxygen generated documentation.

I've included schematics for all examples using Fritzing.

Posted by dvdouden 2012-02-12

0.1 almost ready for release!

I've finished refactoring all of my existing code into neat little classes, cleaning up any mess there was and adding some much needed features. I've added samples for all classes and even a fully function six channel helicopter transmitter example. Wiki pages have gotten some content and I even got all the code to be Arduino 1.0 compatible.

All that's left to do now is actually test all the code. That's the last ticket for the 0.1 release. After that it's just tag it, zip it and upload it!

Posted by dvdouden 2012-02-10 Labels: 0.1 release

PPM Added

Phew, pretty major feature implemented! I've added PPM code, I have to admit I have yet to test it, but it's based on code I used earlier, so it should work...

Anyway, it's got some pretty neat features:
-variable amount of channels
-variable servo center point (1500us, 1520us, whatever you want)
-variable servo travel (500us, 600us, whatever)
-variable pulse length (440us, 500us, whatever)
-variable end of frame length (10ms, 5ms, whatever)
-interrupt driven using timer 1, thus extremely low consumption of CPU cycles
-all settings changeable at runtime (even the amount of channels)
-frame synchronization, will always transmit a full frame, even when you change settings
-debug option to slow down PPM output 256 times
-inverted signal option
-work buffer supplied by client code, never uses more memory than needed
-selectable output pin (9 or 10)... read more

Posted by dvdouden 2012-02-09

Hi there!

Welcome to Arduino TX lib, a small library containing all the functions you need to build an Arduino based PPM transmitter! The following features are already implemented, but require some cleaning before they will be made available:

  • gimbal trim/reverse/calibration
  • configurable input (mode 1/2/3/4)
  • Expo
  • Dual rates
  • Flight modes (normal/idle1/idle2)
  • Throttle hold
  • Swashplate mixing for helis (multiple types supported)
  • Channel reverse/subtrim/end points (travel adjust)
  • Throttle curves (9 points)
  • Pitch curves (9 points)
  • Gyro support (heading hold/rate)
  • Configurable PPM output (channel count/order)... read more
Posted by dvdouden 2012-02-07