Category Archives: Lab Updates

Lab 4/17

Today the Expo poster was my only focus. We have to setup the poster between 3 and 5pm today, and we haven’t finished the design, let alone print it out. We had a great start on the poster but we ended up scrapping 3 separate layouts because of the variety of information we put on the poster. We had sensor information, color distance formulas, as well servo communications and the xenomai real-time framework all present on our poster.

Layout problems aside, I was very pleased with how our poster turned out.

You can see it here: ACAS Expo poster

Print Friendly

Lab 4/10

After attaching the rotor guards with hot glue and Styrofoam, I came to the conclusion that they would move around too much during flight and that we needed a better way to hold them steady. Additionally, we have no way to mount the BeagleBoard directly to the quadcopter platform. I talked with Nick Schmidt about this and we came up with a plan to put threaded rod vertically to hold two acrylic plates in place and provide a good mounting point for all of our extra hardware. The rods will go through the rotor guards and hold them firmly in place and do not them move laterally at all.

I spent this lab helping Nick cut and sand metal to provide a secure mount for the acrylic plates and threaded rod we are putting on the platform. From the sound of it, I will not get the completed assembly back for a few days while Nick finishing assembly of the new supports.

Print Friendly

Lab 3/22

I was able to communicate with the ADC today using my code alone. I have finished deciphering the datasheet and now know how to get any information off the ADC that I need. Using my logic analyser, I was able to see the traffic that the BeagleBoard was sending out and it was a great help. The read and write functions appear to send 1 additional byte more than I thought and I never would have guessed without the analyser.

Now I move onto hooking up the IR sensors to the ADC input pins and getting some real data from the boards. The IR sensors need a 5V source, which is provided by my supply that is powering the ADC and high side of the translator. Using the figure off the the ADC datasheet, I found out that the peak output value for the sensor is when it is 15cm from something and it outputs 2.75V. I found this data from this graph off of page 5 of the ADC datasheet:

After some testing, I found that using the onboard voltage reference (which is only 2.5V) the ADC cannot distinguish the entire range it should be able to. Since the ADC compare the 2 voltages, I need to have a higher voltage than what my input it, and I chose 5V because I have it easily accessible. Now I will only use slightly more than half of the ADC range but it is a 12-bit ADC so this should be no problem.

Print Friendly

Lab 3/20

Today I took the code snippet from last week and started making code that actually gets information from the different ADC channels and cycles through them.

I used pages 9-14 of the ADC ADS7828 datasheet to do this. The basic communication structure of the ADC over I2C looks like:

Utilizing what the datasheet told me, I was soon able to get a reasonable response from the ADC board, but it what not the correct channel and the wrong power settings.

The connections I used to provide power and data from the expansion header on the BeagleBoard was found on the I2C tutorial and is as follows:

Since the 5V rail on the BeagleBoard droops to around 4.8V under normal conditions, I used a second power supply for the 5V needed to supply the high voltage side of the translator, the ADC board, and the IR sensors. I am unsure if the stability of the switching regulator will be a problem for acquired data stability of the ADC but I will do testing when I assemble the system.

Today I didn’t quite get my code communicating effectively with the ADC, but I am very close. Here is a link to my progress for today:

i2ctest 3-20

 

Print Friendly

Lab 3/8 I2C finally

Today I worked on the I2C interface to the IR sensors. I started by soldering some pin headers on our new level translators that came in from Sparkfun.

I found a tutorial online that explains I2C on the BeagleBoard. You can find it here. Using what I found there, I located the correct pins on the expansion header to communicate with I2C. I then connected my logic analyzer to those pins and ran a few test commands to make sure I had the correct pins.

After I had the correct pins, I made some wires to connect a translator to the BeagleBoard I2C lines. On the low side of the translator I have a 1.8V rail from the BeagleBoard and on the high side I have a 5V supply. I can read the I2c with my Logic on both sides of the translator, so it is working as intended.

I figured out the power supply connections and jumper configurations for the ADC board and hooked it up on the 5V side of the I2C bus. I used both the ADC Eval Board and the ADC ADS7828 datasheets to find this information. The command I used on the BeagleBoard to check if the ADC was reachable was:

