Quantcast
Channel: T-MinusArduino
Viewing all 32 articles
Browse latest View live

Hackaday DC event recap

$
0
0
Giving a talk to the packed room
As some of you might have seen, I recently attended the Hackaday DC event and gave a talk on the rocket stabilization system while there in addition to explanations and demonstrations to quite a few people that came by my table. Surprisingly, the Amazon AWS crew that was there took quite an interest in my project and gave advice on code upgrades for the stabilization system, namely dynamic control movement ranges dependent on velocity.
Not only did I get to meet the Hackaday crew of Mike, Brian and Sophi but also one of my all time favorite hackers Charles Lohr (CnLohr) who thought it would be awesome to solder his colorchord to my neopixel hat (spoiler; It was!). I'd like to say a big thank you to Hackaday for throwing this awesome party, hope to see you all in the area again soon, and NovaLabs for the awesome space that it was held in. I will be looking into usages of the new ARM dev kit from the freebies, so expect posts on that. Along with the other planned actions, I will call up the local airport(s) to inquire about runway usage for kinetic testing of the system in addition to inquiring about the University Of Maryland wind tunnel as one attendee pointed out as a viable option by playing the student research project card. Apologies for the lack of posts lately, I recently started college and have been kept quite busy juggling schoolwork and personal projects  on top of my freelance contract engineering  that I do on the side. The talk recording is at the bottom of the post, sorry about talking a mile a minute, bad habit of mine, enjoy!

NovaLabs is quite a nice place
CnLohr's ColorChord attached to my hat
One heck of a crowd
Ready to give my talk

Hackaday swag table

Just a small bit of the pizza that was available

Swag from the party, Omnibus is signed by the Hackaday staff





Rocket stabilization system debugging update

$
0
0

Debugging the system on a cheap logic analyzer clone (review coming up soon)
        Ever since I implemented the new control code this system has been plagued with a pair of bugs that frustrated me to no end which I have dubbed "Harlem Shake" and "Mr Freeze." The "Harlem Shake" bug occurs when the IMU outputs seemingly random YPR values suggesting that it is tumbling even when the sensor is kept perfectly still. "Mr Freeze" as the name suggests, is when the system locks up out of nowhere and refuses to respond unless reset which does not prevent the glitch manifesting. After mucking around with the code and a string of long nights with quite a bit of coffee trying to figure out what the heck was wrong with the system, I finally fixed the problem. The following is just inferences based on my limited knowledge at the moment, if anyone has a better theory I'd be glad to hear it. Reading the serial logs led me to believe that the freezing glitch was caused by a FIFO (First In First Out) overflow due to the appearance of that message in the terminal just before the system locked up. Initially, I had messed with the FIFO data speed configuration from 200Khz to 400Khz to no avail before inferring that the data was coming in at a much higher rate than it was being output, being a problem in library implementation. Using a logic analyzer had not showed anything anomalous in the I2C data bus which would have signaled a problem with either the wiring or packet structure. My assumption is that the transcoding of the data  internally was taking up too much processor power or was out of sync causing it to glitch thus causing the system to grind to a halt. This is a library-level issue that I'll be investigating and attempting to fix. Googling around proved library wonkiness to be the case and the fix was to increase the baudrate to the maximum of 115200. After applying this single line fix, the system ran for 10 hours straight without any bugs or freezing at all. I have no clue as to what causes the "Harlem Shake" glitch but it has not appeared since the freezing fix was applied so I'm not going to complain, though it has me curious as to what the core of the problem is.



System debugging setup

Harlem shake glitch: Exhibit A


Harlem Shake glitch: Exhibit B

Nominal terminal output

     A few months ago I wrote a request on the open member board at TechShop DC asking if anyone had ideas on how to get permission to use a runway for kinetic testing of a system, much to my surprise I got a response. None other than the owner of the Washington Executive Airport offered to let me use his 3000 foot runway and taxiways for system testing. I am more than likely heading up there sometime in late November to check out the airport and start doing test operation planning and figuring out where to put cameras for video capture. The current plan is to build a cage that holds the rocket test article, balanced from the COG while still retaining freedom of movement to verify control authority in a testing environment. The cage would be mounted to either the middle doors of the test vehicle (a suburban) or the roof racks with the middle seats being used as a command and data gathering center. Someone else would be driving the car down the runway while I sit in the command center gathering data and monitoring the test. Data would be extracted via either a serial cable or a wireless link that connects to computers in the command center in addition to multiple cameras recording the fin and complete system movements. Post-testing the RPY and fin angle values would be sent to a 3D model showing the movement of the test article for editing into video. This also is going to be time for the test rig to be built and I'll be needing to start fuselage integration sometime in the next few months as a completed test article is needed.

     Again, I apologize for the lack of updates as school is a much higher priority than my projects. The addition of being a temporary contracted engineer to a friend's company developing a secret project is only making my overall stress levels go crazy. Updates will be coming along from time to time until the semester ends on Dec 18, at which point they might pick up. 

Holiday update and gift exchange postmortem

$
0
0
Happy Hackerdays readers! Since the last update it's been busy with the first semester of school finishing up, finals and the holiday season quickly approaching. In that time I've made a better HackerTree, run a beta test of the Maker gift exchange, made the major purchase of an oscilloscope,  and received a box of goodies from Texas Instruments. First semester was a mess and I made a lot of mistakes along the way that will be a lot of work to get my grades up out of over the rest of my time at school. I've reactivated my TechShop membership and will be up there doing a lot of work until January 17th when it expires again. Full details on the updates and a little teaser of the stabilization system progress after the break.
Wishng you all a maker Christmas and a hacker new year!



