Thursday, February 25, 2010

DIY Jeans

There were many reasons for this project. I had it in my mind to start making my own clothing since before Christmas. However I have been busy working on my electronics projects, and general socializing and haven't gotten around to it. Then we had a snow fall a few weeks ago, and the kid in me needed to goof around in the ice, sled, and hop fences. Somewhere along the way, I tore a hole in my last good pair of jeans, in a unacceptable place. Since I work in a clean room, I can't have torn jeans and I needed a new pair.


My first instinct was to buy a pair of jeans, since I needed them fast and don't have asewing machine, or free time. However, I'm not willing to pay $80~$90 for decent jeans nor $50~$60 for crummy jeans. So my need for new DIY challenges got the best of me, I borrowed a friends sewing machine and I decided making a pair was the only way to go.


I was surprised the lack of DIY jeans information (or my inability to find it) on the internet. Try it your self. I searched for every synonym for "DIY Jeans" I could think of, but always came to the same answers; "How to modify jeans", "How to hem jeans", "How to make your jeans skinny jeans". And of course the webpages that did have info about making jeans basically said "Get a pattern, and follow it". Not the kind of info I was looking for. The 2 tips I did find helpful were to 1) prewash the fabrics and 2) use a denim needle.


So unwilling to buy a pattern, I decided to take a pair of jeans I had that were no longer wearable, and use them as a template. This was a pair I picked up in LA a few years back and have worn down some. The straw that broke the camels back for this pair was a sizable rip down the crotch I got from hopping on my bike a bit too quickly. So I sat down on a Thursday evening and tore this pair apart. I then pinned the pieces down to some denim I got at the local fabric store, and cut out the new pieces.





A bit of thread, and some patience, and I had this fancy new pair of jeans. They are not perfect, but they work. There are some minor asymetries in the legs and waist, but I can't notice them. The button could be bigger, but oh well. Also I sewed the fly on the opposite way I'm used to, so that's taken a small adjustment. But other then those asthetic things, they are a decent sturdy pair so far. Luckily I learned alot about making the pair, and when I'm inspired to make another one, I'll post some tips about the process (I could now, but I'm not sure if my tips will make them process better until I try them out).

So, if you are wondering how much I saved by making my own pair, then here is the run down:




Fabric: 1.5 yards of 10oz demin-----------------$10

Thread: One spool --------------------------------$3

Denim needles (pack of 3) ----------------------$4

