We started off by getting the oscilloscope up and running so that we could check the signal we were generating, this came in very handy as we would soon see.
We then started off building the prototype board with the atmel mega 8 as the main control chip for generating the PWM signal.... we hit 2 problems that we never thought we would have ever done.
First time we hock the board up with everything connected, we connected the wrong power source wire's, so we were pumping 12v into the board instead of 5v... with a quick rip out of the wire's after seeing this on the multimeter we were hoping that we did not blow the ISP programmer, but we would only know this once we got it all up and running.
After changing the wire's to the power supply and making sure we had the right voltage we thought it was time to try again. so we plugged it all in again and crossed fingers, after such a stupid mistake surly we would not do something like that again... NOTHING.... Stew trys thinks we might have blowen the atmel chip with the 12v we were feeding it. He touched the chip... "aaaaaaaahhhhhhh" screams Stew, "The chip is F****ing hot" so we turn it all off again and check the wiring. Turns out we had connected the 5v power into the analogue to digital converter pin instead of the vcc pin.
We changed the wiring and checked it 100% as we did not want to make a stupid mistake again. NOTHING..... but this was not a surprise as we were almost sure by this stage we had blown the atmel, so with a quick swap out of the chip finally everything was running 100%
We weird up an LED to the board and wrote some code to make it blink. Yay it was working now we could get to work on the code to generate the PWM signal to control the Motor.
We had some problems at first with generating the signal as we were still getting our heads around the atmels data sheet. Finally we figured out the right equations to use to get the numbers for the right pulse width. we thought it would be best to get a servo moving first as this uses the same signal as the motor controller. Now with the right signal being generated it was not hard to get the servo moving and we had that done in no time.
Time to move to the motor controller... we first got this running as normal and just made the motor speed up and slow down but itself. we then programmed in a serial controller so that we could start getting so debug info out the system. this turned out to be way way easier than we thought, and in a short time we were getting info out of what our program was doing. we moved on to start making the speed of the motor controllable from the serial console, with a few tweaks of the code we got this done.
By this stage we thought we should call it a night, So we shot a video of what we had done and posted to You Tube.