As some of my returning readers might remember, last year I decorated a small christmas tree with unpopulated PCBs and protoboards which I then called the hackertree. This year I felt like I had to do it again but this time much better. This year's has a multitude of powered dev boards from the ubiquitous Arduino to the MSP432 all running the blink sketches on the tree which is cleverly routed with USB power cables to provide 5V to all the boards. Also on the tree is everything from radar modules to UART adapters dangling from paperclip hooks on the branches. To really make this year's tree special I had planned to have an ESP8266 running the Neopixel strand with full mobile device control, unfortunately my level shifters were omnidirectional not the advertised bidirectional so it broke the chip, leaving me to just hook it up to one of the Unos on the tree already. Under the tree are the gifts including but not limited to; Rigol 1054z oscilloscope, SpaceX Eutelsat mission patch, 2AH NIMH batteries, Hackaday 2014 omnibus, SamD20 dev boards, to the Launchpad educational boosterpack. I'd like to get the HackerTree to become a sort of tradition among the maker community, will likely be holding a contest next year to generate the initial interest and hopefully get it off to a strong start.
2014 HackerTree
2015 Hackertree
I've had the idea of a maker-themed gift exchange in my mind since last Christmas but have been unsure about the planning and execution of said exchange. In total this year there were 6 participants, myself included, since so few participated I'll be considering this the trial run. My decision to add monetary tiers caused a lot of problems due to mismatches, however the country playing a part in the matching of gifters to giftees was helpful since international shipping can be expensive. In the end, we had a successful matching and gifts are in the post to the giftees. Running this small gift exchange has given me a newfound respect for the Reddit secret santa crew, with their thousands of entries. 



I finally made the first major purchase for this hobby; a shiny new Rigol 1054Z oscilloscope. After having several instances when an oscilloscope would have saved me a TON of trouble and frustration, it was high time that I went and got one. After many late nights of research, shopping around and reading reviews, my final choice was obviously the highly recommended and well-known 1054z. Lauded by none other than Dave Jones of the EEVBlog as THE beginner scope it is also hackgradeable from a 50mhz to a 100mhz scope through an easy and well-documented method. Coming in at $400, this surpasses the $95 I spent on the Hakko FX888D soldering iron which has quickly become one of my best and most used purchases and I hope this 'scope will be of massive use too over these next few years.
The first major purchase I've made in this hobby
It's a beautiful piece of equipment 
A few weeks before Christmas the TI Launchpad crew sent me a tweet asking if I wanted some "stocking stuffers", I naturally agreed and 2 days later it showed up on my doorstep. This was no small box either and would not fit in my stocking at all... Upon opening it I was greeted with static dissipative bubble wrap and below that a backpack and a part sorter. Unzipping the backpack revealed a veritable plethora of goodies that were packed in. Straightaway the boosterpack caught my eye, as it would pair perfectly with the MSP432 board that had come in during November. Alongside the boosterpack was a USB hub, post its, a mug, wireless keyboard and finally T-shirts! A good chunk of my wardrobe is hardware manufacturer shirts that I've picked up over the years though most are black, the red of the TI shirts is a welcome change. Thank you to Blake and the rest of the TI Launchpad crew for this awesome gift box, it will be getting a lot of use this year!
Texas instruments sent a box of gifts! 
A sorter and an oddly heavy backpack...
There's a lot of stuff in the bag!
Mug, keyboard, post it notes, USB hub and a boosterpack
Boosterpack detail
T shirts!
Post it note cube
The full TI haul
Cookies from Bay Area Circuits
A little teaser for the rocket stabilization project system progress

Q1 2016 Rocket stabilization system update, now with fins, nose cone and a mockup

$
0
0
With 2016 well underway it's time for the first update on the state of the stabilization system!
First off, apologies for the massive delays this post has had, was originally slated for mid-Jan launch but between job hunting and other stuff I've been hitting delays and trouble at every turn. Since last semester ended on Dec 18th, I'd been going to TechShop pretty much every day until Jan 18th making massive leaps and bounds of progress along the way. The most obvious of progress is the completion of the demonstration mockup airframe which will be gone into more in-depth after the break. 
The system's current state on the demonstration mockup

The demonstration mockup was constructed to not only have a physical representation of the final assembly but also to familiarize myself with layout and wiring inside a confined space which is new territory to me. It is constructed out of 3 inch ID cardboard mailing tubes and has fins cut from standard cardboard bolted on, nothing special or lightweight due to this not being the final flight model. The overall mass of this version is 1.48Kg of which 452g is the stabilization system module. Testing and flight versions will be constructed out of "Blue tube" for it's superior durability and lighter weight though at much higher cost ($30/4 feet, whereas the tubes I'm using I salvaged from the scrap pile for free) 
The latest revison of the stabilization moduel
On the assembled stabilization module, the most notable additions are the printed fins and nose cone, both of which went through a few revisions during the month. Print issues with bed adhesion and extruder jams were the bane of my existence during the 3 hour prints of the nose cone sections for a total of 4 failures.
The new fin
Fin attachment detail
Some of my longer term readers may remember how much difficulty I was having with figuring out a method for attaching a fin to the servo spline, trying everything from printing a horn to trying integration of a round arm to no avail. In the end, I decided to stop trying to reinvent the wheel and rework an older design to bolt onto a premade servo horn. These are designed in standard diamond hypersonic form with the axis point 3/4 up the mean aerodynamic chord. Due to the mounting method of fins bolting directly onto the horn, installing these after the servos are in the body tube is impossible, forcing me to have a slot-in module that is held in place with bolts. The slots perform an additional function of being mechanical endstops for the fins to prevent an overcontrol instance(in theory). Sadly, two of the scavenged servos finally kicked the bucket and a full new set is going to cost me $72 ($18/HS82MG) which is FAR out of my frayed kitestring budget which has dwindled to nearly zero as of late. If any of my readers know how to get in contact with Hitec for a sponsorship or how to get parts donated to a student project it would be greatly appreciated if you would drop me a line. 
Servo retention plate installed
The integration can for my system needed to be reworked due to being a bit too small to fit in the 3 inch inner diameter body tube. I retained the previous method of servo containment and mounting, just upscaled a bit and added bolt holes for attaching to the airframe, in addition to adding a forward riser to hold the control board in place and provide a nose cone mounting flange. Making sure this has a slightly snug fit is key, as internal movement can instigate a self-amplifying and destructive resonant wobble. 
Board retaining slots on the system upper
Control boards V1 and V2
V1 and V2 wiring comparison
Sensor offset on current layout
The breadboard and connection board of the previous version were not only too hard to set up quickly but also very fragile and annoying to work with. I'd had enough so finally I went and built a nice shield that integrates almost everything while still keeping the Arduino removable so it can be used in other projects. V1 was a first attempt, all wires were red (bad idea) and shoddily laid out which caused a lot of headaches when it simply failed to work when powered up. Debugging when powered up showed the 5V rail hanging around 1.2V and not budging at all even when everything was disconnected. After a few hours of frustration my father walked by and offhandedly remarked to check the ground, much to my chagrin I found that I'd forgotten to connect the ground net to the ground rail which promptly fixed the problems (check for floating grounds). On the second revision the power and ground wires were in standard red and black while signals are in white (I ran out of wire colors okay?) in addition to being MUCH cleaner and better laid out. On the final revison, the IMU will be flipped around 180 degrees since this mount has it offset from the centerline by about 1/4in which may cause control reference issues resulting in the loss of launch vehicle.
APC220 Telemetry "backpack" next to cardboard prototype
Cardboard is top-notch free prototyping material, does the trick to get the basics blocked out quickly
Since I will be monitoring this launch from the ground during ascent I needed to get a telemetry solution figured out. Since I had a pair of APC220 wireless UART transceivers laying around after I was gifted them the year prior I decided to use those since they were not only on hand but had good nominal range (2Km LOS). After an initial prototype of a backpack in cardboard and hot glue, I designed and printed a proper backpack that has Velcro to hold down the module and a captive adapter for power and data lines. This assembly bolts onto the back of the control board with two diagonally placed holes as all 4 would interfere with my...not so great point to point soldering. 

