Status

Discussion forum for the CAN-FIX protocol. This is a CANBus based communications protocol specifically suited for experimental aviation.

Moderators: John Nicol, birkelbach

birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Status

Post by birkelbach »

I managed to get the firmware bootloader working that I've been struggling with. Don't ask me which stupid mistake I made. I guess it's in the git repository for all to see but I'll leave it up to you to find it. I'm not gonna fess up. Anyway I posted the code for the bootloader at https://github.com/birkelbach/CFBL_AT328. This is for an Atmel ATMega328P uC that has a Microchip MCP2515 CAN Controller connected to it's SPI port. The README file has more details. There's an AVR Studio project file in the repository. I'll get a Makefile built one of these days, so I can get away from Micro$oft Windblows on this project. The simulavr doesn't simulate the firmware reading/writing and boot reset functions so I had to use AVR Studio.

I've also started a Python program that I'll use as a general CAN-FIX utility for configuration, monitoring, troubleshooting and loading firmware. Right now it's in it's infancy and the only thing that works is a command line version of the firmware loader. It's a pretty bad hack but I'll start cleaning it up and getting a nice GUI built around it. It is my intention to use PyQT for the GUI toolkit. If PyQT is not available I may make it work as an interactive version that has some if not all of the functionality. You can find the beginnings of this program at https://github.com/birkelbach/CAN-FIX-Utility. There should be a lot of room for community involvement here.

The next step is to get a FIX <-> CAN-FIX serial converter working. Since there are at least a few devices out there that talk FIX this should get us started. I don't have any of those devices but it's an ASCII string based communication so we can, at the very least, use it for simulation on the workbench. I'll get that code up on GitHub as soon as I have something that compiles. This and the Utility program will probably grow up together, since I'll be using one to test the other.

If anybody would like to contribute, speak up and we'll find a place to plug you in.
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Status

Post by birkelbach »

I'm thinking of publishing the next version (0.4) of the CAN-FIX spec in the next day or so.

I was thinking about switch inputs and decided that they needed to be a bit higher priority. Things like trim switches and flap control switches are now the highest priority parameters. The idea is that since these would probably only get transmitted on transition from On/Off or Off/On that they'd need to be high on the list. It's a bit counter intuitive since the inputs like pitch and roll control would seem to be more important. Those inputs would be more continuously transmitted so that if a frame is missed here or there it probably wouldn't matter, but if the Pitch Trim Off is missed then we'd have trouble, so I moved those to a pretty high priority in the list.

If anybody has had a chance to review the spec and has any comments let me know. I made the above priority changes and then the odd and end typos and bad grammer fixes that I could find. If something is confusing or hard to understand let me know. I want it to be easy to understand but it's hard for me to tell if it's clear because I already know what I want it to say. Editorial comments are encouraged.
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
User avatar
John Nicol
Posts: 611
Joined: 23 Nov 2011, 12:17
Contact:

Re: Status

Post by John Nicol »

Just a a quick note to ourselves. I think it would be useful if someone wanted to look at an API toolkit for implementation of CAN-FIX, even if it was a stub library for experimentation with only a few things implemented, it would lower barriers to entry I think for the "average" maker. Something to consider and welcome feedback on this idea.
-----
John Nicol
Founder, MakerPlane
User avatar
John Nicol
Posts: 611
Joined: 23 Nov 2011, 12:17
Contact:

Re: Status

Post by John Nicol »

Did a quick search online and came across this really interesting post on Make from CES. Directly related to my previous post:

http://blog.makezine.com/2013/01/11/mak ... d-hackers/
-----
John Nicol
Founder, MakerPlane
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Status

Post by birkelbach »

I thought I'd take a minute to update everybody on the progress. What little there is. I have a pretty good bit of code written for the Arduino based USB/Serial<->CAN interface. You can find the code and schematic at https://github.com/birkelbach/ArduinoCAN. It is by no means finished but it does communicate over both ports. Now I just need to finish the protocol logic. I wrote up a little manual to document how I think it'll work. I've attached that to this post. It's all pretty hacked together at the moment but it's not that big of a project so I hope to finish it and get it cleaned up pretty soon. Comments are welcome.

I've also been working a bit on the Utility software. It's slow going, mostly because I've been messing with the Arduino stuff. As always you can check out where I am on the GitHub page. https://github.com/birkelbach/CAN-FIX-Utility. There is a lot of room for collaboration here. If you are a Python / PyQt developer, or (like me) you want to become one someday, your help would be greatly appreciated.

We still need a CAN-FIX logo. Any artists out there....?
Attachments
CANInterface.pdf
USB/Serial<->CAN Interface User Manual
(266.96 KiB) Downloaded 840 times
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
User avatar
John Nicol
Posts: 611
Joined: 23 Nov 2011, 12:17
Contact:

Re: Status

Post by John Nicol »

Hi Phil,

Great stuff. I will order a couple of MCP2515 and 2551 chips today and try to get ahead of the curve to help out. Do you have a pcb file to go with the schematic and a BOM to order the parts?

I ordered an OLED and LCD screen from 4D Systems this week as well and I should get them early next week. The transparent OLED was tempting, but expensive for initial prototyping work. I loaded up the 4D Systems graphics IDE as well and it looks really good for creating instrumentation quickly and then uploading onto the screen's ROM.

