November 22, 2015 § Leave a Comment
Hi folks, I’ve been working on lab 6 of the Embedded Systems – Shape the World course. Here is my 4-bit piano in all it’s glory:
The algorithm uses periodic interrupts that steps through the profile a sound wave (32 steps in this case). The interrupt period for each step vary depending on the pitch we would like to play. The faster the period, the higher the pitch. The buttons from left to right correspond to C, D, E, F notes respectively.
This lab really made me think about how electric keyboards are made and programmed. A lot of work must have been made to digitally profile numerous instruments, I also imagine the programming to be very sophisticated to play multiple notes simultaneously. I wonder if periodic interrupts are used in general electric keyboards similarly to this lab, and if so, whether or not interrupts are nested in another to superimpose different pitches together to play several notes simultaneously?
Anyways, on to the next lab.
October 11, 2015 § Leave a Comment
Building a self-balancing robot, Roboty, teaching it how to balance and to avoid running into things is like having a child. To understand where I am getting at, let me share with you my story of building a self-balancing robot.
The journey of this self-balancing robot begins with a micro-controller, an embryo, still tethered to its mother (the laptop) through an usb cable (the umbilical chord). A simple hello world sketch brings this young embryo to life.
WIlfrid – “Hi Roboty!”
Roboty – *blink, blink*
Wilfrid – *blink blink*
Roboty – *blink blink*
Wilfrid – “Okay, let’s give you some wheels so you can do more than just blink”
Roboty – *blink blink*
Wilfrid – “Okay, I’ll give you Bluetooth and a big ass lipo battery so that you got plenty of juice as well”
With that, the robot gain new motor functions, and autonomy as it evolves into a small frame with wheels, motor controller, and a giant lipo battery (4S2P 4000 mAH). The umbilical chord is now severed, and the self-balancing robot can communicate and be programmed wirelessly through Bluetooth.
The initial frame was very crude. Fragile as it was made of some MDF boards that I found lying around in my closet, and held together by screws and 0.25″ stand-offs.
This was what Roboty looked like:
Like a toddler the robot can’t quite stand up yet, but it can crawl on the floor, bump into things, and say gaga.
Wilfrid – “Okay, now try moving your wheels”
Roboty – *turns on wheels, and darts across the room*
Wilfrid – “TOO FAST!” *runs after Roboty*
Roboty – “gaga”
Wilfrid – “Ehh, I didn’t program that!”
For a toddler to stand up, they must understand what it is like to be upright. I prop this young robot on its two wheels, the robot begin to understand the physics of this world through its IMU sensor, capturing acceleration and gryo data.
Wilfrid – “This is what it feels like to stand up, Roboty”
Roboty – *splits out a bunch of yaw, pitch, and roll data*
Wilfrid – “Yea I know, this is a lot of information to take in. At least you didn’t have to go through the trouble of getting your IMU sensors working!”
It must now understand how to coordinate their wheels so that it can remain upright. I attempt to get the robot to balance on its wheels with a PID algorithm, to stabilize the pitch at 0 degrees.
Wilfrid – “Roboty, you must balance on your two wheels by moving them towards where you are leaning. If you feel you are leaning faster towards that direction, you must move your wheels even faster to compensate! Your goal is to try to stand straight up without any wobble.”
Roboty – *confused, wobbles, then face plants and runs off*
Wilfrid – “Dammit I need to program a kill switch for this” *chases after Roboty*
After some tuning to the PID algorithm…We finally get it right… but interestingly it runs off into one direction.
Wilfrid – “Okay Roboty, I know this is our 100th time doing this, but I got a good feeling about this one”
Roboty – *Stands upright*
Wilfrid – “Yay! You can stand!”
Roboty – *Runs off into one direction, smacks into the couch, turns around and face plants*
Wilfrid – “Okay… now I just need to teach you how to stay put…”
Now that we’ve stabilized the pitch, we need another slower PID loop to control the position so that the robot does not run off. If I were to redo this project again, I would use a state-space-controller to control the two outputs simultaneously.
Wilfrid – “Yay, Roboty, you can balance now and stay put!”
Roboty – *blink blink*
Wilfrid – “Okay, now let’s see how well you can reject external disturbances” *Smack, Smack*
Roboty – @_@ *Wobble Wobble*
Wilfrid – “Yeap, you know how to balance now!”
One day, while going home on the TTC. I couldn’t help but wonder how well it rejected disturbances on the subway. As I took the robot out of the bag, people looked at me strangely, and wondered what the heck was this big sketchy looking thing. To be fair, it did have a bunch of visible wires, and a giant lipo battery on top… to make it worst, there is a LCD displaying a number (voltage) on the top of the robot.
If security was around, I’m sure they would have a lot of questions for me.
March 23, 2014 § Leave a Comment
I wouldn’t say I am a person who takes really good care of my belongings because, in 2 years, my new glasses already have a build up of scratches that blurs my vision and drives me crazy.
I did some quick research online on how to remove those scratches, and this was what worked for me:
- Liquid Metal Polish
- Microfiber cloth
- A lot of elbow Grease
- Put a dab of liquid metal polish onto the microfiber cloth
- Rub the polish onto the scratched surface of your lens in little circles until the scratches are removed
- Rinse the glasses in warm water and dry with a cloth to check for scratches
- repeat steps 1-3 until all scratches are removed
February 24, 2014 § Leave a Comment
Sometimes when you are a fisherman, it is common to take out your bucket of fishing lures to find them all tangled up.
A client in Florida seeks to solve this problem with a new way to store fishing lure and lines. He brought me on board to help take his idea through from conceptualization to commercialization.
The project began at the ideation phase: communicating specifications, concept drawings, features, manufacturability. Three months later, we ended up with an injection molded plastic retaining case, neatly packaged in blister cards, produced at less than a buck. This product is now sold in fishing equipment stores all over North America.
I present the Rigrap:
Rigrap in use:
Rigrap packaged neatly in blister cards and a display stand:
October 23, 2013 § Leave a Comment
While working for Eclipse Scientific, I was given the opportunity to build a product from the ground up. The problem was that our test engineers had to bring 3 pipe scanners (sizes Small, Medium, and Large) with them to test sites for various sized pipelines. The goal of the project was to design one adjustable scanner to accommodate pipe diameters of all sizes. By the end of the work-term I was able to put together a prototype that did just that.
The adjustable pipe scanner features an aluminum frame that can hold up to 8 ultrasonic transducers. The frame is used in conjunction with Jireh’s Billy Goat drive platform, and a spring loaded encoder. This pipescanner, with it’s drop down bracket accessory is capable of accommodating pipe sizes from 6″ dia to 42″ dia.
When using this scanner to scan welds on pipes, water will flow into the billy goat through a hose, and will flow out of a manifold into the channelled acrylic blocks contacting the surface of the pipe.
As the water flows through the channel and makes its way to the pipe’s surface. It acts as a medium, bridging the surfaces of the acrylic block and pipe surface so that the ultrasonic sensor (sitting on top of the acrylic blocks) can penetrate deep into the pipe, to detect weld defects, without any noise from gaps.
The scanner will ride around the pipe with an encoder keeping track of the scanner’s position such that the exact location of any defects, if found, can be known.