Powered up 90% assembled system (top ring was removed in recent versions)
Trisegment nose cone attached to the system module
The nose cone was quite the interesting design challenge, the total height was 15 inches which surpassed the 6.1 inch maximum vertical print volume of the Makerbot Replicator 2s at TechShop. I decided to print the nose cone in 3 parts that bolted together for modularity and ease of printing. One of the biggest challenges in this was figuring out how to get the bolt interfaces designed on the curved surfaces of the nose cone interior while still being printable without support structure. In the end I opted for simple curved leadup flush connection plates which worked phenomenally with the minimal droop of Hatchbox filament (not sponsored, just freaking love that filament). 
Lower bolt interface detail
Internal detail of assembled nose cone
Lastly, an update that cannot be shown due to those ITAR restrictons; code revisions! I've started a ground up rewrite of the code, this time with full Kalman filtration of the sensor values and PID to finally ditch the modified example code with shoddy division operators and no tuning ability. So far it's been a challenge as I am unsure as to whether the Kalman should go in front of or after the PID control, has stumped me since the rewrite was on the books. In addition to the code upgrade, I've been considering upgrading to a more powerful Arduino or just going ARM, maybe even use the MSP432 that TI sent over for the additional horsepower that will be needed to crunch all the numbers involved in the new code.
On a funny note, the last day I was at TechShop for this month block, had packed everything up and found that the rocket was going to be too hard to carry around in parts. I left it assembled, slung it over my shoulder and walked out the door. Now you'd probably expect raised eyebrows considering it was in a government town but that is not the case on this particular day. It just so happened to coincide with a munitions expo, so while heading out I passed a crew wheeling out a SM3 missile mockup. 
Latest version's cable managed leads laid out on the workbench 
Sleek lines of the business end of a rocket
3AM Rocket surgery on an intermediary version
Intermediary version was pretty crappily built
Gotta love rocket surgery
Rocket standing next to 5'8" me, turns out it's about half the size of an AIM-9 Sidewinder
Failures in the background of the recently slotted body tube
Sneak peek into my workflow and hand drawn references for CAD
Three years between V0.1 and the latest, all self taught skills
Crystal city at 2AM around the holidays after a 20 hour marathon day of work at TechShop

How to theme and change the font of the Arduino IDE (Tutorial)

$
0
0
You've probably had this problem before; Writing code late at night trying to get new features to work but the bright white of the default IDE is burning your eyes and giving you a headache even with F.Lux installed, and/or you've mistaken a "l" for a "1". Well, there are solutions to those problems, but not the other well known problems (autocomplete, not enough debugging features, etc etc) after the break.
Original on left, rethemed and refonted on right

Orange font is Windows specific, Yellow is OSX
First thing you'll need to do is close the IDE then download the Dark Theme by Jeff Thompson from GitHub, navigate to the folder in C:\Program Files (x86)\Arduino\lib ~/Applications/Arduino.app/Contents/Java/librename the existing theme folder to "Theme_orig" then paste in the new theme from the Git zip file.

Modified folder with Themes

After that, pick out a new font! I'm using the basic version of Input which is a coding-designed font in my IDE. Once you've got the TTF files, place them down alongside the existing fonts in the folder C:\Program Files (x86)\Arduino\java\lib\fonts ~/Applications/Arduino.app/Contents/Java/lib/fontsOnce that is done, change the preferences file to match the new font which is found at C:\Users\youruser\AppData\Local\Arduino15  User/Library/Arduino,  specifically the "editor.font" line, to which you change the default Monospaced to whatever your font is (CASE SENSITIVE). Finally save the modification, start your IDE and enjoy the new feel! 
Font files
Line to edit
Example of Input font in use (Looks way better than Monospaced)

Side projects update: Optical/radio telescopes, CAD, new rigs and custom sensor breakouts

$
0
0
Apologies for the radio silence on this blog, work has been continually crazy and some projects have been sidelined for temporary holds due to funding reallocation, however the backlog of completed short term projects has been full for a while and I thought I'd get some posted to tide you over until the next flagship update (Coming soon! Major redesign underway). Details on projects after the break, with a teaser for the flagship redesign at the end. 
8 inch Dobsonian telescope with craptastic eyepiece
First up is the camera eyepiece for my Dobsonian telescope which was born when I needed a way to show multiple friends the views but their glasses made looking into the eyepiece a difficult affair that had problems with getting the optics to be perfectly aligned and seeing smears of light. As I had a cheap security camera on hand for a different project, adding a C mount to telescope bore adapter made this a no brainer upgrade. Add in a 7 inch component screen and a lithium 12v battery to complete the setup for portability. To use the system all the user has to do is remove the eyepiece, add in the camera w/ bore adaper, plug into power and the screen, focus and get amazing images (proportional to the sensor quality). There is a way to use this design with certain USB webcams but that's a project for another day.

