Sunday, May 3, 2009

Technical Part 1 : Speed Control

Circuit diagram of voltage regulator, 7805
Due to the input valtage to PIC 16F 877A must be 5 V, therefore a voltage regulator 7805 is used to convert the 12 V power supply to 5 V and supply the voltage to the PIC 16F 877A. From circuit above the two capacitors 100uF are connected with 12V - ground and 5 V - ground, they are used to stabilised the voltage from power supply. However, the real theory to calculte the value of capicators should be used still in process. A diode-Led is used in the circuit above to indicate the 12 V sucessfully converted to 5 V when the Led is light on. The 5-v voltage cannot be supply directly to LED, it will damage the LED. So a resistor 330 ohm is used to drop the voltage and it can be calculated by ohm law.
Circuit diagram for speed control

PIC16F 877A
First , the PIC 16F 877A will be discussed. To activate PIC 16F 877A, 7 pin must be compulsory to be connected. Pin 1 which is master clear, a 4.7 K ohm which is as a pull out resistor. However the value of the pull out resistor chosen depend on the input impedance of microcontroller. We still on the process to find out the calculation for this. Pin 11, pin 32 are connected to 5 V supply and pin 12, pin 31 are connected to ground. Next, pin 13 and pin 14 must connect to an oscillator. The function of oscillator is giving the clock to microcontroller. We chose 20MHz oscillator for PIC16F877A. However, if your design does not need the so fast speed, you can use lower value of oscillator. It will help you to save the power. We still find how to calculate this.

Speed control
Due to microcontroller work in analogoues 0 and 5 V. It is impossible to use that for speed control. The better way is used the digital method to control the speed for stepper motor. As a result the first thing we need to do is change the analogoues to digital of microcontroller. To varied the digital value, a potential meter is needed which connected in pin2 as shown at circuit diagram above. The 8 led at pin 33 to pin 40 is a testing method to let us know the digital value after we adjust the potential meter.

Setup for ADC


Programming for speed control

No comments:

Post a Comment