I have been brushing up on my Arduino serial comms sketches and I am looking at interfacing with Lockheed Martin Prepar3D flight simulator. http://www.prepar3D.com (I was the Principal Engineer on this product when I was at Lockheed, so I am completely biased.) I think it might be interesting to stimulate the CAN-FIX network with flight data coming in from the simulator. It is a side project that will help me get into Arduino more and in fact I was looking at doing this anyway when I was still at Lockheed. I don't want that to be a distraction from the main effort, I will post pix and info as I get through it. My intention would be to convert data coming out of Prepar3D into CAN-FIX ready frames. My thought would be that it is just another node on the bus feeding data.

Regards,
John
-----
John Nicol
Founder, MakerPlane
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Status

Post by birkelbach »

I just put together a BOM the other day. Here it is. I'll put it in the GitHub repository too. I didn't make a PCB file since I was just doing this on a proto board. There are some commercial CAN Shields out there that use basically the same setup. I didn't really see any need to reinvent that wheel. I don't think you could order a board and the parts for the price that you could buy some of these boards. Somebody that is better than me at all this should design an Arduino with the CAN controller built in.
The capacitors are just bypass caps, so use whatever electrolytic or tantalum caps you have around. The resistors are also not very unique. Whatever you have on hand will work. You could even get some at Radio Crack. The D-Sub is not strictly necessary. Most D-Sub connectors are not very breadboard friendly anyway. I just cut the end off of a serial cable. Since I'm in the industrial controls business I have a lot of serial cables to cut up. :-)

This is only a starting point. I might make a couple of changes on the next version. Some LEDs to indicate TXCAN and RXCAN would be handy. If I were to make a commercial version of this, I'd also add a few other LED's for status. Right now I just want to get it working. There are several pins on the MCP2515 that might come in handy. There are request to send pins for each transmit buffer that would save sending those messages over the SPI port but how much effort does that really save? I'll probably hook up the INT pin and use interrupts when I get around to the actual CAN-FIX stuff. A jumper with the terminating resistor would be helpful as well.

It's funny that you mention the flight simulator interface. I was thinking yesterday (yes I said yesterday) about how much easier it'd be to develop/debug display equipment, if there were an X-Plane interface to CAN-FIX. I even went so far as to look at the X-Plane site to find out what kind of information is available and how to access it. I think this would be pretty trivial. Another place where somebody could make a contribution.

If anybody wants to step in and help with any of this, let me know what I can do to help you get started. This is me begging. I'll make it my personal goal to get a working prototype of the USB interface done by this weekend. There I've said it in public. I have to do it now or risk international embarrassment. :-) Then I can concentrate my effort on the Utility software (this really needs a name).
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
User avatar
John Nicol
Posts: 611
Joined: 23 Nov 2011, 12:17
Contact:

Re: Status

Post by John Nicol »

Hi Phil,

Thanks for your reply. Yeah, I will be able to design an integrated CAN-Arduino board specific to our needs when we get to that point. It can be a simple CAN-FIX node that can be build upon as needed. That will be fairly straight forward. Probably want to add in support for an LCD or OLED display connector etc.

I was looking at the CAN Mini Board http://www.futurlec.com/Mini_CAN_Board.shtml to start off prototyping with, but it doesn't come with the 2551, so it is easier and probably cheaper in the long run to just use the proto shield and parts from digikey or mouser.

I just found some info on existing FSX/Prepar3D arduino interfaces with open source code, so in fact there is most likely a head start in this direction already.

John
-----
John Nicol
Founder, MakerPlane
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Status

Post by birkelbach »

I've spent some time fiddling with the specification over the last few days. A simple question about writing VHF frequencies pointed out a deficiency in the parameters. Some of these parameters need to be set from one node and reported by another. I panicked a little bit and spent some time rethinking things. I kicked around the idea of using the full extended identifier but I think that might be a bit drastic at this point. I've been working on this for years and I'm getting a bit antsy about getting something actually talking. Others are working on display hardware and are going to want some information to display pretty quickly. So I stuck with what I have with some tweaks. Here are some of the notable changes...
  • Added OBI flags
  • Added a generic encoder pilot input parameter.
  • Added some generic switch and analog parameters
  • Reduced the number of engines that we had allocated from 4 to 2
  • Added some parameters to separate "setting" from "reporting" on a few types of information. Mainly the altimeter setting and radio frequencies.
  • I had room for 4 sets of waypoints. My original thought was that there could be up to 4 navigation radios. Now I'm thinking that the airplane can't have more than one destination. Having multiple radios doesn't change that. I'm still not sure about the best way to interface with these devices or even if it should be a CAN-FIX function. I left some room in the spec for more parameters to address this problem in the future. Kicking the can so to speak.
I've attached the spreadsheet that I use on my end to keep track of the parameters. I haven't put the changes into the draft yet. Let me know if you guys see anything. We're getting pretty close to starting to implement this on some real hardware so changes are going to get more and more difficult as we get further and further along.
Attachments
CAN-FIX-0.5.ods
(41.72 KiB) Downloaded 873 times
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Status

Post by birkelbach »

So I decided to release another version of the specification.

This is 0.5. It's still a draft but we've sent enough data on the bus that I'm starting to feel comfortable that we are on the right track. I've sent it to a few people and I'm not getting any comments back so no news it good news, right?

There are still a lot of blanks that need filling in for the parameter list. Most notably the the ADS-B information. I just don't know enough about that to know if I'm even in the ballpark.

The changes to this version are documented in the spec.

http://sourceforge.net/projects/fix-pro ... f/download

Another thing that I added was the XML file that represents the protocol. http://sourceforge.net/projects/fix-pro ... l/download This makes it much easier to write programs that need to know parameter details. This is used in the Utility program on my GitHub page... https://github.com/birkelbach/CAN-FIX-Utility. I've been using this internally for a while but I figured I'd post it in case it helps someone.

Comments are always welcome.
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
Post Reply