Craters on the day/night terminator

Mountain range!

 Looking at the moon through a telescope had me thinking, with the versatility of the new SDR I bought (that has standard SMA connectors instead of the crap MCX) if it would be possible to use it as a sort of rudimentary radio telescope. A bit of googling and scrounging later, I obtained a disused satellite dish from a friend (neighbors weren't keen on me borrowing their dishes sadly). Initial testing trying to receive the sun's radio emissions were unsuccessful using either antenna that came with the dish, unsurprising since the left antenna has a downconverter and I was not supplying any power to it, right antenna was a cavity antenna tuned to around 24Ghz which is WAY out of the RX range of this SDR that peaks at 1.7Ghz. This project will likely be in progress for a long time with the end goal of listening to Jovian radio storms.
New SDR with wideband antenna (WiFi)

World's crappiest radio telescope
Strapped to a fencepost for support

Another side project I've been working on that will be available to purchase soon is a custom breakout for the WiiMote IR camera sensor. This sensor is special because it packs 1024x768 tracking resolution for up to 4 points in X/Y/Size at 150Hz max speed over I2C into a fingertip sized monolithic package. This project was born after I was looking for a tracking camera but all the solutions were either full machine vision requiring a computer (bulky and heavy), or too complex to work with my limited skillset. While doing the research I had stumbled across the WiiMote IR sensor and it caught my attention, prompting me to go searching for a library and somewhere to buy a breakout. Finding the library to make it work with the Arduino proved to be quite easy, however it was abandonware that didn't work with IDE >1.0. A few tweaks to the code and calls made it compatible and I uploaded it to my GitHub under the new name "IRVision" so it would be easier to find for those who wish to tinker with it. Breakouts were another story entirely, being practically nonexistent aside from a few that are no longer available for sale, student projects, or a terribly messy and bulky. This lack of what I wanted prompted me to start designing a breakout to fulfill my needs. There remained a major problem to design this breakout; the datasheet, part number and consequently the precise footprint information are not able to be found anywhere I've looked (even a few greynet contacts had nothing), much less sensors available for sale(through the usual suppliers). These problems relegated the project to a back burner until I had a breakthrough, one of my net crawlers managed to find someone who had a reel of factory fresh sensors available for sale at $14/sensor shipped. With this news, design of the board began with the footprint. From an image of the WiiMote board and a reference dimension the footprint was extrapolated(Basic reverse engineering, tutorial coming soon), boards, components and a sensor were ordered. A week and a half later, with all parts in hand I excitedly sat down to assemble a test unit only to find out my footprint was wrong. Not only were the pinholes and support shield holes too small but the plastic pegs were misaligned. Undeterred, I tried redesigning the footprint but ran into the problem of overlapping holes violating DFM rules. This had me reach out to Laen of OSHPark asking what I could do, to my surprise he somehow managed to find an existing footprint of the sensor, made it a component and the latest revision of boards is ordered. Once this breakout is known to work and the beta testers(already chosen) and I come up with some cool example projects, a larger run of 10 will be ordered, assembled and put up for sale on Tindie.
Custom PCB design
Still feels weird holding something I designed
PixArt sensor scaled to finger
The joys of making footprints for a component that has an impossible to find datasheet
 After spending way too long doing all my CAD only on the computers at TechShop DC (only had Macs at home), I'd needed a computer for school so I bought an Acer Aspire 573G packing a GT940M GPU and windows. For nearly 2 years it became my daily driver and allowed me to work on projects at home. However, the taste of power and true PC gaming made me realize I needed a replacement for my weak Mac Mini. That journey began one day at TechShop while taking a poke through some new scrap that arrived I popped the side panel off a computer and immediately noted the newer generation stock Intel heatsink and i7 labeling on the motherboard. Slightly giddy, I removed the heatsink, wiped off the thermal compound and discovered an Intel i7 920 CPU in a matched motherboard. Upon testing, the motherboard fully POSTed and it was carried home that night, where it sat on my shelf for a month or so. While helping a friend ascend to a god-tier rig I noted the prior rig was mostly gutted and asked if he'd be willing to part with some components to which he told me $40 for the lot. In there was the GTX 550Ti, 8gb of Corsair RAM, and a OCZ power supply. On top of that I ordered a cheapie $35 Rosewill Blackbone case off amazon to complete the system as I had a few hard drives laying around. After a few months of use and late night gaming and CAD sessions, the bright blue fan started to grate on my nerves and retinas as it lit up my entire freaking room at night. This annoyance and the lack of USB3 started to drive me nuts so it was back to case shopping which led me to the Corsair Carbide 100R. At $50 it was a bit more expensive than the prior case but it was a WORLD of difference. Higher quality plastics (matte!), Side facing drive bays with sleds instead of rearfacing bolt bays, side window, dim white power LED and MUCH nicer cable management spaces. While migrating my computer to the new case, I was given an i3 2120 CPU, GT610 GPU and 8Gb of ram by a colleague at work. Listening to my brother's lamentations about their terribly slow iMac I built a rig out of the parts I was given in my old case with a cheap $50 motherboard to end their complaining and make house LAN night possible. Meanwhile, I've been planning upgrades to my rig including triple monitors and a better GPU for increased productivity.
Old case with a new computer thrown inside on left, new case on right
Old case w/ i3 2120, GT610, 8gb RAM (Built for $50)
Current rig: i7 920, GTX 550Ti, 12GB ram (built for $95)

The last side project was a challenge I took on out of boredom and to hone my skills, to reverse engineer a full CAD model from a single image and dimension. I'd remembered reading a Wired article about a new missile in development that mentioned a single dimension "...25-inch..." and had the image below. Based on figuring the stated dimension was the longest axis, I scaled it in CorelDraw and began to turn it into CAD parts. Complete work time to go from image to individual CAD parts and assembled model was about 18 hours. I'll probably 3D print out all the parts and hang the model in my workshop, possibly even make a flyable model rocket version for laughs. This foray into reverse engineering was a heck of a lot of fun and I'll probably make a tutorial for my method down the line a bit since it is a useful skill and a good challenge.
The source image
Completed and assembled CAD model
Below is the teaser for the new rocket stabilization system design. The current design is full of problems that the newer version fixes most of but brings in a whole new batch of problems. For the full details, you'll just have to wait until the post goes live. Until then, keep tinkering!
Quick teaser for the new system design on the left, current on right.

Q3 2016 Rocket active stabilization system update, complete hardware redesign of fin drive system with bonus sketches and a needed disclaimer

$
0
0
The old and new designs, massive improvements to the overall design
Update time has rolled around again now that a good chunk of progress is completed on the Arduino based rocket stabilization system. This has taken a while since I've been busy with not only work but also getting the A+ certification in computer repair and completely reworking my current workstation. After much discussion with several other rocket tinkerers, the conclusion was reached that stresses on the servo spline itself would be quite considerable and may result in damage or inoperability. Based on force distribution I surmised that flanged bearings embedded in the system shroud tube would function as not only supports but also as smooth rotation points. With the challenge of a new fin drive train in mind, I set to brainstorming. My first thought was to use linkages connecting the servo to the actuation shaft, though it would increase the diameter of the system unless the servos were staggered which would also increase the overall height of the system. Stepper motors were considered, however as I was unable to find suitably sized units and the common 28byj-48 had too low precision and torque this too was eliminated from consideration. After those two ideas were discarded, it was relegated to the back burner while I had work. The breakthrough was about a week later, while browsing patents looking at missile fin drives I noticed an old Raytheon control segment used bevel gears to transfer the motion and that became the seed for the new design. 
As a reminder, this project MAY fall under ITAR restrictions and as I do not have the funds to file for verification, I am playing it safe by not sharing code or CAD. This system is not designed nor intended to be used as a weapon, rather just keeps a high-power sport rocket flying vertical.  No I will not help you port my work to be used in mortars/missiles (yes people have seriously asked this). I am doing this project as a personal challenge to learn new skills, processes and to broaden my project scale horizons, I harbor no malicious intent. 
Original sketch for a new design using pushrod linkages and servos, eventually scrapped

Initial sketch of DC motor and bevel gear based drive system
With bevel gears as the motion transfer solution in mind, I thought back to motors and remembered that there are small diameter low voltage geared motors with micro encoders available on Pololu and the other usual sites. I did consider using high end Faulhalber motors with built in encoders but gave up when I saw the prices were $25 a piece, completely out of my price range. With that sorted I roughly sketched a layout for the system. Once the motors were sorted, then came the second biggest challenge; the bevel gears. I tried the usual distributors, McMaster, KHK, Robotshop, RS and eBay all to no avail. Motionco did sell acetal(plastic) gears but in this case metal is the way to go and they were UK based. I called several gear manufacturers but their quotes ranged from the low to mid hundreds which is WAY out of my price range. Slightly disheartened I turned to the last place I could think; Aliexpress. Thankfully, there are gears available though they are a bit expensive ($16/pair of which $4 is shipping that cannot be combined for some reason). The geartrain ratio between the motor and the fin output is 1:1 as is standard with most bevel gear configurations. Now that the basics for the power transfer system were locked in, I drew block diagrams and crunched the numbers for the encoder precision which came out to be .3deg/pulse on the output on the 1:100 geared 6V motor. Bearings were much easier since 3mm bores are a common dimension, a quick eBay search yielded a bag of ten 3x6x2.5 flanged bearings for well under $20.
Basic system block diagram with in-progress notes [Blackbox project note censored for safety]
Armed with the sketches and an idea of the final goal, I set to constructing CAD models for future 3D printing. In the first revision I decided to try making it air frame compatible with the current system for drop-in usability and interchangeability. However, once the model was complete I noticed that there was a LOT of room for miniaturization with all the space between the motors, output shaft and side walls. In total, I was able to carve off 28.5mm bringing the total diameter down to 47.72mm(1.879in) which is 62% smaller than the initial version. The smaller diameter means that cheaper blue tube air frames can be used in the flight and testing versions. Another aim of shrinking the size and weight is so that smaller and cheaper engines are able to be used that also do not require a L2+ high power rocket certification. After asking around and talking to none other than George Gassway (Sun-based stabilization) I found out that I CAN launch at NAR sites and not have to head out to the desert to fly.
First version of gearmotor design, prior to miniaturization
Closeup of miniaturized version, still needs a few tweaks.
Post-miniaturization I realized that using motors with encoders will result in relative positional control compared to the absolute positional control that the prior servo version had. Thinking on the problem led me to use potentiometers to supplement the encoders so I don't get off-center fins on startup leading to air frame destruction. The addition of the potentiometers adds an additional layer of complexity to the already highly involved code that will be controlling 6 PID loops for the motors and stability control. The code will be the biggest challenge for this whole project, combining Kalman filters, multiple PID loops, a whole control system and then on top of all that, a telemetry down link. For the positional motor control, I came across HomoFaciens' incredible videos on discrete servosarduino based servos and encoder digital servos of which I will be forking his code into my system. It's currently quite a bit out of my comfort zone, though I am studying control theory on my own, taping code examples together and hoping I have it right since I do not have any hardware in front of me due to costs. Speaking of costs, crappy back of the napkin math prices this new system around $170(if all parts are bought from China) whereas the servo based version would be nearly $240 if I were to buy all the parts new, a whopping 75% savings. Each of the Hitec HS-82MG servos I used previously are about $20 each at standard market rates while the motors with encoders are going for $9.50 each thanks to the far east's cloning. If all the motors, encoders and drivers were purchased on Pololu the cost for that alone would be $99.05, and that does not include the microcontrollers, 8 bevel gears or the potentiometers, but would have known quality parts. That option is too expensive for a testing version but may be justified for the flight rated system stack. Unfortunately, due to being hit with an unexpected car repair bill among other expenses on my student budget has put buying parts for the project temporarily out of the question. I've been tempted to start a GoFundMe or Patreon to offset the costs of the projects but I always stop short of launching because I feel like a dick asking for other people's money to fund my personal projects. If readers want to donate to help offset the costs of development, there is a button in the left sidebar if they so desire. 
Thanks for reading this update, as a bonus I've included more process sketches and as a special treat; a scan of the notebook page that started this whole project.

CAD assembly of new gearmotor based design
Full CAD mockup of the complete servo based stabilization system. Diameter 3 in
Size comparison of the current servo drive system with a 3D printed mockup of the gearmotor system.
Previous fin design process sketches, more blackbox project censoring
The original sketches that started the whole project, rocket fuel formulas visible through the back

Holiday season 2016 general update and MAGFest panel announcement

$
0
0
Happy Hackerdays readers! Since the last update I've been absolutely slammed between life and projects which had a drastic balance change that took more time and energy away from the blog than I'd have liked but thanks to a few alterations it is looking like I'll be back on track to get updates out more frequently and have an increase in project progress.
Hackertree 2016, with even better gear and Wi-Fi LEDs!

Ornament details

Items around base of tree detail
First off, for the third year I've brought back the Hackertree! This time with 100% more Wi-Fi enabled WS2812B "Neopixels" thanks to the ESP8266. Getting these lights up and running was for the most part dead simple thanks to a library I stumbled across, WS2812FX, which also contained the example for an ESP-based server control that switches between effect instances using websockets. I did run into an electrical problem on another set of lights that forced the ESP into a reboot and UART disconnect loop due to not enough current to drive 90 LEDs available on the 5V rail available through the dev board. After directly connecting a 5V 2A max power brick to the VCC and GND terminals of the strip, then data to the ESP on a different power brick the LEDs enabled but were misbehaving quite badly with strobing and effects not propagating across all pixels. Thinking about the way data signals work, realized I had ground differential (voltages for 0V reference weren't the same and that can cause signal wierdness) and ran an additional line from strip GND to the board's. This modification solved and all 90 LEDs were working as intended. As ornaments I used some sensor boards, a radar module, capacitive keypad and some other bits I had around the lab to complete the look. Lastly, under the tree was placed the Rigol oscilloscope, one of my new variable power supplies, DX7 RC transmitter, Quisan Magicforce 68% Mechanical keyboard (Outemu Brown switches), Nikon D3400 with two lens kit, some 18650 batteries, and lastly two rockets; a hobbyist model and the last generation stabilizer section. Finally, I've already started work on something special for next year involving hackertrees and a contest with prizes, more info coming next year.
I'll be in attendance again and hope to meet some of my readers there!
For anyone attending MAGFest (Music And Gaming Festival) next month, I will be hosting a panel on Friday night from 6:00 to 7:30 in the forge called  "Lights, sound, movement: Taking cosplay to the next level with Arduino". I and my cohost @64_B1T will be covering the basics of integrating the Arduino system with LEDs, servos and MP3 modules to add more WOW factor to cosplay. Come on by and say hello, I'd love to meet more of my readers. For those who can't make the panel, look for the guy in a lab coat with a blinky top hat and a LED staff, and keep an eye on my YouTube channel since it will be recorded for your later enjoyment and for the people who couldn't attend the con too. All code will be available on a GitHub repo that will go live at the start of the convention. Also for those who find me, I'll once again have 3D printed OSHW crest rings to hand out this year.

