Nerf Sentry Gun…be afraid.
The nerf sentry gun was developed as a final project for Cornell University’s CS1114 Matlab Robotics class. Jason Wright (www.jasonline.net) and I worked on the gun together, and were awarded “coolest final project”.
Check out the video of the gun in action, and see how we built it:
READ ON FOR PICTURES, SOURCE CODE, AND A COMPLETE FEATURE LIST
33 commentsAnalyzing Outputs, Tweaking Code, Adding Features, and finishing the Guitar
I haven’t posted an update in a while, but it’s purely because we’ve been so busy with the bot. As the long title of this post implies, we’ve gotten a lot accomplished recently, including finishing the guitar! (not the whole bot, just the physical guitar)…But I’ll get to that in a bit.
- We’ve been tweaking the program signifigantly, and have implented a new cleaning algorithm that almost completely solves the issue we had with missing star power notes. Because of their unique shape, star power notes were only picked up by the photodiode light sensors for half as long as regular notes, resulting in them being filtered out. Our new code prevents that from happening.
- We wired into the “back/select/star power” button to allow our bot to automatically activate star power. This means that our bot is now completely independent, and can play every aspect of the game on its own. For now, there is just some simple code telling the bot when it should use star power (ie. use it when there are a lot of notes, and no blank space), but we are still improving its intelligence in that area. The back button and accelerometer still work for activating star power in manual mode (or autonomous).
- After wiring up the star power connection, we realized that we sometimes might not want the bot to activate star power on its own accord. While we are trying to make it as intelligent as possible, it will never be perfect at figuring out when to hit it, and when going for really high scores, we may want to turn off that functionality. Thus we figured we’d add a switch that turns off automatic star power triggering. While we were at it, we added one that turns the auto-whammy on and off…(whammying all the time can get annoying).
- During testing, we realized that we were going through 9-volts really fast (every few hours), so we decided we’d need a better power source, or at least an alternative. We experimented with stealing the guitar’s USB power, but found that there was not nearly enough current being supplied to power both the guitar and our circuitry. So, we got a DC coaxial jack with a built-in autoswitch, and installed it into the side of the guitar. When no wall adapter is attached to the guitar, it automatically uses it’s 9-volt battery, and when you plug in a wall adaptor, it automatically uses that to power our circuitry. Pretty neat huh?
- Using a National Instruments Data Acquisition Device and LabView software, we hooked our board up to the computer and used it to analyze the outputs of the processor in comparison to the notes on the screen. We are still sifting through data, but it should help us determine how and where we can improve our software to fix missed notes, double strums, etc.
- Finally, we finished the guitar today! We recently got our new PCBs, and today we installed one, and wired up everything. We neatly organized all the wires in the guitar, attached some labels to help us solder at the right points, and capped it off with a piece of plexiglass cut to match the shape of the guitar. We left an opening on the side because A. it looks cool, B. keeps our circuitry cool and C. it allows us access to the board as we continue to acquire data from it with the DAQ.
So that’s it! We should be getting a metal rack for the sensors very soon, and then those will be mounted very nicely on a tripod infront of the screen. After that, it’s just program tweaking!
Here’s are some pics for those who don’t want to read all of that above ;)
2 commentsMore guitar mods, and PCB testing
Since we are convinced that the inside our our guitar is going to look really cool when complete, we’ve decided to make a a back window out of plexiglass, so today we’ve started to cut it.
As normal, today was also another day of program tweaking, something that will likely take a while longer at the current pace.
Since we now have the PCBs in our possession, we have also begun running tests with them. The sensors work perfectly, and though we will be getting different control boards, we are modifying the current ones to work as the future ones will (by jumpering connections, and cutting leads).
Here are some pictures from today:
No comments
Guitar Programming bug fixes, PCB testing, and USB installation
At this point, it’s all about bug fixes. We have two working version of our program, the spin version, running in a slower interpreted language that is easier to code, and a super fast-assembly version, that still doesn’t work perfectly, but can process 20x faster than its spin cousin. We’re trying to add new, smarter filters as well, but we’ve found that these are easier to code in spin first, and then we can move them over to assembly afterwards.
We also came to the realization today that we don’t have an intense name for our bot! So if anybody can think of a cool name, please let me know!
I started doing some test circuits on the PCBs today as well. The sensor boards work perfectly, but we will have to remake the controller boards to coincide with our new programming. In the mean time I am testing the current control boards with our old programming to ensure that the rest of their wiring is correct.
Lastly, we finally got our mini-B to B usb extension cable today. The mini-B end will plug into a processor inside the guitar, and I cut an opening in the side of the guitar for the USB-B connection. This will allow us to make programming changes to the chip without even opening the guitar, once everything is done.
Here’s some pictures from today:
No comments
Even more Programming, and the Arrival of PCBs
Oh yes, even more programming today. After spending hours working out little bugs in our new code platform, we finally have a “working” version. However, it is still not as good as our previous program (the one that 100 percented a song). However, it can process significantly faster, and once we figure out how to harness that correctly, we will have some very powerful code. Not only that, but it makes more efficient use of our 8 core chip. Where our previous code used a core for each colored button, we now parallel process all the buttons in one cog, leaving the other cogs open for USB debugging, and hopefully some other things in the future (I’ll leave those as a surprise). Dr. Neil Singer, our supervisor, has been a big help with debugging and optimizing our coding.
We also got our new PCBs today, which we can now start soldering and testing. They should clean up our setup quite a bit. We are working on a stand for the monitor that will hold the sensor boards in place, while allowing for them to adjust horizontally.
Here are some pics to enjoy:
No commentsFirst 100%!
Granted, it was on practice mode (to avoid the star power notes that mess it up), but we did get our first 100% today on a custom song: “Black Widow of La Porte.” Most of today was focused on our new approach at the programming aspect. In order to speed up the processing (thus allowing better capture of star power notes and better strumming), we are moving some inputs around, and importing them all into the program as a binary list that we can edit without accessing main memory as much (which takes lots of time).
No commentsProgram Tweaking
As we prepare for our final circuit boards to arrive, we have been fine tuning our programming. Today involved trying to learn assembly language, a programming form that allows for faster execution of code, but is signifigantly more difficult to write correctly. Some aspects of our project execute a bit too slowly, and we believe that changing to assembly code may fix that.
No commentsReverse Engineering the Guitar Hero X-plorer
We got a whole lot done today. On the programming side of things, we’ve been working on getting the signals to go in through the microprocessor. There are a few things that the processor has to take care of…It needs to take in all signals simultaneously, and record their values (0 or 1) into a circular array so that they can be held in memory long enough to called after the necessary delay (the time it takes for the notes to reach the bottom of the screen from where our sensors are). Our processor (the parallax propeller) has 8 cores in it. 1 is dedicated to each of the inputs (5 total), another one runs the main program that executes the other cores, one more sends the signals out after adding a delay and processing (button presses and strumming), and the last is used use for debugging. We just about have the signal cleaning algorithm sorted out, and we are now working on adding a delay.
Onto the hardware side… Last week, We opened up the guitar and tested out connections using a multimeter and the “Game Controller” applet in the windows Control panel. Since the guitar is USB, you can plug it into USB, and analyze the button presses in that applet (Virtual buttons light up when you do different things on the guitar). They don’t make it easy. There are 5 buttons, each with 2 touch-sensor type things. When the buttons hits them, a circuit is completed and the button in the game is “pressed.” But, there are only 8 wires coming from the neck of the guitar. After a lot of wire tracing, we realized that some of the connections share a ground, while others don’t. Using the wrong ground results in only half the voltage drop (a drop from 2V down to 0V indicates a short and that the button has been pressed). After figuring out the pinout diagram (I’ll post it later) I was able to solder the appropriate wires onto connections for the guitar boards. I did this in such a fashion that the guitar will still work normally, but the wires will also be routed to the propeller chip that can virtually press the buttons. I soldered on leads that will allow the chip to activate the strum up and down, the whammy bar, and all 5 colored buttons. All of this will be contained inside the guitar. We will cut a hole in the side for a D-sub connection. There will also be a D-sub connection on the sensor bar on the screen. Wires will run between them carrying the information from the photodiodes, and in the other direction providing a 3.3V rail and a grounding wire.
Below are some pictures of the boards with new wires soldered on, and of our current prototyping board for the photodiodes and programming:
2 comments