$i2cdetect -r 2

Which showed me that the ADC board was visible at 0x4b on the i2c2 bus from the BeagleBoard.

I then used code pieced together from the tutorial I found to communicate with the I2C bus to talk with my ADC and get data from it. Here is the code:


//#include
//#include These libraries are not really necessary
#include
#include
#include
#include
#include
#include #include
#include
#include
#include

int main(void) {
int file;
char filename[40];
const char *buffer;
int addr = 0x4b;//0b00101001; // The I2C address of the ADC

sprintf(filename,"/dev/i2c-2");
if ((file = open(filename,O_RDWR)) < 0) {
printf("Failed to open the bus.");
/* ERROR HANDLING; you can check errno to see what went wrong */
exit(1);
}

if (ioctl(file,I2C_SLAVE,addr) < 0) {
printf("Failed to acquire bus access and/or talk to slave.\n");
/* ERROR HANDLING; you can check errno to see what went wrong */
exit(1);
}

char buf[10] = {0};
float data;
char channel;
int i;
for(i = 0; i // Using I2C Read
if (read(file,buf,2) != 2) {
/* ERROR HANDLING: i2c transaction failed */
printf("Failed to read from the i2c bus.\n");
buffer = strerror(errno);
printf(buffer);
printf("\n\n");
} else {
data = (float)((buf[0] & 0b00001111)< data = data/4096*5;
channel = ((buf[0] & 0b00110000)>>4);
printf("Channel %02d Data: %04f\n",channel,data);
}
}

//unsigned char reg = 0x10; // Device register to access
//buf[0] = reg;
buf[0] = 0b10001000;

if (write(file,buf,1) != 1) {
/* ERROR HANDLING: i2c transaction failed */
printf("Failed to write to the i2c bus.\n");
buffer = strerror(errno);
printf(buffer);
printf("\n\n");
}
}
Print Friendly

Lab 3/6

Today I worked on the mounts for the Rotor Guards and started looking into the circuit required for the Logic Level Converters that came in today. The mounts for the Rotor guards hold it about level with the blades, to keep them isolated from object laterally.

The logiv translators should be easy to setup, I have found a circuit from NXP that explains what needs to be done in an understandable way.

Of course the low side of the shifting is 1.8V in our case but the circuit layout is the same. The actual schematic for the Sparkfun part can be found here: Level-Converter-v10

Print Friendly

Lab 3/1

Today I spent the day working on the rotor guards. I have the guards almost to the point where I can mount them, I hope tomorrow I can get it mounted and secured to the frame.

Print Friendly

Lab 2/28

Today I learned that Brad has his code compiling and running for PWM generation so I abandoned bitbake for a while. In the level translator arena, I talked with Alex Keating about translators and we came up with a very cheap part that would work for both of our translation problems. The part is very cheap and consists of a 2 transistors for bus isolation and translation. I ordered translators from Digi-key a few weeks ago, but they were too small and I had no way to get them into the system. These new boards solve the problem and cost less than the breakouts for the old chips.

Logic Level Converter on Sparkfun

This should finally solve my I2C translation problem so I can begin work on the code behind the IR sensors into the ADC.

Print Friendly

Lab 2/21

Before going to lab today we went to Lowes and bought a 4′x8′ sheet of open celled styrofoam. We cut it into thirds so it would fit in my car and took it back to the lab. We obtained a utility knife from the shop and went to work cutting out the basic shape of our guards.

While this was going one, I found out that the recompiled bitbake servodrive was once again not the correct kernel version. To fix this Brad and I worked on finding out how to get bitbake to compile servodrive using the linux-omap3 2.6.32 kernel instead of the 2.6.29 kernel it is so fond of.

Print Friendly

Lab 2/16

Today I learned that linux kernel 2.6.37 is not 2.6.32. The bitbake of angstrom (which took 12 hours to compile) was the wrong version so I restarted it with (what I thought was) the correct kernel version found in the openembedded/linux/beagleboard/… folder.

After I started the bitbake again, Brad and I came up with ideas for rotor guards. We eventually settled upon 1inch styrofoam from a home improvement store. I will make a picture of the idea we came up with sometime as we get the material before the next lab period.

Print Friendly