You have no idea how much I was freaking out internally
That is the Antares 230 for OA-5 800 feet behind me
I also had the INCREDIBLE experience of being granted Press-level access to the Antares return to flight mission out at Wallops Flight facility this past October. Standing a mere eight hundred feet away from a flight-ready spacecraft sitting on the pad was an experience that is terribly hard to describe and by far the highlight of the entire event. The sheer SCALE of these craft and realization that it's just about ready to leave atmosphere creates this odd tingling warmth in your chest as you look at it pointing skywards. A more in-depth post on this trip is coming soon.

LWIR selfie with a new piece of gear
New gear wise, I recently won a FLIR Lepton in the great Lepton giveaway which has blown my socks off with the new perspective it has given me. Seeing in a whole new wavelength where the unseen becomes visible had me meandering around my house just pointing the module at things to see how they looked to varying degrees of success. More detail is coming in an in-depth writeup and a pi-based handheld version is under development and will be put up on my GitHub when it's nearing user-readiness.

Small teaser of the testbench for the positional control development
I have not stopped work on the rocket stabilizer either, been slowly chiseling away at the new challenge of positional control of a DC motor which has been slow going but the basic foundations are done in the form of a bang-bang control plant. Major update coming before May, depends on life factors, development hiccups and part shipping negotiation from China.

