Monday, October 15, 2007

Motor PWM Redux

Okay, so after talking to Nick I found that there was a major, yet very simple, flaw in my circuit. Basically there should be two separate power supplies, one for the motor and one for the microcontroller, and bridge these using a transistor. The only change was directly connecting the V+ of one battery directly to the motor, instead of putting both on a common rail with a voltage regulator. Below is an updated schematic, I forgot to add the cap last time too(BTW I really want to fix dia's sheets to include more schematic symbols, but I suck at vector graphics, maybe one day):



The microcontroller takes in input from a dip switch and then converts it from binary to a number and uses that as how often the motor should be on. So if it is set to 0001 then the motor is on 1 out of 16 cycles, and 0110 would be on 6/16 cycles. The code although really simple can be found here.

I'm still noticing that rapid switching(Having the transistor switch every cycle) still causes it to overheat, so I have a 10,000 cycle wait in between each switch. All the other problems, such as everything overheating when stuck, have been fixed.

0 comments: