tag:blogger.com,1999:blog-63978080389759449692024-02-06T22:57:07.929-05:00Luke's Near Space BalloonLukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-6397808038975944969.post-56256317584368395702011-07-03T01:51:00.000-04:002011-07-03T01:51:39.161-04:002011 BalloonI decided a partial success wasn't good enough. On July 24th I will be launching my second balloon from the Ritzville, WA high school. I've setup a new website with pictures and a google map to track the balloon live on launch day. Check out barney.gonzaga.edu/~lwardens. I've added in the long range 900 MHz radio this year, so I expect tracking and recovery to be much more robust.Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-4023123894132183372010-07-03T23:44:00.002-04:002010-07-07T10:16:55.950-04:00Partial Success?Well, the balloon definitely went up and we got some good GPS locations from it. The text messages received from the balloon fairly closely followed the University of Wyoming's balloon prediction tool. The problem is that we stopped receiving texts, the balloon was definitely still on its way up, and it's now past the 4 hour battery life of the payload. Tomorrow we're going to make a futile effort to find where it landed based on the prediction model, but it's pretty well a lost cause now. The worst part is that I completely forgot to write my phone number on the payload, so there really isn't any hope of getting it back. I'm going to send a picture to all the sheriff's departments in the area just in case.<br />
I hope anyone reading this blog has enjoyed the challenges and successes. If I happen to find the payload or if it comes back to me somehow I'll be certain to post it here. The last known location was 46.082375°, -107.913120°<br />
<br />
UPDATE...not that good of one....<br />
After searching for the balloon based on the UWYO flight prediction and some extrapolation we didn't find anything. I have sent a text message to the cellular number just in case someone finds it and is clever enough to try the SIM in a phone. I'll leave the SIM active for a month and monitor activity on the line. The flight path and the data received from the flight computer are shown below. Since the altitude reporting from the balloon wasn't working I can't say exactly how high it was when I received the last text, but if the model is any indication it was above 60,000 feet. There was a cell tower almost directly beneath the balloon at that time and the antenna on the balloon was oriented so the major lobe of radiation was directed downwards. I've removed some outlier points from the flight computer reports, but you can see that it followed the UWYO model very closely until the last two reported points. Even at the last two you can see that it was turning the corner like the model had shown. My best guess is that it burst and landed somewhere that there was no cell coverage. I am really kicking myself for not writing my phone number on the payload...lesson learned for next time.<br />
With the balloon searching out of the way I have enjoyed the last three days in Yellowstone National Park with my dad and Arhan. This was the real reason for my trip to Montana, the balloon was just a fun experiment and challenge. I'm considering a second balloon since I have most of the hardware, but next time I'll add in a zigbee radio and a much larger battery.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIzXdaMvRDFTDTRO5DSt31CK_PgliDKK0UXkw1kaOXOfS4xahJFsNvxAx7snNzB24UbuBLiPW_oXyzpKI7T1YyIVf0_A-zcsAs6M1IL3AD-f29fqbqhBayAdh3FLF4atFauGuXsVs5_ZuB/s1600/flight_path.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIzXdaMvRDFTDTRO5DSt31CK_PgliDKK0UXkw1kaOXOfS4xahJFsNvxAx7snNzB24UbuBLiPW_oXyzpKI7T1YyIVf0_A-zcsAs6M1IL3AD-f29fqbqhBayAdh3FLF4atFauGuXsVs5_ZuB/s640/flight_path.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Purple is the model and the yellow pins are the received data from the flight computer</div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF-skQySNJS6TVY_kto3YoIRDq6cbGe1wbhodLU5DEQLW0IpOtw-FP4Q3DN9k9BYa1YSwnZQnCyURIMOhkNAYY66mzx_g6lRZnn-UXZEpPihaKe_ODH4LISzMwKV-f3WO-b8ZIDThACId7/s1600/Yellowstone+Traffic+Jam.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF-skQySNJS6TVY_kto3YoIRDq6cbGe1wbhodLU5DEQLW0IpOtw-FP4Q3DN9k9BYa1YSwnZQnCyURIMOhkNAYY66mzx_g6lRZnn-UXZEpPihaKe_ODH4LISzMwKV-f3WO-b8ZIDThACId7/s640/Yellowstone+Traffic+Jam.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Yellowstone traffic jam...damn buffalo</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXSTgoXp3foylQzMqHBRxlALCUUKi6YLhyphenhyphenn2mY0KcyFKLFZpCh7-2_2wYxCKQ9gmT0wqJixfgNoG-fjpGJ16QNG0WeCyjEJUdNKe-FrjkUHnHJk0viG2gfG06N6CjNV4Nn5_pwrV27kvk7/s1600/Blacktail+Deer+Creek.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXSTgoXp3foylQzMqHBRxlALCUUKi6YLhyphenhyphenn2mY0KcyFKLFZpCh7-2_2wYxCKQ9gmT0wqJixfgNoG-fjpGJ16QNG0WeCyjEJUdNKe-FrjkUHnHJk0viG2gfG06N6CjNV4Nn5_pwrV27kvk7/s640/Blacktail+Deer+Creek.JPG" width="640" /></a><br />
<div class="separator" style="clear: both; text-align: center;">Arhan and I at the start of the Blacktail Deer Creek trail</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFuCZE_Xu7k3rT_r8DxYy0sO5emFMlNsN5_PTt_6_jpLitMMaH-iUd4kf7dusWBodTvzVVbvvW5Rw5uDoqEMH8I_ENmuUfm9p9nRZDj4_FgiNMcrehgn2VVZpljMtth5hCjbIcafeuO0Z/s1600/Beartooth+Summit+10,500+feet.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFuCZE_Xu7k3rT_r8DxYy0sO5emFMlNsN5_PTt_6_jpLitMMaH-iUd4kf7dusWBodTvzVVbvvW5Rw5uDoqEMH8I_ENmuUfm9p9nRZDj4_FgiNMcrehgn2VVZpljMtth5hCjbIcafeuO0Z/s640/Beartooth+Summit+10,500+feet.JPG" width="640" /></a><br />
<div class="separator" style="clear: both; text-align: center;">Dad and I at the top of the Beartooth Pass about 10,500 feet elevation</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com3tag:blogger.com,1999:blog-6397808038975944969.post-33771124906643423452010-07-03T18:05:00.001-04:002010-07-03T21:30:20.387-04:00F@#* YOU T-MOBILE!!!!!We got to the launch site and found that my software wasn't quite working, so we postponed the launch and while working on the software I discovered that I couldn't make CSD calls again... I called up T-Mobile technical support and their response was that I didn't have a T-Mobile phone so they wouldn't support me. The only thing I could think is that no cellular carrier makes their own phone, the product they sell is the network access and T-Mobile was blatantly refusing to support their product. I will never use or recommend T-Mobile ever again. I hope you join me in this effort.<br />
As a backup I am having the balloon send me text messages with the GPS information. It's not perfect, but it should work. Hopefully there will be pretty pictures of space posted here tonight, otherwise I'm going to purchase as many explosive fireworks as I can just to destroy all evidence of my failure hahaha!<br />
<br />
<br />
UPDATE!!!<br />
The balloon is well on its way. Arhan, my dad, and I are waiting in our hotel in Billings for some final position to be reached. At last record the balloon was at 46.082375,-107.913120. The altitude from the GPS doesn't seem to be working as it is constantly reporting 4092.34 feet. If it would have been at that altitude during its flight there were several 6000 feet tall mountains that it would have crashed into. Some launch pictures and video are below. I'll post up the pictures from the recovered payload when it happens. Wish us luck! I'm still angry at T-Mobile...<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrCfcF8uo2mXiN7uAivr4-uh4NhB94Vd7J8Lk6tVxDQ0_6lC8mCYUi81dkRgy9EPgu04AwEs1iFl2_u4wJXVyRXBBJ8wsC21taHy0CIxGhcliaZK3euwj-n7aqYWWSnfpD2-Cy-qJ367rK/s1600/preflight.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrCfcF8uo2mXiN7uAivr4-uh4NhB94Vd7J8Lk6tVxDQ0_6lC8mCYUi81dkRgy9EPgu04AwEs1iFl2_u4wJXVyRXBBJ8wsC21taHy0CIxGhcliaZK3euwj-n7aqYWWSnfpD2-Cy-qJ367rK/s640/preflight.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">A little preflight action with Luke and Arhan</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitQLs80Vd95ean_xxhSQakbvq2lsIkDbBrOER4WsWD-mJYxzSr3J_YcCFVAkAyCinyzYDDCNohtJRdJMCrXythyq9BSodbWoKKcokOnzykX2e39jBK-yevD3_sTNPhPHH2tOLpzG6zR_i/s1600/DSCN0045.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitQLs80Vd95ean_xxhSQakbvq2lsIkDbBrOER4WsWD-mJYxzSr3J_YcCFVAkAyCinyzYDDCNohtJRdJMCrXythyq9BSodbWoKKcokOnzykX2e39jBK-yevD3_sTNPhPHH2tOLpzG6zR_i/s640/DSCN0045.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Launch time, Farmer Jim is standing in the back. He just showed up and was very curious and friendly!</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAiWIHAr0PEjFbmuXntk4KPmPiz8olRkGdXm42NVahCyZ1pOvrqTOQkiQ5KcO1pHLEWZd2326CZGSRkyEbiyPHYWSIr-az6jcw5QI7lCtaurdM3U7L7QEJ_JBYgqncTIGdzDLgm9T7XbdP/s1600/flight.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAiWIHAr0PEjFbmuXntk4KPmPiz8olRkGdXm42NVahCyZ1pOvrqTOQkiQ5KcO1pHLEWZd2326CZGSRkyEbiyPHYWSIr-az6jcw5QI7lCtaurdM3U7L7QEJ_JBYgqncTIGdzDLgm9T7XbdP/s640/flight.jpg" width="640" /></a></div><br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/VnIF5hhMpF0&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/VnIF5hhMpF0&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Db_5eLEy_4g&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Db_5eLEy_4g&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com4tag:blogger.com,1999:blog-6397808038975944969.post-8753191405423654202010-07-02T15:11:00.001-04:002010-07-03T11:50:11.055-04:00How sweet it isNot only is it Friday, it's the Friday after payday, the weather is perfect, I got off work early, and I'm heading to beautiful Montana in a few hours. Looking at the forecast for the Billings,MT area I see that there are predictions of thunderstorms for the next two days... I'm still hopeful that it will be clear skies tomorrow at 2pm for the launch, but it may be delayed until Sunday or possibly Wednesday if things look cloudy. I'm moving the launch site to the side of Hwy 312 somewhere just north of Fromberg, MT. I'm concerned that the original site is a little too close to the airport and the winds look strong so I'll need to adjust to keep the landing in a cellphone friendly area. I'll post another update tonight when I can feel for myself what the weather is like in Billings. <br />
<br />
To all thieves planning on ransacking my apartment:<br />
Do you really want to try stealing things from a guy that designs crazy electronic stuff? Who knows what might be waiting for you inside...<br />
<br />
UPDATE!!!<br />
The weather looks a bit cloudy, but the launch will go ahead as planned from Fromberg, MT. The lat/long is 45.413430, -108.889972 which is just a bit south of Montaqua Rd. There is a pulloff on the west side of the road where we'll be in a white pickup filling up a big balloon. The fun should start at about 1:45.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaVYAcGfnGI5yrG3GiH6EOV3z1ubRigidXHBmtTEpaaZKWKLo-2RAfrqodF3jQgYWlN96Ok7ofwycG4kimIkQei78nLJJdgQ9gg3mHnoP8Ncc_gldoGaXKl6_l1-CZ9A-tL1-szsWmqNcu/s1600/IMG_0007.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaVYAcGfnGI5yrG3GiH6EOV3z1ubRigidXHBmtTEpaaZKWKLo-2RAfrqodF3jQgYWlN96Ok7ofwycG4kimIkQei78nLJJdgQ9gg3mHnoP8Ncc_gldoGaXKl6_l1-CZ9A-tL1-szsWmqNcu/s640/IMG_0007.JPG" width="480" /></a></div><div class="separator" style="clear: both; text-align: center;">The DC airport didn't have them in my size, but I thought about it haha</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNUwTWFy7FtisycTyWe4dFjsGNegAE2WqhKZFIqv7QzjDmSMAXOxpjglo5syzePSgmIOj1kKsNtOYTGqQVaBKs_JW0jZbpYyy4x3gq2BPE0Sh0xd1uoQyVT3ssxeKRczwGFF2BxNRC4BUx/s1600/IMG_0009.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNUwTWFy7FtisycTyWe4dFjsGNegAE2WqhKZFIqv7QzjDmSMAXOxpjglo5syzePSgmIOj1kKsNtOYTGqQVaBKs_JW0jZbpYyy4x3gq2BPE0Sh0xd1uoQyVT3ssxeKRczwGFF2BxNRC4BUx/s640/IMG_0009.JPG" width="480" /></a></div><div class="separator" style="clear: both; text-align: center;">Somewhere over the Dakota's dreaming about what the pictures would look like from 3 times this altitude</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-11196505641008101292010-06-29T01:26:00.000-04:002010-06-29T01:26:47.256-04:00Turn up the heat and the pressure's on!After a 3 hour test run of my flight computer and cameras I had a lot of success and one problem. I ended the test by putting the whole payload in my freezer. The flight computer came out just fine, but the cameras shut down from being too cold. I've added insulation and space blanket wrapping to keep them warm, but I don't know if it will be enough for the -50 F temperatures. My freezer read as -2 C (about 30 F). Below are graphs of pressure and temperature during the testing.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHKfPUGFBuloWG8eAgpnVuNcn60DOL16uVGCUBIsfaysNtqr-y2mAQp9ttCJgldOVlAf46KaSjkbDwSnneS3tyDdYhgkdhDxyyzcf9XVA9Ar8tPZ0gOb4kyQ6sfz8NOd0J_BVCSsV4psF/s1600/pressure.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHKfPUGFBuloWG8eAgpnVuNcn60DOL16uVGCUBIsfaysNtqr-y2mAQp9ttCJgldOVlAf46KaSjkbDwSnneS3tyDdYhgkdhDxyyzcf9XVA9Ar8tPZ0gOb4kyQ6sfz8NOd0J_BVCSsV4psF/s640/pressure.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Pressure in PSIA</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4W9vK0Bjhus5_XTxq9YGYjJ2cuupzagap73-yYGZJxffdBCNDWgqdnJhHEyY0PGEKGEH-cfkaINjCPBTBCX_M8uJd7tKDMWMIQ67WaE59sHpepXT150vcItOotj_rRWPcvcOW1R8lrRC/s1600/temperature.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="410" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4W9vK0Bjhus5_XTxq9YGYjJ2cuupzagap73-yYGZJxffdBCNDWgqdnJhHEyY0PGEKGEH-cfkaINjCPBTBCX_M8uJd7tKDMWMIQ67WaE59sHpepXT150vcItOotj_rRWPcvcOW1R8lrRC/s640/temperature.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Temperature in degrees C</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;">With the data gathering out of the way I've been covering the payload casing in space blanket to make it reflective to radar. I wouldn't appreciate it if an airplane hit my project, but I think they would be even more angry. I've also done more flight predictions and come up with a tentative launch site. The site is east of Billings just off of the freeway on Yellowstone Trail Rd. You can see the launch spot in the picture below. The other picture shows the University of Wyoming's flight prediction (<a href="http://weather.uwyo.edu/polar/balloon_traj.html">http://weather.uwyo.edu/polar/balloon_traj.html</a>) and the Near Space Venture's landing spot prediction (<a href="http://nearspaceventures.com/w3Baltrak/readyget.pl">http://nearspaceventures.com/w3Baltrak/readyget.pl</a>). The difference is that the University of Wyoming won't let me put in my ascent or descent rates. I expect the actual landing site will be somewhere in-between the two, which would be great. I hope to see a ton of people at the launch site and be completely surprised...by the one person following this blog I thing it's going to be just me, Arhan, and my dad though. I'll post the final launch site as soon as it is solidly established and I'm thinking about a twitter feed.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJc9olNod28YEbYesfH16_jGN7yirsjtcwePLuScfVmMP66Q3iqWwncSqu5GF3Vsai96s0RIVhHY8Q_x2CW3JZNCsAS5abT7VYOA7Pgxg8Mrp52Jfmw8GzUuKUxwnMbQInZRJ8WnTfTTFK/s1600/launch_spot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="432" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJc9olNod28YEbYesfH16_jGN7yirsjtcwePLuScfVmMP66Q3iqWwncSqu5GF3Vsai96s0RIVhHY8Q_x2CW3JZNCsAS5abT7VYOA7Pgxg8Mrp52Jfmw8GzUuKUxwnMbQInZRJ8WnTfTTFK/s640/launch_spot.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Launching East of Billings, MT on Yellowstone Trail</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqpTiYazAcatNHkyjGnjQ79X1c7chE2qY95JQZzOBUxtJhMRurcJ_F58CqEXt6Oq3rvoHHTF-L_cwt2mxtoXdTNrVk1hAJykwuN1cBkxPrS-Mk-K3tT8MnNZ9piRHUgaf2qLLUxuLMITSR/s1600/flight.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="432" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqpTiYazAcatNHkyjGnjQ79X1c7chE2qY95JQZzOBUxtJhMRurcJ_F58CqEXt6Oq3rvoHHTF-L_cwt2mxtoXdTNrVk1hAJykwuN1cBkxPrS-Mk-K3tT8MnNZ9piRHUgaf2qLLUxuLMITSR/s640/flight.jpg" width="640" /></a></div><div style="text-align: center;">The flight predictions have the balloon going further east</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-87684181421899014832010-06-27T00:03:00.000-04:002010-06-27T00:03:02.720-04:00Put it all together, and what have you got?The answer is a somewhat shabby looking near space balloon payload. It is all working brilliantly though! You can see in the pictures below how the parachute bay folds open and how there is a string that wraps around the soda bottle to a 2 prong hook to hold the hatch closed during the ascent. There's a servo motor inside that pulls the hook closed during ascent and pushes the hook out when the set altitude is crossed twice (once going up primes the circuit and then on the way down the servo pushes the hook out letting the parachute hatch be opened by the force of wind).<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxVwQYnzNmvVBLV6ZTihSaSNZQjcTGds8B5Bi6_QPjeU1HbPzn9dVfj4gJaYAK52uxS2f38nfpDloX7_PPsOIJSlqtgnnbRgvI6BG4Iy5_TEBnflaWBx9XdWQiN_qEWgN6vYfR1v9RrPh4/s1600/FILE0034.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxVwQYnzNmvVBLV6ZTihSaSNZQjcTGds8B5Bi6_QPjeU1HbPzn9dVfj4gJaYAK52uxS2f38nfpDloX7_PPsOIJSlqtgnnbRgvI6BG4Iy5_TEBnflaWBx9XdWQiN_qEWgN6vYfR1v9RrPh4/s640/FILE0034.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Parachute bay open, cameras in the green section</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk1PNIW9jOw9dbbE8-xq-MqIS3CD9kCP9D8wfv6LgvLT7RL0_Y6LSNiKkCOLlLkZy9X-5SstZn2Tlq8SdizYl1pMroNsTIBvnXmDw0C0WXSTc6TIg_PHvb9sWxPvJtgNvGpkmsT7WGyBXI/s1600/FILE0035.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk1PNIW9jOw9dbbE8-xq-MqIS3CD9kCP9D8wfv6LgvLT7RL0_Y6LSNiKkCOLlLkZy9X-5SstZn2Tlq8SdizYl1pMroNsTIBvnXmDw0C0WXSTc6TIg_PHvb9sWxPvJtgNvGpkmsT7WGyBXI/s640/FILE0035.JPG" width="640" /></a></div><div style="text-align: center;">GPS antenna on the left, pressure sensor where the coiled wires are in the middle</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCfzKiv2gXfjgB55kfWO2jeAQobGulML7xIUBELtgjUpy7kKypv_pXqT_39tMTYwH8tDy9lFjDCwaBqqdPWPjAVd0f5FluPCtDG1TJiL0D5f6EbheKTyrDFqN3MsHG5q7DpVcktII0xoib/s1600/FILE0036.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCfzKiv2gXfjgB55kfWO2jeAQobGulML7xIUBELtgjUpy7kKypv_pXqT_39tMTYwH8tDy9lFjDCwaBqqdPWPjAVd0f5FluPCtDG1TJiL0D5f6EbheKTyrDFqN3MsHG5q7DpVcktII0xoib/s640/FILE0036.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">2 prong hook holding parachute bay closed by the string</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbC1xSqybEkiNo3tchlOQ-Nm4t6zV-BuxltJzIeouO911gaziTzG7WPzs13gBhyphenhyphenCi21pS6MJrH4cxVYiC_AEY7dnss5wTpybSNSGtcsT-qUlKhPapGKjMSshp1MMWcbbIIf8IaBVlHLlaz/s1600/FILE0037.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbC1xSqybEkiNo3tchlOQ-Nm4t6zV-BuxltJzIeouO911gaziTzG7WPzs13gBhyphenhyphenCi21pS6MJrH4cxVYiC_AEY7dnss5wTpybSNSGtcsT-qUlKhPapGKjMSshp1MMWcbbIIf8IaBVlHLlaz/s640/FILE0037.JPG" width="640" /></a></div><div style="text-align: center;">Cellular antenna from EAD-LTD.com</div><div style="text-align: center;"><br />
</div><div style="text-align: left;">Last weekend I also did a test inflation and tethered flight of the payload I had completed at the time. During that inflation I used a nitrogen regulator on a 130 cubic foot helium tank. In-between the regulator and the balloon was just a section of air hose, which worked alright to inflate. The problem with that setup is that I had no idea how much weight the balloon was lifting. I had to use my hand to keep the balloon sealed to the air hose, so we just filled the balloon until the tank was empty. I've seen on a few websites that 1 extra pound of weight is enough to give the balloon a 1000 ft/minute ascent rate. Sure, I could just inflate the balloon all the way and let it rocket up until it bursts, but the less helium I put in the higher it will go (it has to be able to lift the payload of course and it has to make it through the cold tropopause without getting too brittle). With all that in mind I created a new end for the filling hose that weighs just under 1 pound. The filling end fits snugly in the balloon opening and with the help of a hose clamp it will add exactly one pound of weight to my payload. Now I just hang my payload from the red lever on the filling end, fill up the balloon until it starts to lift the payload off the ground, tie everything off, and let it go.</div><div style="text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9frPpfjEHbPyhE9SYC4gJ5lpPjFdd-hDsFGK5RotcnC_FZlFTt7fEJcZixK6KCsXyFrTjNP3j4jUHr02JRhGAJu7C7FRJxGtukxZoL-B5vbzbSfBozSTcxfMJC1lyX1azEspSYL7mrIh7/s1600/FILE0031.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9frPpfjEHbPyhE9SYC4gJ5lpPjFdd-hDsFGK5RotcnC_FZlFTt7fEJcZixK6KCsXyFrTjNP3j4jUHr02JRhGAJu7C7FRJxGtukxZoL-B5vbzbSfBozSTcxfMJC1lyX1azEspSYL7mrIh7/s640/FILE0031.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">Regulator, hose, and filling end</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_RJICSLkt1mci4_kkeiFNG1rhzJjchOtq54pQ1lppYpzQVyRe0UZ8LoWhJwulEAPyAeVULpaTm0pe0R0HKjlh3AuEYgY2F0dMiruxqrZM8o5TJevhqUduhzGXBmkQ5ZfvbBFKVxqCcj1a/s1600/FILE0033.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_RJICSLkt1mci4_kkeiFNG1rhzJjchOtq54pQ1lppYpzQVyRe0UZ8LoWhJwulEAPyAeVULpaTm0pe0R0HKjlh3AuEYgY2F0dMiruxqrZM8o5TJevhqUduhzGXBmkQ5ZfvbBFKVxqCcj1a/s640/FILE0033.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">The filling end is a 3/4" brass plumbing shutoff valve, and a 3/4" to 1/2" adapter to connect to the hose. On the balloon end of the shutoff valve I have added some automotive gasket material and silicone to make the end round instead of the hex bolt shape. It's very difficult to get a good seal on the balloon with the hex shape.</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Looks like this time I was early on my deadline! Tomorrow I'm going to do lots of testing and then put the finishing touches on the payload. It will look a lot nicer once I get the space blanket wrapped around it. It's kinda like a classic car without the chrome bumpers right now. See you next time space cowboys!</div><div style="text-align: left;"><br />
</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-40000481965767453542010-06-24T23:02:00.000-04:002010-06-24T23:02:18.688-04:00GPS Tracking and Logging...finallyWell it's about time that things are coming together. I have one week left before the launch, so it's getting a bit tense. I have decided to scrap the idea of steering the payload back to the launch location. I don't have the time to make the mechanical pieces, the code would be simple though. I also scrapped the SD cards since they were not being very reliable. I am now logging the data to the microcontroller's flash memory. I have three things left to finalize. The first is the parachute ejection system, the second is the pressure sensor logging, and the final one is the finishing touches of the payload. I should have it all tidied up by the end of the weekend...I think I've said those words several times on this blog and have yet to live up to it...<br />
Anyway, below are some pictures of a car trip I took with the flight computer GPS logging and my computer tracking the trip live. I've written a windows application to read the serial data coming from my GM862 cellular module. It displays the most current reading and writes all the captured data to a .kml file to be displayed in Google Earth. In Google Earth you can create a network location that points to the .kml file and has a refresh rate so the data is updated in "real time."<br />
<br />
<br />
<ul><li><a href="http://www.mediafire.com/?dyhmzuwd4jn">My windows tracking application and source code</a></li>
<li><a href="http://www.mediafire.com/?twy5tw142jj">My AVR Studio project for the flight computer firmware</a></li>
<li><a href="http://www.mediafire.com/?ryzy1ybai2a">The tracking application .kml file</a></li>
<li><a href="http://www.mediafire.com/?yyjyzty22jz">A .kml file created from the flight computer log</a></li>
</ul><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFxH8wrwbCpWcMvYD87Qysm9bpZdPB15_zZZkT14oWm3CEgdz_8buexgsV5Rxts_HGqN6Z3JGi2r8rnRRLb-7a-C8nb39Ep1PzcxMERpLFrk-rvaHLABcBmKGyhOSsW3MbF3qBt6xcUgyD/s1600/tracker.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="397" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFxH8wrwbCpWcMvYD87Qysm9bpZdPB15_zZZkT14oWm3CEgdz_8buexgsV5Rxts_HGqN6Z3JGi2r8rnRRLb-7a-C8nb39Ep1PzcxMERpLFrk-rvaHLABcBmKGyhOSsW3MbF3qBt6xcUgyD/s400/tracker.jpg" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;">My glorious tracking application!</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7LP1bU5RuR9ZkEfXtq0f3SjEaWJtQnWbPyn7QjUV23ejMmgCcgRid_YB_9JtCdkD_xFg8saoa76b9KAj_eyb9NX2o5WasC_yeJ9qR-J3g9c4jac3XsY8tvV0EZZedR_hBvz_7oxA5P7Re/s1600/test_drive.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="432" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7LP1bU5RuR9ZkEfXtq0f3SjEaWJtQnWbPyn7QjUV23ejMmgCcgRid_YB_9JtCdkD_xFg8saoa76b9KAj_eyb9NX2o5WasC_yeJ9qR-J3g9c4jac3XsY8tvV0EZZedR_hBvz_7oxA5P7Re/s640/test_drive.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">The track generated by my tracking application (~1 GPS point per second)</div><div class="separator" style="clear: both; text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMNj9NGs-l0MGRxVso8K1PRFkdRhzX6RINv3xBOfC2AqnZ_7qPY2oQ9CSYcwwTw41zBID9fGj3Rs5k8y8qr0LOpLj57OWQOy0IZKsQlwrmROsr3KI_ZTudq6Jui53_R6YLGuXRSZHPYAfU/s1600/log_test.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="432" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMNj9NGs-l0MGRxVso8K1PRFkdRhzX6RINv3xBOfC2AqnZ_7qPY2oQ9CSYcwwTw41zBID9fGj3Rs5k8y8qr0LOpLj57OWQOy0IZKsQlwrmROsr3KI_ZTudq6Jui53_R6YLGuXRSZHPYAfU/s640/log_test.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;">The track generated from the flight computer log (10 seconds of averaged data per point)</div><div><br />
</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-82248478872707054692010-06-16T22:22:00.000-04:002010-06-16T22:22:40.112-04:00Oh, to make a CSD call...Well, it's been a tough week. The balloons and parachute came in over the weekend, so I was very excited at the start. Then, I spent $50 on an AT&T SIM card only to find out that they don't support CSD calls (it's like a fax machine or a dial-up modem). I borrowed two T-mobile SIM cards to test them for CSD calls and it worked! I quickly went to the T-mobile store and tried to buy two prepaid cards, but this store locks their prepaid cards in a time-lock vault after 5pm. I showed up bright and early the next morning to buy the cards and when I went to test them they didn't actually get activated. Since I'll never be able to get to the store before 5pm before my test launch on Saturday I had to get a refund and go shopping elsewhere. I found another T-mobile store and ended up paying twice as much for the SIM cards as the first store. I was also told that CSD calls would definitely work. By this time it should be no surprise to you that CSD calls do not work with T-mobile prepaid SIM cards. Tomorrow I am going to attempt to get the SIM cards converted into a one month family plan, wish me luck!<br />
Since I don't want to leave you with a bad taste in your mouth (it should be about poopy flavored lollie pop by now), I'm going to attach the balloon and parachute photos below. You'll notice that the parachute is not the normal circular shape. The "x-form" parachute is used by high powered amateur rockets because it reduces the drifting caused by wind. That sounds like a brilliant thing to use on this project. We'll see how it turns out in about two weeks!<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYYLjh4jtqN3RVBcUlzoqk78epXXclo3EqVfrWC8hS7WmsllxU6gHo7bZUN4LbUPS45KTydN41YAGdmdv47Cy1tZ6qllLsBYrZWZ1yYGu_QTWlhQVn0FQpAcIrZrHajYgHzFlb2MNMhTpD/s1600/FILE0025.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYYLjh4jtqN3RVBcUlzoqk78epXXclo3EqVfrWC8hS7WmsllxU6gHo7bZUN4LbUPS45KTydN41YAGdmdv47Cy1tZ6qllLsBYrZWZ1yYGu_QTWlhQVn0FQpAcIrZrHajYgHzFlb2MNMhTpD/s640/FILE0025.JPG" width="640" /></a></div><div style="text-align: center;">6' in diameter!!! 1200 gram balloon from Kaymont</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAAy7gFSKLvf6fZEqZfEx-VEO0aQPMPPkIXKNMsJ5ZM37kbR9VP9O7u1bZJTvXErwBqMoU9sLc7rnpEejgUx7qWZaUkTA6-sLu8bbdj-5Vg7lI6J4JSFgTh1Cq63VkA6svZsfj5widj2ml/s1600/FILE0026.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAAy7gFSKLvf6fZEqZfEx-VEO0aQPMPPkIXKNMsJ5ZM37kbR9VP9O7u1bZJTvXErwBqMoU9sLc7rnpEejgUx7qWZaUkTA6-sLu8bbdj-5Vg7lI6J4JSFgTh1Cq63VkA6svZsfj5widj2ml/s640/FILE0026.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-N0JaHDgHUZmLCX9MLvtMXBzuLJ2ipqtyVaxqhxSKdcU77kz6ek-fTmQHjG3lICNH51l_3xvNvLYaz6I4K4XzDhyecWmS_GRJlW-G5wutWfMB1bLJF6cGa4jgCb9rhGr5zSse9glg8NOA/s1600/FILE0027.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-N0JaHDgHUZmLCX9MLvtMXBzuLJ2ipqtyVaxqhxSKdcU77kz6ek-fTmQHjG3lICNH51l_3xvNvLYaz6I4K4XzDhyecWmS_GRJlW-G5wutWfMB1bLJF6cGa4jgCb9rhGr5zSse9glg8NOA/s640/FILE0027.JPG" width="640" /></a></div><div style="text-align: center;">Inlet is about 2.5" in diameter and very stiff</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR7q9b-jKxDNMkJ8NV85sFKMkfGGsNbCTjX_dJXxBq8msGhBuwBZbRAELct2vlPrIjSvTNFAJcANT021WZ0tqGGI6LulyAGGvK4giVKEd7olqkXq_F_8kInKJ0noyJLeslqBO082MlRxNm/s1600/FILE0029.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR7q9b-jKxDNMkJ8NV85sFKMkfGGsNbCTjX_dJXxBq8msGhBuwBZbRAELct2vlPrIjSvTNFAJcANT021WZ0tqGGI6LulyAGGvK4giVKEd7olqkXq_F_8kInKJ0noyJLeslqBO082MlRxNm/s640/FILE0029.JPG" width="640" /></a></div><div style="text-align: center;">60" x-form parachute from Top Flight Recovery (purchased from Performance Hobbies)</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2JPr9-S58arQwttWWG8m8ilbqTckcidDxXwunmZQSqGrc-fxcfvTOwPoXv3u5LmZgjU6VMRzHHezV6MiIb5fCQKPdTVxNNMfflw4w8Qmydjcgt6bqb4erYaLcCzkEdiTs0zyG94VV1w3n/s1600/FILE0030.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2JPr9-S58arQwttWWG8m8ilbqTckcidDxXwunmZQSqGrc-fxcfvTOwPoXv3u5LmZgjU6VMRzHHezV6MiIb5fCQKPdTVxNNMfflw4w8Qmydjcgt6bqb4erYaLcCzkEdiTs0zyG94VV1w3n/s640/FILE0030.JPG" width="640" /></a></div><div style="text-align: center;">60" chute folds to about 4"x2"</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ9SbFUwaYR3nTIPAKEwAE0w69h7A2uNUIRI-2qoqcc1i77gELKeMP591-WdO4X4E8BcXr53uNVm8BwY-FTBpGYScFpPPc9RfNhR6h-SR2T-sFXhX7Vr8plJ6YoSYHX_o7jyyIOpHxSmJG/s1600/FILE0018.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ9SbFUwaYR3nTIPAKEwAE0w69h7A2uNUIRI-2qoqcc1i77gELKeMP591-WdO4X4E8BcXr53uNVm8BwY-FTBpGYScFpPPc9RfNhR6h-SR2T-sFXhX7Vr8plJ6YoSYHX_o7jyyIOpHxSmJG/s640/FILE0018.JPG" width="640" /></a></div><div style="text-align: center;">Dismantled Argus Bean camera</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjxei3AWBu3fb3cQ4Hs3zlpeobY9yG5FZClib5Ky1DvHe-pUDDe8C8NJPXss8Cq3RQICgq3dTJ7QV12IQl1hWswhhzmE0mW18xZJhg01_vIW55DSJCDxpeGAKP9NzvlRui-2rsvA8Fisho/s1600/FILE0020.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjxei3AWBu3fb3cQ4Hs3zlpeobY9yG5FZClib5Ky1DvHe-pUDDe8C8NJPXss8Cq3RQICgq3dTJ7QV12IQl1hWswhhzmE0mW18xZJhg01_vIW55DSJCDxpeGAKP9NzvlRui-2rsvA8Fisho/s640/FILE0020.JPG" width="640" /></a></div><div style="text-align: center;">Deeper inside</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgkhZnoEpJ4QCn42S2CZ3UAfbA7FBR-Mxhbgd2Q0Ss-RY-63JX7XbkDvc_DzU7AiqwVH8l1ssWxs9qkxNxxoXiHakGCoG9R3gGkUk81RRnvOnMu2tMBrMCqV4hkYxyns7BF6o4QHzmHh42/s1600/FILE0023.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgkhZnoEpJ4QCn42S2CZ3UAfbA7FBR-Mxhbgd2Q0Ss-RY-63JX7XbkDvc_DzU7AiqwVH8l1ssWxs9qkxNxxoXiHakGCoG9R3gGkUk81RRnvOnMu2tMBrMCqV4hkYxyns7BF6o4QHzmHh42/s640/FILE0023.JPG" width="640" /></a></div><div style="text-align: center;">All back together with wires soldered across the shutter switch so I can virtually snap photos with the microcontroller.</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-20736738519353747572010-06-07T13:02:00.000-04:002010-06-07T13:02:03.247-04:00FAABefore I start talking about who you need to notify about your launch I'm going to tell you that you should read Part 101 Subpart D of the FAA regulations. You can find the current version on <a href="http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr&tpl=/ecfrbrowse/Title14/14tab_02.tpl">the FAA's website</a>. If you read the whole Part 101 regulation you'll notice at the very start that the regulation only applies to free balloons with payloads heavier than 4 pounds, so most amateur projects won't really fall under the scope of the regulation. You should still follow all of the rules in Subpart D to remove yourself from as much liability as possible. Not following the rules can lead to fines, imprisonment, and more importantly could seriously injure or kill someone.<br />
Now, on to who you need to talk to. I have to admit that I've heard horror stories about dealing with the FAA and I was very nervous about calling. It doesn't help that I didn't really know what office I should call or who I needed to talk to about this project. I started by calling the FISDO (flight inspection safety district office) in Helena, MT. They seemed to be the most prominent FAA presence in Montana, and it turned out to be a pretty good choice. The FISDO doesn't have anything to do with small balloon launches, but they did point me to the right ATC (air traffic control) office. The ATC office doesn't actually have anything to do with small free balloons either, but information about your launch will get communicated to them through the NOTAM system. NOTAM (notice to airmen) is a system of hazardous condition reporting for the skies. It covers things from air shows to volcano eruptions...yes we're looking at you Iceland. The ATC office I talked to gave me a phone number for Prescott Flight Service Station (877-487-6867). They apparently handle all of the NOTAM reporting for the "West US." I have no idea what is included in "West US" so you should call the FAA ATC office closest to your launch and ask what the NOTAM reporting number is for your area. When you launch your balloon you should be ready to give your launch location, launch time, time to 60k feet ascending, time of reaching 60k feet descending, expected landing location, and expected landing time. You need to make this call no earlier than 24 hours before the flight and no later than 6 hours before the flight. If you cancel or change the times you need to update the NOTAM immediately. You should also notify the NOTAM station when you actually reach 60k feet up and down, if you lose communication with your balloon, and when your payload has landed if possible. That's all the reporting you need to do.<br />
The 60k feet barrier is important because 99% of aircraft can't fly above that altitude. Unless you're hanging out in Korea or Russia there won't be too many U-2 spy planes cruising past your balloon and there's only one X-37 space plane in existence right now. So, once you're above 60k feet you can breath a little bit easier knowing that you won't be ingested by a jet engine. One note about launch site selection is that you need to make sure you are more than 5 miles away from any airport. It's also a good idea to plan your flight path so that it doesn't cross over any airports. This is in the Part 101 regulations, but it's easy to miss. My launch is still on for 3 JULY 2010 at 1 PM from the Billings, MT area (actual location to be selected about 4 days ahead of launch for weather reasons).Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-82235497907962031312010-05-26T21:37:00.000-04:002010-05-26T21:37:25.381-04:00VectorNav SensorI soldered on the VN-100 AHRS (Acceleration Heading Rotation Sensor) from VectorNav. I've setup the sensor to output the yaw, pitch, and roll since I need that information to steer the payload module during its descent. You can see that the yaw, pitch, and roll are output in a NMEA formatted sentence in the picture below. The sensor has 3-axis accelerometer, magnetic sensors, and 3-axis gyro that it uses to create the yaw, pitch, and roll.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZDa9iS0rJzq6ONzq68a0NCBlgoCfhuJe4Vii319zKwYaDspmDdHQen-2e9vDFkNzCkrG6DbPmsBJ_Pu6xVnZIJuRh2ojEXGwIIH8dyHRfzj1p66aC21H2FcDxczhy8w1_solWbMT-LDbR/s1600/VN100_Test.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="412" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZDa9iS0rJzq6ONzq68a0NCBlgoCfhuJe4Vii319zKwYaDspmDdHQen-2e9vDFkNzCkrG6DbPmsBJ_Pu6xVnZIJuRh2ojEXGwIIH8dyHRfzj1p66aC21H2FcDxczhy8w1_solWbMT-LDbR/s640/VN100_Test.jpg" width="640" /></a></div><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmgHaLuyj_o4MAejDb_Pzwn-AAZN0SYU7oHVOZhaYWs-540uvnSUtovbfi42IGOCh0bQPcnYcDwuZHST3wwivxcEvSsK3Jc9fAIA-lR0fmwOF9Oc7b-WZdjFOiaUYIP4YxzzoDkt8Bl7P3/s1600/YPR_Output.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmgHaLuyj_o4MAejDb_Pzwn-AAZN0SYU7oHVOZhaYWs-540uvnSUtovbfi42IGOCh0bQPcnYcDwuZHST3wwivxcEvSsK3Jc9fAIA-lR0fmwOF9Oc7b-WZdjFOiaUYIP4YxzzoDkt8Bl7P3/s640/YPR_Output.jpg" width="640" /></a></div><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The Honeywell IPT sensor also arrived in the mail today. It's much smaller than I expected and the protective cover on the pressure sensing tube is...well...interestingly shaped... Hopefully over the weekend I'll be able to put all the functions together into a nice data logging package and get started on the servo controls.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisoXp5UdjtnqIHTvx4Ae1-4lhhgsTxEiT3kcy91u9wYQ5yLcjXETBjmAgG4NTvR2Qjs1Exnbt6tyF7_OLBpYl2qh5Ka5dBUOxpQWAe8hOA1ZaiicGvAsz-05bU3jmbNKGppUYdZ7HeH1qs/s1600/FILE0018.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="540" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisoXp5UdjtnqIHTvx4Ae1-4lhhgsTxEiT3kcy91u9wYQ5yLcjXETBjmAgG4NTvR2Qjs1Exnbt6tyF7_OLBpYl2qh5Ka5dBUOxpQWAe8hOA1ZaiicGvAsz-05bU3jmbNKGppUYdZ7HeH1qs/s640/FILE0018.JPG" width="640" /></a></div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-76276159418203460342010-05-23T14:09:00.012-04:002010-05-23T21:38:34.097-04:00RRRRRUUUUNNNN!!!!!!UThe trap was set. A man with an orange ribbon watched from across the street as four men with blue ribbons jogged past. He sprinted across the street splitting the group of blue, three ahead and one behind. With a skidding stop the one behind barely missed being tagged and bolts like a startled gazelle in the opposite direction, isolated from his friends. The chase ensued as his three friends looked on, cheering for escape. Down the busy D.C. street, across and up the other side at an all out sprint they went. At the top of the block fortune smiled on the blue runner as another slower blue ribbon came around the corner and the attention of the orange chaser was diverted. Escape! Back to his friends, exhausted, exhilarated, and ready to <a href="http://www.survivedc.com/">survive D.C.</a><br />
<a href="http://www.survivedc.com/"></a>This is my story from two weekends ago when I promised that I would have GPS tracking ready. Since I was frustrated with the uM-FPU issue I decided to enter the annual Survive D.C. challenge instead. It was a great time, and I have my strategy set to win next year. As for GPS tracking I just figured out (literally five minutes ago) that the chip selects for my uM-FPU code were setup improperly. Somehow I inadvertently changed the fpu_spi.S file and it screwed everything up for me. Many thanks to Cam at Micromega for his debugging help! Now that I have it working it should be a quick coding session away from KML track files stored on the SD card. Maybe you'll even get two posts in the same day out of me...<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfWZzL5xYS7Y4sHef9SNAxWKswHEuVWZKFg_31ECJqZ1Sbu1YvEcNDX3Hart5hHt12tLK5vYoeulb2trS6aBE-r4hMnscB_rkFKLjcoSz33Yu-JtLCyTZqi2YiWqED08qF33rfb0MONHf/s1600/GPS_Test.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfWZzL5xYS7Y4sHef9SNAxWKswHEuVWZKFg_31ECJqZ1Sbu1YvEcNDX3Hart5hHt12tLK5vYoeulb2trS6aBE-r4hMnscB_rkFKLjcoSz33Yu-JtLCyTZqi2YiWqED08qF33rfb0MONHf/s640/GPS_Test.jpg" width="640" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkfWZzL5xYS7Y4sHef9SNAxWKswHEuVWZKFg_31ECJqZ1Sbu1YvEcNDX3Hart5hHt12tLK5vYoeulb2trS6aBE-r4hMnscB_rkFKLjcoSz33Yu-JtLCyTZqi2YiWqED08qF33rfb0MONHf/s1600/GPS_Test.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a></div><div class="separator" style="clear: both; text-align: left;"><b>UPDATE!!!!</b></div><div class="separator" style="clear: both; text-align: left;">I decided to just update my post instead of making a new post. Below is a Google Earth view of a track I took. I actually walked around the parking lot in a loop, so the track isn't very accurate. The KML file created by the balloon hardware is below the Google Earth picture. The KML format is very easy and you can probably figure it out on your own. If you're struggling check out the <a href="http://code.google.com/apis/kml/documentation/kml_tut.html">KML Tutorial.</a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSgseUoOhog71U0Tqj82DoJlHqxJVHc5d4SvSYwWFcnKUxB9qGB8dj83qA0pDgsyH7aHeUVzpUwVkdh7TKg6tZZ5Nl6knyUF4RZkMU_BwXpNSaGJ0nYI4vJINixw0yU-cn1wOR5SBexjMv/s1600/gps_track.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSgseUoOhog71U0Tqj82DoJlHqxJVHc5d4SvSYwWFcnKUxB9qGB8dj83qA0pDgsyH7aHeUVzpUwVkdh7TKg6tZZ5Nl6knyUF4RZkMU_BwXpNSaGJ0nYI4vJINixw0yU-cn1wOR5SBexjMv/s640/gps_track.jpg" width="464" /></a></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"><?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2"> <Document> <name>Paths </name> <description> </description> <Style id="yellowLineGreenPoly"> <LineStyle> <color>7f00ffff </color> <width>4 </width> </LineStyle> <PolyStyle> <color>7f00ff00 </color> </PolyStyle> </Style> <Placemark> <name>Balloon Track </name> <description> </description> <styleUrl>#yellowLineGreenPoly </styleUrl> <LineString> <extrude>1 </extrude> <tessellate>1 </tessellate> <altitudeMode>clampToGround </altitudeMode> <coordinates></div><div class="separator" style="clear: both; text-align: left;">-77.257050,38.613289,9.081365</div><div class="separator" style="clear: both; text-align: left;">-77.257057,38.613308,2.353583</div><div class="separator" style="clear: both; text-align: left;">-77.257080,38.613327,2.509873</div><div class="separator" style="clear: both; text-align: left;">-77.257095,38.613342,3.073757</div><div class="separator" style="clear: both; text-align: left;">-77.257111,38.613358,3.027795</div><div class="separator" style="clear: both; text-align: left;">-77.257133,38.613377,2.419199</div><div class="separator" style="clear: both; text-align: left;">-77.257149,38.613392,3.866859</div><div class="separator" style="clear: both; text-align: left;">-77.257294,38.613525,0.235732</div><div class="separator" style="clear: both; text-align: left;">-77.257309,38.613548,0.831693</div><div class="separator" style="clear: both; text-align: left;">-77.257317,38.613567,2.116111</div><div class="separator" style="clear: both; text-align: left;">-77.257332,38.613594,0.741470</div><div class="separator" style="clear: both; text-align: left;">-77.257393,38.613712,0.035968</div><div class="separator" style="clear: both; text-align: left;">-77.257408,38.613747,3.533464</div><div class="separator" style="clear: both; text-align: left;">-77.257416,38.613762,2.116111</div><div class="separator" style="clear: both; text-align: left;">-77.257423,38.613297,3.149637</div><div class="separator" style="clear: both; text-align: left;">-77.257439,38.613323,8.648294</div><div class="separator" style="clear: both; text-align: left;">-77.257446,38.613346,10.772677</div><div class="separator" style="clear: both; text-align: left;">-77.257454,38.613373,13.453123</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.613396,15.093421</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613422,14.571769</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613453,8.369545</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613476,14.250367</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613495,11.215469</div><div class="separator" style="clear: both; text-align: left;">-77.257477,38.613518,9.271531</div><div class="separator" style="clear: both; text-align: left;">-77.257477,38.613541,8.516939</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613564,10.319799</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613583,12.511400</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.613605,11.633858</div><div class="separator" style="clear: both; text-align: left;">-77.257477,38.613628,12.813361</div><div class="separator" style="clear: both; text-align: left;">-77.257477,38.613647,3.715162</div><div class="separator" style="clear: both; text-align: left;">-77.257477,38.613667,3.324711</div><div class="separator" style="clear: both; text-align: left;">-77.257484,38.613693,8.213501</div><div class="separator" style="clear: both; text-align: left;">-77.257492,38.613720,8.390788</div><div class="separator" style="clear: both; text-align: left;">-77.257469,38.614410,3.092222</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614483,11.747047</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614559,38.845306</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614601,50.285427</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614582,38.765915</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614571,13.786172</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614578,10.733390</div><div class="separator" style="clear: both; text-align: left;">-77.257462,38.614586,8.428599</div><div class="separator" style="clear: both; text-align: left;">-77.257446,38.614590,9.388164</div><div class="separator" style="clear: both; text-align: left;">-77.257423,38.614586,0.905824</div><div class="separator" style="clear: both; text-align: left;">-77.257408,38.614601,2.939602</div><div class="separator" style="clear: both; text-align: left;">-77.257393,38.614620,2.275262</div><div class="separator" style="clear: both; text-align: left;">-77.257378,38.614632,3.469908</div><div class="separator" style="clear: both; text-align: left;">-77.257370,38.614655,2.148981</div><div class="separator" style="clear: both; text-align: left;">-77.257355,38.614677,3.093412</div><div class="separator" style="clear: both; text-align: left;">-77.257339,38.614700,2.980643</div><div class="separator" style="clear: both; text-align: left;">-77.257317,38.614719,2.573429</div><div class="separator" style="clear: both; text-align: left;">-77.257301,38.614742,2.985564</div><div class="separator" style="clear: both; text-align: left;">-77.257278,38.614277,0.159121</div><div class="separator" style="clear: both; text-align: left;">-77.257256,38.614288,0.157967</div><div class="separator" style="clear: both; text-align: left;">-77.257172,38.614346,2.926479</div><div class="separator" style="clear: both; text-align: left;">-77.257156,38.614361,3.323521</div><div class="separator" style="clear: both; text-align: left;">-77.257133,38.614376,2.401185</div><div class="separator" style="clear: both; text-align: left;">-77.257111,38.614391,3.074147</div><div class="separator" style="clear: both; text-align: left;">-77.257095,38.614403,3.051151</div><div class="separator" style="clear: both; text-align: left;">-77.257072,38.614418,0.912386</div><div class="separator" style="clear: both; text-align: left;">-77.257744,38.614407,2.063618</div><div class="separator" style="clear: both; text-align: left;">-77.257713,38.614368,0.603980</div><div class="separator" style="clear: both; text-align: left;">-77.257706,38.614349,0.920581</div><div class="separator" style="clear: both; text-align: left;">-77.257690,38.614330,2.564366</div><div class="separator" style="clear: both; text-align: left;">-77.257690,38.614326,3.520341</div><div class="separator" style="clear: both; text-align: left;">-77.257683,38.614304,3.454725</div><div class="separator" style="clear: both; text-align: left;">-77.257675,38.614296,10.204970</div><div class="separator" style="clear: both; text-align: left;">-77.257668,38.614277,10.006439</div><div class="separator" style="clear: both; text-align: left;">-77.257652,38.614731,2.918307</div><div class="separator" style="clear: both; text-align: left;">-77.257378,38.613541,2.427822</div><div class="separator" style="clear: both; text-align: left;">-77.257240,38.613312,3.723723</div><div class="separator" style="clear: both; text-align: left;">-77.257217,38.613300,3.293993</div><div class="separator" style="clear: both; text-align: left;">-77.257195,38.613289,8.024935</div><div class="separator" style="clear: both; text-align: left;">-77.257187,38.613281,2.655420</div><div class="separator" style="clear: both; text-align: left;">-77.257149,38.613739,3.595770</div><div class="separator" style="clear: both; text-align: left;">-77.257118,38.613708,2.689068</div><div class="separator" style="clear: both; text-align: left;">-77.257080,38.613674,3.831990</div><div class="separator" style="clear: both; text-align: left;">-77.257072,38.613678,12.383448</div><div class="separator" style="clear: both; text-align: left;">-77.257065,38.613647,9.143579</div><div class="separator" style="clear: both; text-align: left;">-77.257057,38.613590,2.204724</div><div class="separator" style="clear: both; text-align: left;">-77.256989,38.613518,8.838460</div><div class="separator" style="clear: both; text-align: left;">-77.256981,38.613510,3.180385</div><div class="separator" style="clear: both; text-align: left;">-77.256950,38.613464,0.999016</div><div class="separator" style="clear: both; text-align: left;">-77.255814,38.612747,0.925197</div><div class="separator" style="clear: both; text-align: left;">-77.255791,38.612736,2.014436</div><div class="separator" style="clear: both; text-align: left;">-77.255775,38.612717,2.316242</div><div class="separator" style="clear: both; text-align: left;">-77.255768,38.612709,3.418635</div><div class="separator" style="clear: both; text-align: left;">-77.255753,38.612698,10.382257</div><div class="separator" style="clear: both; text-align: left;">-77.255722,38.612690,9.806552</div><div class="separator" style="clear: both; text-align: left;">-77.255707,38.612667,10.249466</div><div class="separator" style="clear: both; text-align: left;">-77.255699,38.612648,33.782318</div><div class="separator" style="clear: both; text-align: left;">-77.255692,38.612610,14.921221</div><div class="separator" style="clear: both; text-align: left;">-77.255676,38.612564,10.246062</div><div class="separator" style="clear: both; text-align: left;">-77.255661,38.612518,10.145915</div><div class="separator" style="clear: both; text-align: left;">-77.255638,38.612476,10.592231</div><div class="separator" style="clear: both; text-align: left;">-77.255638,38.612438,11.517306</div><div class="separator" style="clear: both; text-align: left;">-77.255623,38.612423,9.165108</div><div class="separator" style="clear: both; text-align: left;">-77.255608,38.612400,2.404886</div><div class="separator" style="clear: both; text-align: left;">-77.255608,38.612328,2.322865</div><div class="separator" style="clear: both; text-align: left;">-77.255577,38.612331,3.499016</div><div class="separator" style="clear: both; text-align: left;">-77.255569,38.612328,8.767963</div><div class="separator" style="clear: both; text-align: left;">-77.255569,38.612328,0.055896</div><div class="separator" style="clear: both; text-align: left;">-77.255562,38.612316,3.419886</div><div class="separator" style="clear: both; text-align: left;">-77.255524,38.612320,3.431758</div><div class="separator" style="clear: both; text-align: left;">-77.255348,38.612591,2.858832</div><div class="separator" style="clear: both; text-align: left;">-77.255356,38.612579,12.516404</div><div class="separator" style="clear: both; text-align: left;">-77.255348,38.612556,15.675814</div><div class="separator" style="clear: both; text-align: left;">-77.255318,38.612530,52.365486</div><div class="separator" style="clear: both; text-align: left;"></coordinates></div><div class="separator" style="clear: both; text-align: left;"></LineString></div><div class="separator" style="clear: both; text-align: left;"></Placemark></div><div class="separator" style="clear: both; text-align: left;"></Document></div><div class="separator" style="clear: both; text-align: left;"></kml></div><br />
<div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-678534054791039592010-05-11T22:26:00.000-04:002010-05-11T22:26:28.720-04:00Where am I, literally?The uM-FPU's are up and running and so is my GPS receiver. I used the NMEA sentence application note on the <a href="http://micromegacorp.com/appnotes.html">micromega website</a> as the basis for a user defined function inside my uM-FPU. The function collects a PUBX, 00 NMEA sentance from the GPS receiver and breaks down it's fields to be stored into the registers of the uM-FPU. The code is working when I load a test sentence into the uM-FPU manually, but there is an unknown problem getting the actual data from the GPS receiver into the uM-FPU. It's getting a bit late, so I decided to find the problem tomorrow. Below are some pictures of the output with the test sentence and the output of my GPS receiver. I'm right on track for my XML output at the end of the week.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTLzWG9rEEwILCdznIQ-dmXw4g7fnU07aD2-uBcasGPcfioeZi7yCjs5seJI0aQTc9v7x88DtNsG38MruDTePFZByG0u-vmMahdxh6-sZNEBCcxMZqdVNfDgG712_PmMjyE5GF0dJ_jCb9/s1600/GPS_Test.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="536" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTLzWG9rEEwILCdznIQ-dmXw4g7fnU07aD2-uBcasGPcfioeZi7yCjs5seJI0aQTc9v7x88DtNsG38MruDTePFZByG0u-vmMahdxh6-sZNEBCcxMZqdVNfDgG712_PmMjyE5GF0dJ_jCb9/s640/GPS_Test.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_1LIhyphenhyphen-ZgMKavN1UKqIhJG4g1EI8UEwdPAG9jA7tFLkIAtjzxvb1zqUp07h8NEQXGmAQjJOpMbQ2PlPGHZkridVUufLS9HbCru4w9FJbjUXk-1p3BCwRPUMPDFTtVRaQsrSGG4i0saEYd/s1600/GPS_Output.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_1LIhyphenhyphen-ZgMKavN1UKqIhJG4g1EI8UEwdPAG9jA7tFLkIAtjzxvb1zqUp07h8NEQXGmAQjJOpMbQ2PlPGHZkridVUufLS9HbCru4w9FJbjUXk-1p3BCwRPUMPDFTtVRaQsrSGG4i0saEYd/s640/GPS_Output.jpg" width="640" /></a></div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-5980430957398895352010-05-09T23:16:00.000-04:002010-05-09T23:16:33.485-04:00Look Mom, no hands...because soldering irons are hot. Safety First!Well, after the last circuit boards and their soldering problems I decided to go back to the basics. You can see my classy soldering workspace/kitchen. I used lead free solder, don't worry.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTOZK2xL9iad317C6vjog_8eEsjN-ExjnhtA2QzOuZSmAFnHZbwFUDxKAB9IWYhwvWp9G6N7KHm6R5I8H8oGPmfeVW7Zjz1vxCuS9FLtnH02wC6FLRomyYqyOLYa2BvQChixJ7VzcvbI_Z/s1600/PICT0001.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTOZK2xL9iad317C6vjog_8eEsjN-ExjnhtA2QzOuZSmAFnHZbwFUDxKAB9IWYhwvWp9G6N7KHm6R5I8H8oGPmfeVW7Zjz1vxCuS9FLtnH02wC6FLRomyYqyOLYa2BvQChixJ7VzcvbI_Z/s640/PICT0001.JPG" width="640" /></a></div><br />
So, like I said...back to the basics. Instead of using a whole loaf of bread while soldering, this time I used bread flour! Let me tell you, it made all the difference. Choosing a 100% organic bread flour gave my soldering that earthy, healthy taste too. All kidding aside there were no problems getting this soldered together and my initial tests were great! I've managed to get both micros running with the desired settings, both SD card slots work as you can see in the picture below, and I'm working through the code for the uM-FPU floating point co-processors now. I should be logging GPS tracks to the SD cards in XML format by the end of the week.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg91d6m0aDpVdFc_56SqSKwBL5X-meJiLyYRD2w6EXvbrrhLxDe1z5y_n6-w_RJOJjeLUL0nS0wsxejQiVmxzbL-_vk3KhpJC-pj61-p903gzaS5yycM0r1nhQEfK0yrl4Ay6BPL-tUDteQ/s1600/Ahnung_SD_Test.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg91d6m0aDpVdFc_56SqSKwBL5X-meJiLyYRD2w6EXvbrrhLxDe1z5y_n6-w_RJOJjeLUL0nS0wsxejQiVmxzbL-_vk3KhpJC-pj61-p903gzaS5yycM0r1nhQEfK0yrl4Ay6BPL-tUDteQ/s640/Ahnung_SD_Test.jpg" width="600" /></a></div><br />
My co-pilot, Arhan, and I have both purchased our airplane tickets for Billings, MT. The flight will happen either on Saturday, July 3rd at 1PM or on Sunday, July 4th at 8am. The location will be one of the three previously discussed. It's really too early to know what the weather will be like. It would be great to have a ton of people show up and help, so if you're at all interested leave a comment and I'll keep you posted on the exact details. Happy Mother's Day Mom!Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-39091165545210665232010-05-06T23:24:00.000-04:002010-05-06T23:24:41.048-04:00PCB's Are In!The new PCB's are in and they are stylish! I chose to do a white solder mask and black silk screen. They look so good I'm going to make it my new signature colors. These boards were made by Colonial Circuits in Fredericksburg, VA. I highly recommend them for your circuit board needs. I'm always ordering small quantities and their prices are great for the complex boards. They also ship out the yield from the whole panel even if you only asked for one. If you're looking to have a new board made send your gerber files to Beth at sales2@colonialcircuits.com. I should have these babies soldered up and working by the end of the weekend, so I'll leave it here for now. Enjoy the pics and try not to be too jealous!<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtxhQvKdC78xWuBvTvNJG7TexLdlrKNzBryPTKyaUZZ_qsul8Pbr8bB9KPP2JGpdCVsQsYGP42syGvpug96H_OORBqff_VkYZhLHJgNOOo3V5YPXrqaqgtmPkPr9g5v_ogz6EF7BRDXhdX/s1600/FILE0015.JPG" imageanchor="1" style="float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtxhQvKdC78xWuBvTvNJG7TexLdlrKNzBryPTKyaUZZ_qsul8Pbr8bB9KPP2JGpdCVsQsYGP42syGvpug96H_OORBqff_VkYZhLHJgNOOo3V5YPXrqaqgtmPkPr9g5v_ogz6EF7BRDXhdX/s320/FILE0015.JPG" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgoOqobJiRGuNLEog4zikgrMmHjvlowfkPT8uM07rUKhDt-wGAJq0yiOR4qmSEkLNYmiA6_ZKlAngIVJyUhz_CVSf54vA7i-0rj9R7nRRq34BMUyl0CVHZsuX3Q0WMv3lOt_7RiDOYnItx/s1600/FILE0017.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgoOqobJiRGuNLEog4zikgrMmHjvlowfkPT8uM07rUKhDt-wGAJq0yiOR4qmSEkLNYmiA6_ZKlAngIVJyUhz_CVSf54vA7i-0rj9R7nRRq34BMUyl0CVHZsuX3Q0WMv3lOt_7RiDOYnItx/s320/FILE0017.JPG" /></a></div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-24869872776806391232010-05-03T11:43:00.000-04:002010-05-03T11:43:05.470-04:00One Bad Apple is All it TakesIt's always been a dream of mine to own a company. There's the trill of being in control, fighting to keep everyone paid, and of course my company would be technology centric so I could be on the cutting edge. I realized today that one bad employee, at any level in the company, could ruin the whole thing. Part of this realization came from my new set of bicycle rims being stolen and the other part came from some record breaking NASA news.<br />
The bicycle rims were a birthday present from my parents. They were being FedExed to my apartment and I've never had any issues with deliveries there. Now, bicycle rims aren't small, the box measured 3 feet tall and wide. When I saw the tracking information claiming the package was delivered I expected to find the rims at the front office of the apartment complex. For some reason the FedEx driver left a small package at the front office and decided to leave my giant package at the front door of my apartment. Of course the package was stolen, because one bad apple didn't care enough to think it's foolish to leave packages out in an apartment complex. I don't have a signed agreement with FedEx allowing them to leave packages, so this has reflected very poorly on the company in my mind.<br />
The NASA news is that the Spirit rover on Mars is about to become the longest running program on Mars. Both Spirit and Opportunity were designed to be 90-day missions, and they have both survived more than 6 years! The engineers and crew for these two missions have done a fantastic job! The bad apple side of this story is in the way NASA has taken engineers and mission crew like this and ground them into the pavement with terrible management practices. Granted this problem involves several bad managers, but it had to start with one bad policy decision.<br />
The second revision of circuit boards for the balloon are due in this week, so look for a good status update next week or this weekend. I am tentatively planning to launch on the 3rd of July from a location close to Billings, MT. I will post the exact launch date and time as soon as I get all of my crew to buy their plane tickets. Anyone who wants to help of observe is welcome to show up. Science is always more fun with a group of spectators to see your fantastic failures! Check out the latest NASA balloon project in Australia for a worst case scenario of what you might see at my balloon launch.Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-45575067340624728722010-04-12T14:44:00.000-04:002010-04-12T14:44:45.993-04:00Slow Progress is Still Progress I've been dragging my feet a little bit on this project lately. It's mostly due to two reasons. First the weather has been great and I am spending my weekends outside instead of writing code. Second I ended up paying $2500 in taxes this year...that coupled with the adjustment I made to my tax withholding has left my bank account somewhat empty lately. I still need to purchase cameras, servos, the temperature/pressure sensor, balloon, some sort of cable to connect the GPS to the circuit board (probably has to be a flex circuit...expensive), and miscellaneous mechanical stuff.<br />
The connector on the GPS unit is a very small surface mount connector that is impossible to work with. I've attempted to solder 30 gauge wires to the leads, but even with a good microscope it isn't really working. My first idea was that I could create a flex circuit with the mating connector and a standard 100 mil header on the other end. It would be fairly costly to make the flex circuit, but the GPS unit is quite nice and I'm sure to use it again for other projects. Looking at the actual cost of the flex circuit ($550) I've changed my mind. My new plan is to redesign the main PCB to stand upright in the capsule and have a small tab with the GPS connector where the GPS unit will mount to and stick out of the top of the capsule. The GPS unit needs to at least have the antenna protruding out of the top of the capsule to ensure good signal reception. Redesigning the main board will also give me a chance to fix the programming issues with the mega128.<br />
Now, as promised there is some code attached. This code has preliminary functions to test all aspects of the micro that is attached to the GPS and cellular modules. The other micro will be attached to the temperature, pressure, and innertial sensors. I haven't written any code for it, but it will look mostly the same. I'm not going to take a lot of time explaining the code. I could easily fill up a year's worth of blog pages with that. There are fairly good comments in the code, so have at it. More coming soon, supposed to be thunderstorms this Friday hahaha.<br />
<br />
<br />
////////////////////////////////////////////////////////////////<br />
// Project Name: Ahnung<br />
// File Name: ahnung.c<br />
// Description: This is the firmware for MCU1 on the Ahnung<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>near space balloon. This firmware handles<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>GPS tracking, cellular comms, and parachute deployment.<br />
// Micro: ATMega128<br />
// Date: 22 JAN 2010<br />
// Author: Luke Wardensky<br />
////////////////////////////////////////////////////////////////<br />
#define F_CPU <span class="Apple-tab-span" style="white-space: pre;"> </span>8000000UL<br />
#define F_PWM<span class="Apple-tab-span" style="white-space: pre;"> </span>60<br />
#define MY_PWM_FREQ<span class="Apple-tab-span" style="white-space: pre;"> </span>((F_CPU/8)/F_PWM)-1<br />
#define BAUD <span class="Apple-tab-span" style="white-space: pre;"> </span>9600<br />
#define LATITUDE <span class="Apple-tab-span" style="white-space: pre;"> </span>4<br />
#define LONGITUDE <span class="Apple-tab-span" style="white-space: pre;"> </span>5<br />
#define ALTITUDE<span class="Apple-tab-span" style="white-space: pre;"> </span>6<br />
#define<span class="Apple-tab-span" style="white-space: pre;"> </span>HOURS<span class="Apple-tab-span" style="white-space: pre;"> </span>7<br />
#define<span class="Apple-tab-span" style="white-space: pre;"> </span>MINUTES<span class="Apple-tab-span" style="white-space: pre;"> </span>8<br />
#define<span class="Apple-tab-span" style="white-space: pre;"> </span>SECONDS<span class="Apple-tab-span" style="white-space: pre;"> </span>9<br />
#define GROUND_SPEED<span class="Apple-tab-span" style="white-space: pre;"> </span>10<br />
#define VERT_VELOCITY<span class="Apple-tab-span" style="white-space: pre;"> </span>11<br />
#define COURSE<span class="Apple-tab-span" style="white-space: pre;"> </span>12<br />
#define<span class="Apple-tab-span" style="white-space: pre;"> </span>HORZ_ACCURACY<span class="Apple-tab-span" style="white-space: pre;"> </span>13<br />
#define VERT_ACCURACY<span class="Apple-tab-span" style="white-space: pre;"> </span>14<br />
#define<span class="Apple-tab-span" style="white-space: pre;"> </span>STATUS<span class="Apple-tab-span" style="white-space: pre;"> </span>15<br />
#define GET_LAT<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
#define GET_LONG<span class="Apple-tab-span" style="white-space: pre;"> </span>1<br />
#define<span class="Apple-tab-span" style="white-space: pre;"> </span>GET_ALT<span class="Apple-tab-span" style="white-space: pre;"> </span>2<br />
#define GET_UTC<span class="Apple-tab-span" style="white-space: pre;"> </span>3<br />
#define GET_GND_SPEED<span class="Apple-tab-span" style="white-space: pre;"> </span>4<br />
#define GET_VERT_VEL<span class="Apple-tab-span" style="white-space: pre;"> </span>5<br />
#define GET_COURSE<span class="Apple-tab-span" style="white-space: pre;"> </span>6<br />
#define GET_HORZ_ACC<span class="Apple-tab-span" style="white-space: pre;"> </span>7<br />
#define GET_VERT_ACC<span class="Apple-tab-span" style="white-space: pre;"> </span>8<br />
#define GET_STATUS<span class="Apple-tab-span" style="white-space: pre;"> </span>9<br />
#define GPS_NO_FIX<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
#define GPS_DEAD_RECKONING<span class="Apple-tab-span" style="white-space: pre;"> </span>1<br />
#define GPS_READY<span class="Apple-tab-span" style="white-space: pre;"> </span>2<br />
#define GPS_TIME_ONLY<span class="Apple-tab-span" style="white-space: pre;"> </span>3<br />
#define NO_FUNCTION<span class="Apple-tab-span" style="white-space: pre;"> </span>-1<br />
<br />
#include <avr/io.h></avr/io.h><br />
#include <avr/pgmspace.h></avr/pgmspace.h><br />
#include <avr/interrupt.h></avr/interrupt.h><br />
#include <util/delay.h></util/delay.h><br />
#include <stdio.h></stdio.h><br />
#include <string.h></string.h><br />
#include <stdlib.h></stdlib.h><br />
#include <float.h></float.h><br />
#include <uart.h></uart.h><br />
#include <fpu.h></fpu.h><br />
#include "SPI_routines.h"<br />
#include "SD_routines.h"<br />
#include "FAT32.h"<br />
<br />
/////////////////////////////////////////<br />
// Global Variables<br />
/////////////////////////////////////////<br />
unsigned int PWM_FREQ = MY_PWM_FREQ;<br />
<br />
/////////////////////////////////////////<br />
// Function Definitions<br />
/////////////////////////////////////////<br />
void micro_init();<br />
int Cell_Init();<br />
void SMS_Test();<br />
char *GPS_Status();<br />
void Test_Chute_Servo();<br />
void Test_Cutdown_Servo();<br />
void Test_SD(char *str);<br />
void delay_seconds(unsigned int seconds);<br />
void uart_gets(char *temp_str, int max_str_size);<br />
int check_cell_response(const char *response);<br />
double read_gps_float(char function, char gps_register);<br />
long read_gps_long(char function, char gps_register);<br />
void delay_seconds(unsigned int seconds);<br />
void uart_gets(char *temp_str, int max_str_size);<br />
int check_cell_response(const char *response);<br />
<br />
int main()<br />
{<br />
/////////////////////////////////////////<br />
// Main Variables<br />
/////////////////////////////////////////<br />
unsigned int command=UART_NO_DATA;<br />
char status=0, gps_string[512];<br />
double last_lat=0, last_lng=0, last_altitude=0, lat=0, lng=0, altitude=0, gnd_speed=0, vert_vel=0, horz_acc=0, vert_acc=0, course=0;<br />
unsigned int hours=0, minutes=0, seconds=0;<br />
<br />
/////////////////////////////////////////<br />
// Setup the microcontroller ports and<br />
// perripherals<br />
/////////////////////////////////////////<br />
micro_init();<br />
<br />
/////////////////////////////////////////<br />
// Configuration & Test Menu<br />
/////////////////////////////////////////<br />
while(command != '7')<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>command = UART_NO_DATA;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n**************************************************\r\n MCU1 Configuration Menu\r\n**************************************************\r\n\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("1. Turn on cellular module\r\n2. Send SMS test message\r\n3. Get GPS status\r\n4. Test parachute servo\r\n5. Test cutdown servo\r\n6. Test SD card\r\n7. Start data logging\r\n\r\n>>"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while(command == UART_NO_DATA)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>command = uart1_getc();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while((command < '1') || (command > '6'))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\nInvalid selection\r\n>>"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>do<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>command = uart1_getc();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}while(command == UART_NO_DATA);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(command == '1')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(Cell_Init())<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("failed!!!!!\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("Cellular module initialization complete.\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(command == '2')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SMS_Test();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(command == '3')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts(GPS_Status());<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(command == '4')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Test_Chute_Servo();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(command == '5')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Test_Cutdown_Servo();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(command == '6')<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Test_SD("This is a test of the Ahnung SD memory card.\r\n123456789\r\nabcdefghijklmnopqrstuvwxyz\r\nABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n!@#$%^&*()-+=?.,<>\r\n");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
<br />
while(1)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Have the uM-FPU get NMEA sentances from the GPS receiver<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(SERIN, 6);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_wait();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Disable the uM-FPU NMEA sentance mode to prevent buffer overflows<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(SERIN, 0);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the GPS receiver status<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>status = read_gps_long(GET_STATUS, STATUS);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(status == GPS_READY)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the timestamp<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>hours = read_gps_long(GET_UTC, HOURS);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>minutes = read_gps_long(NO_FUNCTION, MINUTES);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>seconds = read_gps_long(NO_FUNCTION, SECONDS);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the latitude<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>lat = read_gps_float(GET_LAT, LATITUDE);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the longitude<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>lng = read_gps_float(GET_LONG, LONGITUDE);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the altitude<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>altitude = read_gps_float(GET_ALT, ALTITUDE);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the speed over ground<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>gnd_speed = read_gps_float(GET_GND_SPEED, GROUND_SPEED);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the vertical velocity<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>vert_vel = read_gps_float(GET_VERT_VEL, VERT_VELOCITY);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the course heading<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>course = read_gps_float(GET_COURSE, COURSE);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the horizontal accuracy<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>horz_acc = read_gps_float(GET_HORZ_ACC, HORZ_ACCURACY);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the vertical accuracy<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>vert_acc = read_gps_float(GET_VERT_ACC, VERT_ACCURACY);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if((last_lat != lat) || (last_lng != lng) || (last_altitude != altitude))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>sprintf(gps_string, "<markers><marker alt="%f" course="%f" hacc="%f" hours="%i" lat="%f" lng="%f" minutes="%i" seconds="%i" speed="%f" vacc="%f" vvel="%f"></marker>", lat, lng, altitude, gnd_speed, vert_vel, course, horz_acc, vert_acc, hours, minutes, seconds);</markers><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>writeFile("GPS.XML", gps_string);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Format the SMS message string<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT+CMGS=500\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>_delay_ms(500);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Enter the string into the cell module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("lwardens@gonzaga.edu "));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts(gps_string);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Send the CTRL-Z character to send the SMS<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_putc(0x1A);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>last_lat = lat;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>last_lng = lng;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>last_altitude = altitude;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Re-enable the uM-FPU NMEA sentance mode<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(SERIN, 4);<br />
}<br />
<br />
return 0;<br />
}<br />
<br />
void micro_init()<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port A<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRA = 0xFF;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTA = 0x00;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port B<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRB = 0x37;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTB = 0xF8;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port C<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>O<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>N<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRC = 0x01;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTC = 0xFE;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port D<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRD = 0x08;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTD = 0xF7;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port E<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>I<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>P<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRE = 0x1A;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTE = 0xE5;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port F<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>O<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<span class="Apple-tab-span" style="white-space: pre;"> </span>N<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRF = 0x80;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTF = 0x78;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Port G<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Bit:<span class="Apple-tab-span" style="white-space: pre;"> </span>7<span class="Apple-tab-span" style="white-space: pre;"> </span>6<span class="Apple-tab-span" style="white-space: pre;"> </span>5<span class="Apple-tab-span" style="white-space: pre;"> </span>4<span class="Apple-tab-span" style="white-space: pre;"> </span>3<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Dir: <span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<span class="Apple-tab-span" style="white-space: pre;"> </span>I<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Pullup:<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<span class="Apple-tab-span" style="white-space: pre;"> </span>P<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DDRG = 0x00;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTG = 0x07;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup Timer 3 PWM<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// non-inverting fast PWM<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Fclk = F_CPU/8<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// frequency set by ICR3<span class="Apple-tab-span" style="white-space: pre;"> </span>Fpwm = Fclk/(1+ICR3);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TCCR3A = 0xA2;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TCCR3B = 0x1A;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ICR3 = PWM_FREQ;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>OCR3A = PWM_FREQ * (0.321/3.3);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>OCR3B = PWM_FREQ * (0.321/3.3);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup SPI bus<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>spi_init();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup SD card<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SD_init();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SPI_HIGH_SPEED;<span class="Apple-tab-span" style="white-space: pre;"> </span>//SCK - 4 MHz<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>_delay_ms(1); //some delay<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup FAT tables<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(getBootSectorData()) //read boot sector and keep necessary data in global variables<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts("FAT32 not found!");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Enable Interrupts<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>asm("SEI");<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup USART<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_init(UART_BAUD_SELECT(BAUD, F_CPU));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_init(UART_BAUD_SELECT(BAUD, F_CPU));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Setup the uM-FPU<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Serial Port: 9600 8/N/1 NMEA parsing<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/////////////////////////////////////////<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_reset();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write3(SEROUT, 0, 6);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(SERIN, 4);<br />
}<br />
<br />
/////////////////////////////////////////<br />
// Cell_Init function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function initializes the cell<br />
// module: 9600 baud, no command echos, auto band select,<br />
// text mode SMS, no call or SMS notifications,<br />
// and use SIM card memory<br />
/////////////////////////////////////////<br />
int Cell_Init()<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts("\r\n********************************************************************************\r\n CELLULAR MODULE INITIALIZATION\r\n********************************************************************************\r\n");<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char cell_response[UART_RX_BUFFER_SIZE] = {'\0'};<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Check if the cell module is already powered on<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("checking if cell module is powered on..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Power on the cell module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTA = 0x80;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(2);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTA = 0x00;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(5);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Set the cell module baud to 9600<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts(PSTR("setting baud to 9600..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts(PSTR("AT+IPR=9600\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Disable character echos from the cell module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("disabling command echo..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("ATE0\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("failed\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Enable auto band selection<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("setting auto band selection..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT#AUTOBND=2\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("failed\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Use text mode for SMS editing<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("setting SMS text mode..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(5);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT+CMGF=1\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("failed\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Disable all incoming and outgoing alerts<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("disabling alerts..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(5);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT+CNMI=0,0,0,0,0\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("failed\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Use SIM card storage for text messages<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("setting SMS memory to SIM card..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(5);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT+CPMS=SM\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(check_cell_response("OK"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("failed\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("waiting for network registration..."));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Wait for the cell module to register with a network<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while(strstr(cell_response, "+CREG: 0,1") == NULL)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT+CREG?\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_gets(cell_response, UART_RX_BUFFER_SIZE);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(5);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 0;<br />
}<br />
<br />
/////////////////////////////////////////<br />
// SMS_Test function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function sends a SMS message<br />
// including a test string to the hardwired<br />
// email or phone number.<br />
/////////////////////////////////////////<br />
void SMS_Test()<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char cell_response[UART_RX_BUFFER_SIZE] = {'\0'};<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n################################################################################\r\n SEND SMS TEST MESSAGE\r\n################################################################################\r\n"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("sending SMS message..."));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// If there is an error sending the message keep trying<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while(strstr(cell_response, "OK") == NULL)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Format the SMS message string<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("AT+CMGS=500\r"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Enter the string into the cell module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_puts_p(PSTR("lwardens@gonzaga.edu This is a test of the Ahnung SMS message system.\r\nabcdefghijklmnopqrstuvwxyz\r\nABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n1234567890~!@#$%^&*()_+<>"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Send the CTRL-Z character to send the SMS<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_putc(0x1A);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Check the response from the cell module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_gets(cell_response, UART_RX_BUFFER_SIZE);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(5);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("ok\r\n"));<br />
}<br />
<br />
/////////////////////////////////////////<br />
// GPS_Status function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function sets the uM-FPU to<br />
// receive NMEA sentances and reads the<br />
// GPS status register<br />
/////////////////////////////////////////<br />
char *GPS_Status()<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char tmp_status;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n GPS STATUS\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Have the uM-FPU get a NMEA sentance from the GPS receiver<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(SERIN, 6);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_wait();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Get the GPS receiver status<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>tmp_status = read_gps_long(GET_STATUS, STATUS);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(tmp_status == GPS_READY)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return "3D GPS Fix Ready\r\n";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(tmp_status == GPS_DEAD_RECKONING)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return "GPS Dead Reckoning Fix Only\r\n";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if(tmp_status == GPS_TIME_ONLY)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return "GPS Time Only Fix\r\n";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return "GPS Searching For Singal\r\n";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Disable the uM-FPU serial port to avoid buffer overflows<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(SERIN, 0);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_wait();<br />
}<br />
<br />
/////////////////////////////////////////<br />
// Test_Chute_Servo function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function reads an angle entered<br />
// by the user and converts it to PWM to<br />
// be output on the OCR3B pin<br />
/////////////////////////////////////////<br />
void Test_Chute_Servo()<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>unsigned int servo_cmd=UART_NO_DATA, count=0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char angle[5];<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n================================================================================\r\n PARACHUTE SERVO TEST\r\n================================================================================\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while(1)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>servo_cmd = UART_NO_DATA;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("Enter an angle from 0 to 110 degrees or 'E' to exit.\r\n>>"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while((servo_cmd != '\r') || (count == 0))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>do<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>servo_cmd = uart1_getc();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}while(servo_cmd == UART_NO_DATA);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if((servo_cmd >= '0') && (servo_cmd <= '9') && (count < 3))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_putc(servo_cmd);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>angle[count] = servo_cmd;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>count++;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>angle[count] = '\0';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if((servo_cmd == 'E') || (servo_cmd == 'e'))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Convert the angle to a PWM pulse width<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>OCR3B = PWM_FREQ * (0.227 + (atoi(angle) * 0.0022))/3.3;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>count = 0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
<br />
/////////////////////////////////////////<br />
// Test_Cutdown_Servo function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function reads an angle entered<br />
// by the user and converts it to PWM to<br />
// be output on the OCR3A pin<br />
/////////////////////////////////////////<br />
void Test_Cutdown_Servo()<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>unsigned int servo_cmd=UART_NO_DATA, count=0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char angle[5];<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n CUTDOWN SERVO TEST\r\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while(1)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>servo_cmd = UART_NO_DATA;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("Enter an angle from 0 to 110 degrees or 'E' to exit.\r\n>>"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while((servo_cmd != '\r') || (count == 0))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>do<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>servo_cmd = uart1_getc();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}while(servo_cmd == UART_NO_DATA);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if((servo_cmd >= '0') && (servo_cmd <= '9') && (count < 3))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_putc(servo_cmd);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>angle[count] = servo_cmd;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>count++;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>angle[count] = '\0';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if((servo_cmd == 'E') || (servo_cmd == 'e'))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Convert the angle to a PWM pulse width<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>OCR3A = PWM_FREQ * (0.227 + (atoi(angle) * 0.0022))/3.3;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>count = 0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
<br />
/////////////////////////////////////////<br />
// Test_SD function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function writes the str string<br />
// to the test.dat file on the SD card,<br />
// waits for the user to modify the file on a PC,<br />
// and reads out the modified file<br />
/////////////////////////////////////////<br />
void Test_SD(char *str)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>unsigned int SD_cmd = UART_NO_DATA;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\r\n SD CARD TEST\r\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("Writing string to SD card test.dat file...\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts(str);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>writeFile("test.dat", str);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\nPlease remove the SD card, read the test.dat file on your PC, modify the file, re-insert the card in the balloon, and press 'G'\r\n>>"));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Wait for the user to re-insert the SD card and press the G key<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while((SD_cmd != 'G') && (SD_cmd != 'g'))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SD_cmd = uart1_getc();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Re-initialize the SD card<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SPI_SD;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SD_init();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SPI_HIGH_SPEED;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart1_puts_p(PSTR("\r\nReading SD card test.dat file...\r\n"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>_delay_ms(1);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>readFile(READ, "test.dat");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>deleteFile("test.dat");<br />
}<br />
<br />
/////////////////////////////////////////<br />
// delay_seconds function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function uses the _delay_ms()<br />
// function to create a seconds long delay<br />
/////////////////////////////////////////<br />
void delay_seconds(unsigned int seconds)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>int i = 0;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while(seconds > 0)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>for(i=0; i<1000; i++)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>_delay_ms(1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>seconds--;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
<br />
/////////////////////////////////////////<br />
// uart_gets function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function uses the uart_getc()<br />
// function to read all valid characters in<br />
// the uart buffer<br />
/////////////////////////////////////////<br />
void uart_gets(char *temp_str, int max_str_size)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>int index=0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>unsigned long int timeout=0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char temp;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Keep getting characters until the buffer is full or the timeout is reached<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while((index < max_str_size) && (timeout < 2000000))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>temp = (char)uart_getc();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(temp != 0)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>temp_str[index] = temp;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>index++;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>timeout++;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>temp_str[index] = '\0';<br />
}<br />
<br />
/////////////////////////////////////////<br />
// check_cell_response function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>This function checks the cellular module's<br />
// response string for 'response'. If 'response'<br />
// is not found the module is powered off and 1 is<br />
// returned, otherwise 0 is returned.<br />
/////////////////////////////////////////<br />
int check_cell_response(const char *response)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>char temp_response[UART_RX_BUFFER_SIZE] = {'\0'};<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>uart_gets(temp_response, UART_RX_BUFFER_SIZE - 1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(strstr(temp_response, response) == NULL)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Power off the cell module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTA = 0xFF;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(2);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PORTA = 0x7F;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>delay_seconds(10);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return 0;<br />
}<br />
<br />
/////////////////////////////////////////<br />
// read_gps_float function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>Get one float from the specified<br />
// uM-FPU register<br />
/////////////////////////////////////////<br />
double read_gps_float(char function, char gps_register)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(function >= 0)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(FCALL, function);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_wait();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(FREAD, gps_register);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return fpu_readFloat();<br />
}<br />
<br />
/////////////////////////////////////////<br />
// read_gps_float function<br />
//<span class="Apple-tab-span" style="white-space: pre;"> </span>Get one long from the specified<br />
// uM-FPU register<br />
/////////////////////////////////////////<br />
long read_gps_long(char function, char gps_register)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(function >= 0)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(FCALL, function);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_wait();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>fpu_write2(LREAD, gps_register);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return fpu_readLong();<br />
}Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-52692341558296020092010-03-15T21:50:00.000-04:002010-03-15T21:50:45.464-04:00What's This PBS? I've been making slow and steady progress on the balloon's firmware. Since the microcontrollers on my PCB are throwing a tantrum and not letting me program them in-system I've been using an STK600 and an ATMega64 to do my development. The real balloon will be using an ATMega128, so the Mega64 I'm using for development should keep me well under the memory size for the real balloon. I currently have the diagnostic and startup functions coded. When the balloon starts up both microcontrollers will boot to a configuration menu. The menu will allow the operator to use a laptop and a terminal program to exercise each of the balloon's functions. There's an option in the menu to start the flight program and data logging functions for the real flight. All that's left is to write the data logging, flight routines (things like cutting off the balloon after it bursts and deploying the parachute at the right altitude), and assembling the hardware components together.<br />
To keep me inspired I've been watching some scientific and creative TV shows from Netflix. I've just found a fantastic show that aired on PBS in 2002. The show is called Rough Science. It's a mix of Mythbuster's type challenges and MacGuyver type science. It has really inspired me and shown how fun science can be. The first season the team used basic chemistry, botany, physics, and very simple tools to collect gold and smelt it into jewelry! The second season, which I'm currently watching, is all about space as simulated in Death Valley. If you want to recapture the excitement of high school science experiments without all the work and weird teacher guys, you need to watch this show!<br />
Hopefully next time I'll post up some code...that is if I have more to show you than some terminal output. See you next time space cowboys! *cue banjo music and gun shots*Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-84219502581196108152010-03-02T23:18:00.000-05:002010-03-02T23:18:43.231-05:00Launch and Landing While I've been working on the hardware and firmware for the balloon I've also been thinking about where to launch from and where it might land. I've been using the <a href="http://nearspaceventures.com/w3Baltrak/readyget.pl">Near Space Flight Tracking Utility</a> from Near Space Ventures, Inc. While the Google map plotting doesn't seem to work, the XML file is well formatted with altitudes and lat/long. I've entered in data assuming a 3 pound capsule, a kaymont 1500 gram cold weather balloon, and the secret design item I've been alluding to... When the balloon reaches burst altitude I've added in the hardware capability to separate the balloon scraps from the capsule. I've also added in hardware to release a parachute at a specified altitude. Finally, Arhan will be programming two servos that control steering fins on the end of the capsule, which will be rocket shaped. All of this added together amounts to something close to a GPS guided bomb, without the explosives of course. The capsule will separate from the balloon after burst, attempt to steer itself back to its launch location, and at a safe altitude it will deploy the parachute. All of that should reduce the effects of wind drift during landing.<br />
I'm living in the D.C. area now, and everywhere I look is city or dense trees. I haven't been in the area all that long either and I'm not certain about good launch sites, so I decided to go with what I know. I've picked a few launch sites near Billings, MT where I know there are few people, few trees, and predictable weather patterns. The maps below show the predictions from Near Space Ventures that I've taken over the past couple months. You can see that I have several options depending on which way the wind decides to blow on launch day. Along with the launch I plan on taking my summer vacation in Yellowstone National Park this year! If everything goes well with the hardware and firmware I'm planning on an early July launch.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_uoAWWtbVXnyVk3DiCXd0Cuh5bgAdZNNJBwiX22s-6WFC-TvOf9F7Ebp-O7mtuYyzN0HuWUguRrchCGKGGh9akFGOWzP8EP9ZdxXT7x5nBEYkIa1ogFSjfnnku6r_U9_533me9sU0ah4K/s1600-h/big_timber_launch.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_uoAWWtbVXnyVk3DiCXd0Cuh5bgAdZNNJBwiX22s-6WFC-TvOf9F7Ebp-O7mtuYyzN0HuWUguRrchCGKGGh9akFGOWzP8EP9ZdxXT7x5nBEYkIa1ogFSjfnnku6r_U9_533me9sU0ah4K/s320/big_timber_launch.jpg" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikqaM735Xrm5sOIzVTX_l2f0cOm_rlJjYpKOJ2VeFyAVTdode9DKmA5snYLkR5KHOyKd7RzvAi_CwreeBPzC1RIPBJMVFY4GqnP2Eai-94uxJ6lDyHvmifSIcoC6-didyXkLMMc04RF4Jf/s1600-h/buffalo_trail_launch.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikqaM735Xrm5sOIzVTX_l2f0cOm_rlJjYpKOJ2VeFyAVTdode9DKmA5snYLkR5KHOyKd7RzvAi_CwreeBPzC1RIPBJMVFY4GqnP2Eai-94uxJ6lDyHvmifSIcoC6-didyXkLMMc04RF4Jf/s320/buffalo_trail_launch.jpg" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibesRg0AsdLZ5cvTkmYObnyFcBAHt-4_KL8n5HbWZeU5eQiBa2I4s12o_1XO45iycG3FewlW3RHkwzDjzoeMM2delSM6ZqPbFBJfa8UMMpvaitbhdjZZya6-VIUXbmzNh0VP9kDeUVYChk/s1600-h/comanche_launch.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibesRg0AsdLZ5cvTkmYObnyFcBAHt-4_KL8n5HbWZeU5eQiBa2I4s12o_1XO45iycG3FewlW3RHkwzDjzoeMM2delSM6ZqPbFBJfa8UMMpvaitbhdjZZya6-VIUXbmzNh0VP9kDeUVYChk/s320/comanche_launch.jpg" /></a></div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-32080444202589434652010-02-19T12:48:00.006-05:002010-02-24T16:11:41.921-05:00Work and FIRST Robotics Not much new has happened since my last post. I've been very busy at work and I've been volunteering for the FIRST robotics competition. My team, Rolling Thunder Robotics, is almost finished assembling our robot. We have one last night of building before the scrimmage Saturday morning. Being a FIRST mentor has been great and I encourage anyone who is interested to join in. You don't need to know anything about robots to help, but most of the work is about designing and building a robot...mechanical things seem to be the stumbling point for most teams. <a href="http://www.usfirst.org/">www.usfirst.org</a><br />
With my excuses and public service announcements out of the way it's on to some firmware! As I've mentioned before I decided to use Atmel's ATmega128 microcontroller for this project. There are actually two of them (one for the GPS and cellular module and one for the temp, pressure, acceleration, and rotation sensors). I could have gotten away with just one, but they're cheap and I have room to expand this way. Each micro will have an SD card with a FAT32 file system for data logging. It's somewhat scary using file systems for the first time, but you'll find it can be very easy! I've found a pre-made FAT32 library for AVR's from Dharmanitech (<a href="http://www.dharmanitech.com/2009/01/sd-card-interfacing-with-atmega8-fat32.html">www.dharmanitech.com/2009/01/sd-card-interfacing-with-atmega8-fat32.html</a>). It is written with the ATmega32 in mind, but it's easy enough to change the UART and SPI definitions for use with any AVR. I highly recommend running the example project before trying to modify it. Since the code is a little bit hard to follow it will give you a much better idea of how it works. Below are some pointers on how to get your custom version up and running.<br />
<br />
<b>SD FAT32 Initialization:</b><br />
You must run the following functions to setup communications and the FAT32 tables:<br />
<ul><li>spi_init()</li>
<li>SD_init()</li>
<li>getBootSectorData()</li>
</ul><b>SD FAT32 File Operations:</b> <br />
Reading, writing, and deleting files is as easy as calling a function...<br />
<ul><li>readFile(READ, fileName)<br />
</li>
<ul><li> fileName is a null terminated string containing the name of the file and the extension</li>
<li>the output is sent to whatever UART port is defined in the UART_routines.h file</li>
</ul></ul><ul><li>writeFile(fileName, dataString)</li>
<ul><li>fileName is a null terminated string containing the name of the file and the extension</li>
<li> dataString is the text to write to the file terminated by the '~' character</li>
<li>this function will append dataString to a file if it already exists or create the file if it doesn't</li>
</ul></ul><ul><li>deleteFile(fileName)</li>
<ul><li>fileName is a null terminated string containing the name of the file and the extension</li>
</ul></ul><b><span style="color: red;">!!!!BUG REPORT!!!!</span></b><br />
I found a bug in the SD FAT32 library that really made me scratch my head for a while. The problem happens when you use the readFile, writeFile, or deleteFile functions with the file name entered directly.<br />
<br />
e.g. writeFile(<span style="color: red;">"Test.txt"</span>, data);<br />
<br />
Inside these functions the file name gets expanded to a format that is expected by the FAT32 file system. This format is 13 bytes long. If your file name is shorter than 12 characters you will overwrite whatever data is in memory behind the fileName variable used by these functions... The fix is pretty easy and hopefully it will be integrated into the library for the next update. Follow the steps below and you're all set until then!<br />
<br />
In FAT32.c:<br />
1. Place this code at the top of convertFileName:<br />
int j=0, k;<br />
<br />
// Copy the file name to a large buffer so memory isn't corrupted by the convertFileName function<br />
while((fileName[j] != 0) && (j<16))<br />
{<br />
FName[j] = fileName[j];<br />
j++;<br />
}<br />
FName[j] = 0;<br />
j=0;<br />
<br />
2. In the writeFile function change "dir->name[j] = fileName[j];" to "dir->name[j] = FName[j];"<br />
<br />
3. In the readFile function change "dir = findFiles(GET_FILE, fileName); //get the file location" to dir = findFiles(GET_FILE, FName); //get the file location"<br />
<br />
4. In the deleteFile function change "findFiles(DELETE, fileName);" to "findFiles(DELETE, FName);"<br />
<br />
In FAT32.h:<br />
1. Place this variable declaration with the other global variables:<br />
volatile char FName[16];Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-88246368822203823632010-02-12T13:20:00.001-05:002010-02-12T13:20:45.536-05:00D.C. Blizzard of 2010 I'm finally back to work after 4 days of online training from home. I don't particularly enjoy giving up my time to work for someone else, but today I'm actually happy to get away from my apartment and do something other than stare at a computer screen. The blizzard of 2010 was very unspectacular to me, but there were 40 MPH winds and about 1.5 feet of snow. The biggest problem I see is that the roads and parking lots here weren't designed with snow in mind. For that matter they weren't even really designed with cars in mind...they are really meant for horses... Since the snowplows have nowhere to push the snow to most people just have to wait for it to melt before they can drive anywhere.<br />
Now on to the important stuff! I did not make any progress with being able to program the microcontrollers on my board. I actually have no idea what the problem is. I checked proper voltages, the programming connections, clock sources, part numbers, and my sanity several times. Nothing seems to work, but there is another way. The plan is to work with my STK600 to develop the code as best I can and use it to program the chips through a ZIF socket. Then I can solder the programmed chips onto the board and see if the program runs as expected. I was smart enough to bring UART connections to some headers for debugging purposes so it will be easy to verify that my programs and circuits work. This is definitely not an ideal situation, but it will save me from spending more money on redesigning the balloon board.<br />
I have also enlisted the help of my friend Arhan to create a tracking application for the balloon's flight. The idea so far is to send periodic SMS messages from the balloon to a second cellular module connected to a laptop. The laptop will take in the SMS messages over USB and plot GPS coordinates, altitude, speed, etc. I have not tested any of my antenna ideas yet, so I don't know if we will achieve constant communication, but any time the balloon is below 30,000 feet we will be able to track it. I'm really only concerned about knowing where it lands. All the data collected during the flight will be stored on SD cards on the payload so we can always reconstruct the flight if we can recover the payload. See you next time space cowboys!Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-25360297213914017872010-02-05T17:46:00.001-05:002010-02-05T17:56:19.568-05:00PCB's are in!!! The circuit boards are in and I've partially assembled them. The weather forecast is predicting a top 10 worst snow storm for the D.C. area. I was sent home early from work because of the paranoia. Having grown up in Montana I'm not scared by any amount of snow. Let's see how the weather was when I started the assembly...<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd39qGzce7YpmvSAWPF3lpxyK028lXwTMUiQNENp4Sted1lEyseiPforM2HtLaSKg6-opWtdoD481F2azFQnq5Up7gUaDMSGcMpbvvuuHNTpexhDUVNMCi7pkOOFmAzZGrQMvyuZvPR6zo/s1600-h/FILE0007.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd39qGzce7YpmvSAWPF3lpxyK028lXwTMUiQNENp4Sted1lEyseiPforM2HtLaSKg6-opWtdoD481F2azFQnq5Up7gUaDMSGcMpbvvuuHNTpexhDUVNMCi7pkOOFmAzZGrQMvyuZvPR6zo/s320/FILE0007.JPG" /></a> </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"> Below you can see the circuit board, my soldering iron, and some bread. Bread...never solder without it! Seeing as my kitchen counter tops are the only solder resistant surfaces in the apartment that's where I decided to work. I've decided to put on the two ATmega128 micros, their crystals, and the programming headers. With those components on the board I should be able to load a program into the micros and set the fuses to use the external crystals.</div><div class="separator" style="clear: both; text-align: left;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2HriC57Ortqq9Nu6Br7xbITuBuwchIQsE8DKtGHIhxO9N9_fhzurnS7gMXvJLiyJoi5bXZJLfNd-QEvThC5QLlxR7ahXEHjZKouGtwlXuHIOX1EyJvD_p2HaSdtsmMrLvjemp4M_N6-tt/s1600-h/FILE0003.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2HriC57Ortqq9Nu6Br7xbITuBuwchIQsE8DKtGHIhxO9N9_fhzurnS7gMXvJLiyJoi5bXZJLfNd-QEvThC5QLlxR7ahXEHjZKouGtwlXuHIOX1EyJvD_p2HaSdtsmMrLvjemp4M_N6-tt/s320/FILE0003.JPG" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm5dDihAd9t9s839t15rdAH-5bopkmw_SMNJl0Kq5zeRqAINKgHigM9_SoVOQNXREuhjVOskAKtUGzVPxVYXiqHMbsyfvUe4MPWJVt9qrPsYruof7xGSc0A2ca90Xv9WSmVLDUlSydvEl5/s1600-h/FILE0001.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm5dDihAd9t9s839t15rdAH-5bopkmw_SMNJl0Kq5zeRqAINKgHigM9_SoVOQNXREuhjVOskAKtUGzVPxVYXiqHMbsyfvUe4MPWJVt9qrPsYruof7xGSc0A2ca90Xv9WSmVLDUlSydvEl5/s320/FILE0001.JPG" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"> When I hooked the board up to my STK600 for programming I couldn't get a connection. I checked through the schematics, took some measurements with my multimeter, and retried several times. Since I had no luck there I decided the STK600 may not be providing enough power through the ISP cable so I soldered on the regulators and battery connector. I connected the battery and measured all the voltage rails. Everything looked good, so I tried the programming again... Still no luck. My thoughts now are that the micros have not been completely soldered to the board. Since they are the QFN style package with a very tiny bit of pin showing it is extremely hard to solder properly. Seeing as I don't have a microscope it's even harder. I may wait until Monday and use the hot air rework station at work...after hours of course.</div><div class="separator" style="clear: both; text-align: left;"> Now, about four hours after I started assembling and pretty close to when my work day should have ended...</div><div class="separator" style="clear: both; text-align: left;"> </div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbpTADKyrN_J-mTec6DuDe8Z9_zUd28tYZclvjrn4AkvB6kthKxaYbOb6Yp6yydvbwTh1YHJunvvCL6XwEzshs7-L0jo9WueuAqEaPSbKWCUim9SGqSAPl6Dr707ibKBiNG3S9FnbvoGjY/s1600-h/FILE0008.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbpTADKyrN_J-mTec6DuDe8Z9_zUd28tYZclvjrn4AkvB6kthKxaYbOb6Yp6yydvbwTh1YHJunvvCL6XwEzshs7-L0jo9WueuAqEaPSbKWCUim9SGqSAPl6Dr707ibKBiNG3S9FnbvoGjY/s320/FILE0008.JPG" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"> This tiny amount of snow wouldn't have stopped even the most timid of D.C. drivers, but I'm happy to have an early Friday off so I could work on the balloon computer and share the progress with you. Maybe tomorrow will include a revelation on my microcontroller programming problems.</div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-63553921140961828042010-02-02T16:29:00.001-05:002010-02-02T16:34:14.054-05:00The VectorNav VN-100 VectorNav is currently a one product company. That is music to my ears when it comes to electronics. It means I will most likely get fantastic support and a great quality product from a small company that will treat me like royalty. I haven't actually had to ask for help on this module yet, so I couldn't say for sure on the support. The module is a great piece of design and functionality though. In the space of a large postage stamp (it even has the castellations like a stamp would have) VectorNav has managed to cram in three axis of accelerometer, three axis of gyro, and three axis of magnetometer. The best part is that the on-board processing power takes care of all the analog, fills up some well defined registers, and lets you choose between reading the registers manually or getting NMEA formatted sentences automatically.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzkyvvAvIpRmwKyHOYXME1_4Bqq298Zsb1UAPhTjWnAAgSzKxcLywcvUqCdLySuTRIMbEdM2lw-HfyPFkcJBv3kWoOcx7DgeFnl0yBo2x6pyHLbDDwIJD5WULGVy60YWGfU-JjU8GXCfF3/s1600-h/vn-100.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzkyvvAvIpRmwKyHOYXME1_4Bqq298Zsb1UAPhTjWnAAgSzKxcLywcvUqCdLySuTRIMbEdM2lw-HfyPFkcJBv3kWoOcx7DgeFnl0yBo2x6pyHLbDDwIJD5WULGVy60YWGfU-JjU8GXCfF3/s320/vn-100.bmp" /></a></div><br />
Probably the most useful part of this module is the ability to get an accurate yaw/pitch/roll in degrees with zero work. The module reads its sensors and computes the angles for you. There is also the ability to upload the current magnetic map of your area, just in case the government finally created that machine that stops the Earth's core from spinning. The Russians are also trying to steal the magnetic north pole by quietly moving it towards themselves about 40 miles per year*. There is a fantastic development kit that allows RS-232, USB, or your own hand soldered connections to the module. The software that comes with it will give you all the sensor data and display real-time 3D rotating version of the board.<br />
I plan on using this sensor to measure my heading and also test the effectiveness of a small gyro placed inside the capsule to keep it from spinning like so many other balloon projects have. It's not very fun to look at blurred pictures of the landscape whizzing past because your capsule won't stay still. The other key component of this will be a rotatable clip to attach the balloon to the capsule. Something like those plastic key chains with the stretchy coiled cord should work. Now, why do I really need to know my heading....something to do with the circular shaped PCB no doubt.<br />
<br />
<br />
* The Russians are not actually attempting to steal the magnetic north pole. It is a natural phenomenon that has been observed to happen in geologic studies several times over Earth's history. In fact many believe that the magnetic poles will flip sometime in the near future based on those geologic records.Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-86733005496285650202010-02-01T13:09:00.000-05:002010-02-01T13:09:31.166-05:00The Printed Circuit Board (PCB)I finished the schematic capture and PCB layout about a week ago and finally my PCB is being manufactured! I did the design using Altium Designer. It's an easy to use tool that is almost as powerful as the industry leader, Cadence. It also costs much much less than Cadence. The quote for my PCB came in at $650 for two boards on a 10 day build schedule. The component cost came in at about $200, but I am reusing some parts from previous projects like the GM862 and some SD memory cards. You can enjoy some PCB pron below and I'll be sure to take pictures during the assembly of the real board when it comes in. Does this circular shape allude to some devious plan that I have for my payload capsule?<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUIWjoM1xdLjW1EvNsLXFpMnzduf9J1J8dOzY2LnTsGrCxLUkLavHNE6Rbru2ZvZy0SN3tnYMhMp7sMa5ZJ56ScuMgDyAAN4STrkRof9muKk7b0kDoINZceeGzwcbboFJ686hDxIq1A4vb/s1600-h/ahnung.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUIWjoM1xdLjW1EvNsLXFpMnzduf9J1J8dOzY2LnTsGrCxLUkLavHNE6Rbru2ZvZy0SN3tnYMhMp7sMa5ZJ56ScuMgDyAAN4STrkRof9muKk7b0kDoINZceeGzwcbboFJ686hDxIq1A4vb/s320/ahnung.bmp" width="318" /></a></div>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-810339320442189452010-01-30T18:11:00.002-05:002010-01-31T15:59:31.459-05:00What happened NASA All through my childhood I was fascinated by the moon landing, the space shuttle, and all the things NASA engineers were able to do. Last night I got curious about how my near space balloon computer would stack up against the Apollo 11 computer. Apollo 11 was the first manned moon landing for those of you who aren't up on space history. Seeing as my iPhone has roughly 10 times more of everything than my first PC, I figure my balloon computer should come pretty close to what Apollo 11 had. The specs for both are below.<br />
<br />
<b>Luke's Near Space Balloon Computer:</b><br />
<ul><li>2 ATMega128 microcontrollers</li>
<ul><li>8 MHz clock </li>
<li>128k flash memory</li>
<li>4k SRAM memory</li>
</ul>
<li>2 uM-FPU co-processors</li>
<ul><li>29 MHz clock</li>
<li>~2k flash memory</li>
</ul>
<li>Telit GM862 Cellular Module</li>
<ul><li>Python script interpreter</li>
<li>2MB flash memory</li>
<li>1.2MB RAM</li>
</ul></ul><b>Apollo 11 Command Module Computer:</b> <br />
<ul><li>Custom Made Integrated Circuits</li>
<ul><li>1 MHz clock</li>
<li>72k ROM </li>
<li>4K RAM</li>
</ul></ul> To be fair the Apollo command module also had the worlds best computer built-in...the human brain. My balloon will be unmanned so it must handle all the problems itself. It's still incredible that NASA was able to keep track of so many sensors and control systems with the equivalent of a $1 microcontroller in today's world. Be careful if you're thinking NASA's budget is way overinflated, though. The sensors, actuators, testing, and development are where the expensive stuff is. Take for example my balloon. The microcontrollers cost me about $15 each, but the IPT temperature/pressure sensor will cost $500. My components aren't rated to handle the large amounts of radiation that circle just outside our atmosphere either. Ionizing radiation will erase the contents of flash memory and that's where the computer's programming is stored!Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0tag:blogger.com,1999:blog-6397808038975944969.post-67501236793298932862010-01-29T13:32:00.002-05:002010-01-29T13:34:19.659-05:00The Tellit GM862 Cellular Module There are many challenges in the communications design for a high altitude balloon. With small standard antennas cellular service stops working anywhere between 20k - 40k feet. There are several arguments as to why, but the most accepted reason is that at altitude multiple cell towers begin to receive the cellular signal and the network becomes confused. Many balloon designs avoid the cellular problem by using amateur radio devices or HAM radio. There is certainly no problem receiving a HAM signal from high altitudes, but as the balloon descends to the ground the line-of-sight becomes obstructed and the communications link can be lost. In my opinion it is better to know where the balloon lands than to keep constant communication with it in the air. Of course both HAM and cellular could be used on the same balloon, but weight is also an issue. With all that in mind I decided to go with a cellular only solution and conduct some experiments with cantennas and waveguide antennas to combat the multi-tower problem.<br />
I chose to use the GM862 cellular module from Tellit because they are readily available, they include the SIM card connector on-module, and they use a built-in antenna connector. It's quite difficult to do impedance matching on a PCB when you don't have all of the professional tools for layout. The module can be bought with built-in GPS, but the SiRF III chipset is limited to operation below 60k feet. Since I'm heading to almost twice that altitude I won't be able to use that chipset. The cellular part of the module connects to a "data terminal" through a TTL level serial connection. That makes it very easy to experiment with the module using a computer and a TTL to RS-232 level sifter. The commands are in the standard Hayes AT modem commands with a few specialty ones. All of this is well documented in the Software User's Guide and the AT Reference Guide.<br />
When using the GM862 with a microcontroller things can get a bit tricky. A micro doesn't have a built-in serial buffer like a data terminal has, so there is lots of overhead in the code to capture all the data coming from the GM862 and deal with the data terminal style formatting. It can be a pain to parse the buffer for a status and I usually end up counting the number of characters I expect the module to return for a particular command. If I don't see the status I expected I dig deeper into error cases. It helps a lot if you turn off the GM862's echo feature. That way the commands you send aren't echoed back to you as you send them and there are less characters to confuse the returned data. The echo is enabled by default and can be turned off by sending the ATE0 command. Echo can be re-enabled by sending ATE1. Below is a list of commands you need to get a cellular call and SMS message going, quick and dirty!<br />
<br />
<b>Quick Start Cellular Call:</b><br />
<ul><li>AT#AUTOBND=2 <span style="color: orange;">Sets the module to automatically scan all 4 cellular bands for a network</span></li>
<li>AT+CREG? <span style="color: orange;">Checks if the module is registered on a network. You'll get "AT+CREG 1,0\r\nOK\r\n" if it's registered</span></li>
<li>AT+FCLASS=8 <span style="color: orange;">Tells the module that you are only making phone calls, if you don't use this you have to place a semicolon after your phone call command. <span style="color: red;">Don't use this command if you are going to send SMS messages also.</span></span></li>
<li>AT#CAP=2 <span style="color: orange;">Tells the module to use the MT microphone input as the source audio</span></li>
<li>ATD {phone number}<phone number=""><phone number=""> [; if you didn't use AT+FCLASS=8] <span style="color: orange;">This starts the phone call. <span style="color: red;">Sometimes the network requires the full 10 digit phone number with area code, so it's best to just put it all in there.</span></span></phone></phone></li>
<li>ATH <span style="color: orange;">This will end the voice call.</span></li>
</ul><b>Quick Start SMS:</b> <br />
<ul><li><span style="color: white;">AT+CMGF=1</span> <span style="color: orange;">This command sets the SMS editing mode to TEXT mode. If you understand PDU mode you can use that also, but I prefer to read and write in english.</span></li>
<li><span style="color: black;"><span style="color: white;">AT+CPMS="SM"</span> <span style="color: orange;">This sets the module to store SMS messages on the SIM card</span></span></li>
<li><span style="color: black;"><span style="color: orange;"><span style="color: black;"><span style="color: white;">AT+CNMI=0,0,0,0,0 </span> <span style="color: orange;">This command sets the notifications that the module sends out about SMS messages. The first zero disables notifications about incoming messages. The second zero disables notifications about messages being sent. The last three zeros deal with low-level network stuff and will probably always be zero for your project.</span></span></span></span></li>
<li><span style="color: black;"><span style="color: orange;"><span style="color: black;"><span style="color: orange;"><span style="color: black;"><span style="color: white;">AT+CMGS="{phone number}</span><phone number=""><phone number=""><span style="color: white;">" </span> <span style="color: orange;">This command tells the module to start a new SMS message. After the command is sent the module will return a command prompt (>) and then you enter the text you want to send. <span style="color: red;">To actually send the message you must send CTRL-Z (0x1A in hex) to the module.</span></span></phone></phone></span> </span></span> </span></span></li>
</ul>Lukehttp://www.blogger.com/profile/03215680246499501352noreply@blogger.com0