New cleaner workspace configuration
Here's to the progress in 2016 and to hopefully getting to kinetic testing or even launch in 2017!


Prograde burn; I quit my day job to work at NASA

$
0
0
Yes you read that right, as of January 30th I am working at NASA Goddard as a student researcher in the earth sciences wing, specifically on the 4U Laser Hetrodyne Radiometer cubesat as a hardware/software engineering intern.

First official day on the job!


As for how on earth I landed here the story is convoluted but to make a long story short; An internet friend who works at NASA thought I'd be a good fit for his intern army and after 6 months of limbo where it was uncertain if they'd be able to get me, I finally interviewed and was in. Some of the key points of consideration were that I had a multifaceted skill set of hardware and software, in-depth documentation of my work on the blog, familiar with GitHub and lastly, open to learning new roles and skills.
Regardless of this change, my projects are moving along at a good clip and I'm still aiming to get around a post a month out, next one coming up is going to be on the MAGFest panel postmortem followed by an update on the positional motor control for the fin drive system.

This is one of the many reasons I keep telling people to start a blog and post project logs. Not only does it get your name out there but also provides and insight into your thought processes and practical application of skills. These elements are absolutely key points that employers will look for in candidates as book knowledge is great but is trumped most of the time by practical applied knowledge. I taped this blog together over a weekend as an experiment to do more technical writing and so others could learn from my mistakes made along the way.