General Sewing Kit (pins, chalk, etc...---------$14
---------------------------------------------------------------

Total--------------------------------------------------$31

So that's much less then $80 for a good pair.... and half off the $60 bad pair. On top of that, the sewing kit was a one time cost, and the denim needles will last for maybe 6~12 projects. That means the cost of a second pair would be the cost of the fabric and thread plus a new zipper, $13 (for the first pair I used the zipper from the pair I tore up).

Wednesday, February 17, 2010

Sled

Yes that's right. Here in the south we get maybe one snow a year. And I always enjoy it. Last year, me and my friends wanted to go sledding, but all we had were the tops of storage bins, and the didn't work to well. So I planned ahead this year.

It started snowing on a Friday aabout 2 weeks ago, so after work, me and a co-worked went to the hardware store. I picked up 10 ft of 1" PVC pipe, two angled PCV connectors, rope, bolts, and a piece of plywood. After a little drilling and fastening, and I had this guy. It worked well, but not as well as I had hoped. It had little problem sliding, but it was too low to the ground. On a good hill, it kicked up a bunch of snow in my face and was hard to see. I countered that by standing on it and realized I could actually steer it a little bit. All in all it was a success, and on a budget. However next year, I'll spend the extra few dollars and get a 3" or 4" pipe. That should let me sit as well as stand. Until then.....

Sunday, February 7, 2010

Voltage Controlled Wave Table Oscillator (v 0.1)

I was inspiried by the VC LFO and VC ADSR made using the pic16f684, so I was wondering if I could make a wavetable oscillator at Audio frequencies using the same chip. The answer is yes...

The basic idea is to use the PWM module to produce a square pulse train with a duty cycle that varies according to a lookup table. Then by filtering out the carrier signal, only the desired value for the waveform remains. This is the same method (as far as I can tell) as the above links, and definitely not anything new.

Externally, 2 pins are assigned for the crystal, 2 ADC channels for pitch and PWM (square wave only), 4 pins for waveform selection, one for trigger, and one for PWM output. This still leaves 2 open pins, which I have some ideas for below.

The software loops around reading the ADC channels, and updating the appropriate registers. A timer keeps track of when to process the next sample and update the PWM. Each waveform is contained in a 64x8Bit array. Although practically to achieve higher speeds, I can only use 7 bits (and not the full range of the 7 either). This means that the wave forms to have distortion in them, and if this were going in a function generator, it most likely would not be suitable. How ever for audio applications, distortion is not always a bad thing.

The 4 pins for wave form selection give 16 possible waves. The first 4 are the classics: Triangle, Saw, Square, and Sine. After that the next 8 are more arbitrary waveforms (exponentials, staircases, 2-slope ramps... and such). The last 4 are reserved for pseudo-random noises.

In it's current configuration, the lowest frequency is ~100Hz and the highest is ~7KHz. However this can be adjusted in software by changing one of the timers. At higher frequencies, the filter attenuates the waveform. In fact you can see that there is some ringing in the waves with sharp transitions (square, saw) caused by less then ideal filtering. By lowering the cutoff of the filter, I was able to avoid the ringing, however at the cost of more attenuation at high frequency.

The pseudo-random noise routines I use are also less than ideal. There is a definite pitch dependence of the noise, which makes it not truly random. I plan to use this for the time being, since it can create some interesting audio effects. The four different noises also each have their own character, with some being cleaner then the others.

For the next iteration of this VCO, I plan to make a few notable improvements. I want to get rid of the noise waveforms on the last 4 slots and replace them with some other arbitrary wave. To compensate, I want to use one of the free pins as VC Noise mixer, where 0V would be no noise, 5V would be all noise, and in between would be a weighted mix of noise and the currently selected waveform. I also plan to improve the filter. Moving to a 4 pole filter, and perhaps a different type. I admit that analog filters are one of my weakest EE subjects.

Friday, February 5, 2010

PG-299 (A PG-300 emulator based on MidiBox)


Any fan of the "hoover" sound knows the Roland MKS-50. And anyone who has tried to work with this rack mount synth, knows it's a pain in the ass. There are a handful of buttons on the front panel which you use to navigate the menus to alter parameters. This is ok for just setting up patches (given you have a little patience). But if you want to do any kind of live tweaking, or jump on a fleeting bit of inspiration, forget it. Roland must have know this, because they came out with the PG-300. It was basically a control surface that allowed dedicated access to all the PG-300 parameters. That great!!!....... unless your a student like myself. I don't have (and didn't have) and extra $300 to spend on a control surface.

There are plenty of software patch editors that do help the programming process and are free, however they don't compare to that tactile feeling of turning a know or pushing a slider. On top of that, I've had issues trying to switch between a sequencing program and PG-300 emulator software. To make things worse, The MKS-50 only responds to SysEx commands, so using another one of my keyboards to alter parameters isn't an option.

Luckily for me, there was MidiBox, an open source midi platform supporting analog and digital inputs / outputs as well as Midi and SysEx. So I got to work creating the PG-299 (one less then the PG-300). This was one of my first audio / uC projects. I actually finished this some time ago (2004 ~ 2005???).

Using the midi box platform I created a simple control surface with a handful of analog in. If I remember correctly, I ran out of space on the front panel to put everything I wanted, so I'm missing a parameter or two. Each slider's voltage is read by the uC and MidiBox firmware. Then a corresponding SysEx message is sent out to the MKS-50 and voila. Control of the synth..... however I also wanted to record and playback edits in real time using sequencer software. So in addition to the SysEx message, a CC message is also sent out and received CC messages are converted to a corresponding SysEx message and sent out to the MKS-50. Bing-Bam-Boom-Done

Wednesday, February 3, 2010

Desktop CNC Router II




This project is moving along on the slower side of things, but moving along none the less. The completed 3-Axis motor driver board is shown on the left and the accompanying software is shown below. The board receives commands through the computers serial port and translates them to motor movement and / or configuration commands.

So far the board is programmed to do High or Low torque full stepping on each axis, but I plan to implement half stepping as well. Microstepping however, I've not yet decided if I should implement. There are also 2 dual DAC's and accompanying comparators to act as current sensors to allow chopper drive operation. I have the board set up so you can select either a 1ohm or 0.1ohm (both 1%) power resistor as the current sense operation. This allows different current level motors to be used with minimal resistive losses in the sense circuit.

The current sense level is set with the DAC's with 12bit resolution, and the set value is sent to the comparators. The other end of the comparator is shorted to the white power resistors (one for each coil) to sense the voltage and hence current through the coil. If the comparator is tripped, it triggers an interrupt on the main uC (pic18f452) which tells which coil was tripped and shuts off the associated power transistor. HOWEVER... I implemented hysteresis on the comparator to try to avoid transient witching of the power transistors but I forgot to isolate the associated resistors from the current sense resistor (with a voltage follower). This means that the hysteresis resistors are in parallel with the current sense resistor. With the 1 ohm resistor, I get an effective resistance of about 0.6 ohms. It's too much of a pain to add the buffers to the board, but adding some larger hysteresis resistors (>1Meg) might be doable, and reduce (but not fix) the problem.

As for the software, it's still in Beta form. Right now it sends individual commands to the board controlling each axis' rotation, speed, and DAC and displays the position of each motor. It also allows for abort commands, and zeroing the axes. The software also loads G-Code files but I have yet to build the parser and translator.

So the main holdups in this project right now are the power supply (which is a standard ATX supply), but more importantly the frame, and linear drives. I've been pricing out some aluminum T-slot framing from different providers. I know from some of my work around the NCSU lab, that that type of framing, when done properly, can be very sturdy. Maybe around Tax refund time I'll be ready to purchase some t-slots profile and start assembling the frame.