The Turntable Motor Controller Project - Part 4 - Prototyping and Hair Pulling
Initial Testing Prototype |
Here is a picture of the earliest prototyping stage, it was minimal to test the most basic functions and critical stages. The wooden base is a general prototyping box I made some time ago, it has a place for the mounted micro controller (left) the prototyping board (right) and a bank of switches, buttons and pots that are prewired and easily connected to the protoboard with wires popping up through the slot just above them. Helps keep everything in place when doing projects.
So the micro controller is an Atmel based board with built in USB interface and various I/O ports including the all important PWM ports needed in the generation of the sine waves, serial communications. It has analog input ports too, but I have not used them for anything on this project, yet. On the protoboard is mounted one channel of the filter network, part of the op-amp circuit and the power supplies. You can see off to the left the power op-amp mounted to a heat sink. The op-amps I used need hefty heat sinks as they can handle a fair amount of current and also generate pretty good heat in the process, without the heat sink, they would fry fast.
My first steps involved finding a method of generating the sine waves with the micro controller. Browsing around for ideas and clues I came across a technique that I really liked laid out by a guy at the University of Koln in Germany. After checking the program out and seeing it would be great for my purposes I wrote the author of the code for permission to use some of it in my project. Nice guy, he gave me his blessings. So I set out altering the code (by the way, the whole thing is programmed in C ) to meet my needs and add all the code necessary to operate the unit. My first test codes generated a very nice sine wave, oh yeah I thought, this can work! So once I verified the basic sine wave generation, I had to get my fingers dirty generating all the code to make it a dual sine wave generator with the features I wanted in it. Dang, I have not programmed in a long time, simply due to a lack of any specific project or purpose needing coding. So it was a bit of work brushing the 'rust' off my coding skills. But hey, like riding a bike they eventually came back, wobbly, but came back. That is where the hair pulling came in, debugging code and programming all the bits and pieces. As mentioned this was the basic test bed, so no fancy LCD displays, minimal functions.
The area that did cause me headaches was the op-amp circuit, getting it to behave and produce a clean sine wave was a bit of battle with components, values and dealing with the heat issues (first prototyping took place without a heat sink, that was dumb) a lot of the instability was because the op-amp chip was overheating. I did eventually get to a good working stage, so I designed the schematic according to the configuration on the protoboard.
3D Rendered Model of the PCB |
So, next phase was to layout a complete schematic for a working board on my computer to advance to the next stage of designing the complete working PCB with everything needed to generate and amplify two independent sine waves, connect the LCD display and button panel and the power supplies. That was fun to do, a very zen thing. There is some great software out there for hobby, and professional, board design and layout. To the right you can see the 3D model of the board I designed with the micro controller mounting to the bottom (gray part at bottom centre). I liked the look of how it came out, so I checked and re-checked and re-checked again and again before finally sending out an order for 3 prototype boards to get made up for me. I was really excited and all I could do was wait the month or so it took to get the boards back. That was a painful wait.