Write not just to hopefully inspire others but also for yourself, later in life you can look back and see marked improvement in your craft, whatever it may be. Don't pressure yourself to post frequently, do it when it feels ready to go. The hardest part is the first step, so get out there and get typing!


Q1 2017 Rocket active stabilization system update; Finally have working PID for positional control of a DC motor! New gear, livestreams and the first program sponsor!

$
0
0
After nearly 4 and a half months of late nights, caffeine fueled jam sessions, one livestream(more on that later!) and more frustration than anticipated I FINALLY figured out implementation of PID for positional control of a DC motor with an encoder. More details after the break including a breakdown of problems I ran into, some shiny response graphs and most importantly; SOURCE CODE!?!?!
Motor control testbed using TB6612FNG motor driver

In working towards a positional control system, the first order of business was to go for the most basic of controllers; Bang-Bang. Dead simple to implement but not without numerous shortcomings. Several of these removed it from even consideration of the flight unit due to possibility of overcontrol or destructive airframe resonance. Airframe resonance would start as a flutter in the fins but spread to the stabilizer oscillating on the front of the rocket before finally leading to a full half of the body wobbling about the split for parachute deployment and snapping the rocket in half mid-flight. Another nightmare scenario is overcontrol, where the system attempts to correct course changes but turns itself into a kinetic hazard as it passes the +- 5 degrees off vertical allowable range for safe flight or worse goes sideways and WAY off course.
The core of the Bang-Bang control plant
A Bang-Bang control system is dead simple, if the value is not reached, keep going until it's passed at which point you go backwards. The issue arises in that the system runs at full tilt and will always overshoot unless there is a lot of inertia in the system(e.g. a flywheel or significant thermal mass) leading to the oscillation around the target value as depicted in the figure below. During my initial implementation of the controller, I had a serious problem where the system would appear to be on target and tracking but would start spinning as the counts went from the expected range (0-300) to around 32,767 before flipping out. This is an indicator of unsigned int overflow but limiting the system read range to 300 did nothing to minimize this issue. Rereading the documentation, I realized that the encoder pins were not both on the hardware interrupts and that was causing it to miss a lot of counts since A phase was on HWINT1 but B phase was on a regular pin set as an interrupt. Moving B phase to HWINT0 fixed this problem. Attempts to lower the jitter around the target included decreasing drive PWM and testing deadzones and braking but none of those worked to the extent required for flight confidence. As I had eliminated bang-bang from flight consideration, I turned to the more complicated but also FAR superior PID controller which was a heck of a challenge. 
Oscillation of actual position (Red) vs setpoint (Blue)

A proportional–integral–derivative (PID) is a controller that calculated the difference between setpoint and current variable and corrects based on the three terms (Kp, Ki, Kd). I'm going to leave the rest of the explanation to Brett Beauregard who wrote the FANTASTIC library I'm using. Early attempts at implementing the PID by taping the well-respected PID library into the bang-bang controller led to frustration due to calculated outputs being WAY off the expected. The odd thing was outputs either sharply moving around but not passing 255 or locked at that value. As I was hitting the limits of my coding knowlege I called up Joe Barnard of Barnard Propulsion Systems (the OTHER active stabilization guy on the internet) to see if he would be able to help figure out what was going wrong. Unfortunately neither of us was able to make any sense of why it wouldn't work even after 3 hours of trying to debug. It wasn't until I found a very different method of driving the TB6612FNG in a Pololu robot, specifically the 3Pi that I finally got the system working. Instead of pulling the direction pins to logical 1/0 and driving the PWM pin I pulled PWM HIGH, and drove both directions with PWM signals, which puts the driver in half-brake mode and only needs 2 IO pins instead of 4. The magical code that finally got the system working is as follows

void pwmOut(int out) {
if (out > 0) { analogWrite(AIN1, out);
analogWrite(AIN2, 0); }
else { analogWrite(AIN1, 0);
analogWrite(AIN2, abs(out)); }}
 More tuning and testing needs to be done in addition to implementing servo-protocol control but this is VERY good news since I had been holding off on further system hardware work until I'd solved the problem of positional motor control. Hold on, I know you were wondering "Hey wait a minute you said something about source code, yet you said this project is likely under ITAR, what gives!?!" no? Well you're not exaaaactly wrong. I won't be sharing the source code for the rocket controller or other fun parts but CAN share the positional control since it's not regulated and a good lesson in control mechanics. The primary reason I'm sharing this is because all the existing material out there is either absurdly vague or headache inducing with uncommented code and very strange implementations of parts. So as a firm believer in open source and learning from analyzing other's code, I have adopted the beerware license on this and my other projects that will be getting code releases. My code is available on my GitHub for everyone to use and learn from. Timelapse of my fighting with the code has also been uploaded from one of my later Twitch streams.
Clear illustration of the issue faced with initial attempt, red is target, green actual, yellow PID output. 

The magical sight of a working PID plant in action. Red is actual, Blue setpoint, Yellow is PID, Green is error.

WAY too much gain

How it's supposed to look when locked on target position
Now as some of my longer-term readers will know due to me living farther out from civilization I'd been having some godawful internet. 80gb/month and horrifically slow (<1mb/s) is REALLY not conducive to content creation or getting much done. However the big red ISP has decided to bring back uncapped internet which has been WONDERFUL! From limping along and hitting the 80gb cap frequently, now comfortably burning 300+ a month and oddly the speeds are around 10mb/s. Now with all this power, I've done something that was discussed for a long time: Livestreams! From the stream lair I did a 2 hour quick CAD cloning of the Pharah Mechaqueen rocket from an image to get a feel for streaming, and will definitely be doing more soon including Live from the lab. More work needs to be done on the upstream settings, audio levels and recording but it's a start.
Streaming/editing battlestation
Craptactular stream setup #2
Workshop overview camera
I also decided to invest a bit more into my content this year and bought myself a proper DSLR during the black friday sale and have been playing around with it. After a ton of research, the Nikon D3400 stood out above the rest and the black friday deal on the full starter set made it a no-brainer. Now the videos and pictures for the blog and youtube channel will get a dramatic increase in quality. Below are some high resolution (6000x4000) images, previously had just been shooting with my LG G4 which has a great camera but can't compete with the MUCH larger sensor and aperture of a full size camera.
New gear day! :D Bought myself a proper DSLR
Gave the last version of the rocket a paint job!
Side on view showing dataport on the stabilizer business end
Gratuitous high resolution shot of stabilizer controller internals
The first sponsor! 
Another VERY important update is that I FINALLY got a sponsor! Pololu has stepped up and contributed a full set of high power micro gear motors and encoders to match. These will be integrated into the testing version and likely carried onto the flight system assuming that everything checks out in control authority testing and launch confidence checks are green.
Teaser for upcoming post on Wii IR camera
And lastly, after WAY too long screwing around with the Wii IR camera, pooling all the documentation floating around the internet I have FINALLY got it working! Once the next rev of boards is done and testers send some projects I'll spin up a larger run, put them up for sale on Tindie and release a blog post with a document compiling all the known data on these sensors.

Upcoming appearance at DEFCON 25 in Vegas

$
0
0

You read that right, this year I'm going to be at the one and only DEFCON in Las Vegas!!!! Since this year I'd had a mutual friend of W1NST0N and I's offer some space in his penthouse suite, we ran budget estimates for flight and food, found it was well within reason and decided to go for it. I've been watching the DEFCON talks on YouTube for YEARS and have learned a TON from them, and now I can ask questions and talk to the presenters in addition to a wide range of hardware and software hackers. Another bonus is I'll be able to meet more of my readers and put faces to the handles of quite a few of the people that I've been interacting with over the years across various platforms. If you find me, I'll have the normal 3D printed rings and some swanky new business cards to give you. Over the course of the event I'll be regularly tweeting my whereabouts and meetup spots, so come say hi, I don't bite and am more than happy to answer any questions you have!

Remember: What I do release ends up under BeerWare licensing so this is a good opportunity to get those beers in! Cheers and see you in Vegas!

"THE BEER-WARE LICENSE" (Revision 42): Arsenio Dev wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

I'm not dead! Updates and teasers.

$
0
0
Radio breaking squelch Is this thing on? Oh good!
It's been a LONG time since the last update and that's my fault, apologies for the delays in posts but oh the things that have happened since the last one have been AWESOME.

New generation precision suntracker, printed variant
To start off, I have passed a year at the new job and it has been a whole freaking year of awesome times, some frustration with part of the program and then elation when finally it all worked together as intended. Developing a new high precision solar tracker from the ground up has been a massive challenge due to difficulties with getting the most critical part, the imaging Multi Object Tracking sensor that is also found in modern Wiimotes, working from just a datasheet and my admittedly terrible coding skills. Getting the driver working correctly really allowed the power and incredible value of a logic analyzer for debugging a system. On the plus side, once that was working the rest was not too much harder and I have obtained permission from PXI to open source my library once that is working so anyone can unlock the power of this wonderful sensor. Another happening here was my first field campaign with my system, destination Arizona State University to do final debugging and training of the team that will be taking it to the Amazon rain forest.

Rocket friends
Aside from that, I recently had Joe Barnard of Barnard Propulsion Systems over for rocket shenanigans! It was nice to catch up in person after two years, give him the grand tour of the workshop and CAD station, then go on to muck about with some rocketry shenanigans including static testing of the infamous Estes E motors that are so prone to CATO(but didn't this time) and building really bad rockets.


CNC suntracker(on tripod) in Arizona doing comparisons with an AERONET photometer

Later in February I took my new precision suntracker design from a 3D print and had it machined in aluminum. That in of itself was an adventure in learning how to prepare and document something for a machine shop in addition to design for manufacture and tolerances.
Deployment CNC tracker (now in the Amazon rainforest)
Tuning in the tracker in the warm Arizona sun
And then to boot, I bought a small CNC for making my own rapid prototype PCBs same day in-house for far faster turnaround and idea testing. I got spoiled on the Othermill we have in the development lab at work so I decided I'd get in on that too. In addition to milling PCBs, I can cut fins and laser etch parts with additional attachments.
3018 CNC mill for PCBs and lasering
Then a group of friends and I decided to make the informal rocketry, science and general tinkering bants chat team into a proper team and thus The Flame Trench was formed. We've got a broad range of skills on the team and there are some really cool projects around rocketry and the bleeding edge of development coming very soon.

Signal generator
More test equipment has been purchased in the form of a 60Mhz arbitrary waveform function generator from FeelTech. As I'm starting to do more with image sensors I have a need for a variable clock source and at just over a hundred dollars, this was a good starter purchase.

Shiny new hardware 
 On the topic of test equipment, the crew over at IKALOGIC sent over both their Ikascope and a SQ50 scanaquad logic analyzer for me to test out. Coming soon is a review of them versus my Rigol oscilloscope and Saleae logic analyzer. It should be interesting to see how it fares going toe to toe with the competition.

Source Image
Replication with my own build
I also finally printed out and painted the SPIKE F2M2 airframe replica and attempted to replicate the original shot that I derived the build from to moderate success. Next up is a few tweaks and some other work before shifting this into the completed projects area. Do not ask for the CAD files or STLs because I am not distributing these either.

Looking towards the back of the room

Manufacturing corner

Reorganized workbench and tinkering area
And lastly, the lab space has been refitted with several upgrades. I had a new 20A dedicated circuit run down to power the more hungry equipment like the hot air station, 3D printer and soldering irons. Another addition was three additional double T8 LED overhead lights to further brighten the space. All that extra light would have been wasted if the yawning chasms of exposed rafters in the unfinised basement ate all the reflected light, I decided to install wall and ceiling panels that are later painted white to be more reflective.


For those wondering about the status of the rocket stabilization system, I've shot a new channel trailer and there are hints about it hidden around the images in this post.

Viewing all 32 articles
Browse latest View live




Latest Images