The PWM pulse that will be used, will be generated from the 555 timer IC. The timer is connected in astable mode where the output is taken from pin 3 and the duty cycle is controlled by varying the voltage going into pin 5. The circuit diagram is shown below.
The frequency of the timer is set by R1, R2 and C3 using the formula
F= (1.44)/((R1 + 2R2)*C3)
Capacitor C1 and C2 are used to filter out noise. More details on this can be found in the 555 timer datasheet.
POSITIVE BUCK - BOOST CONVERTER
The PBB converter was built using 2xIRF510 power MOSFET, 2xBY229 rectifier diode, one inductor and one capacitor. The circuit diagram is shown below
From the circuit above it can be seen that this converter can have 4 possible states which are shown in the table below
However for simplicity this project will only use state 00 and 11. The output voltage from this circuit can rise from zero to the desired value you want depending on the inductor size and the duty cycle of the PWM. Also it should be noted that the larger the inductor size, the lesser the current consumed and the lesser the output voltage.
FEEDBACK DESIGN
The purpose of the feedback circuit is to ensure that the DC motor rotates at a constant speed irrespective of the load changes. In theory we know that one of the way to vary the speed of a DC motor is to vary the voltage applied to the terminals of the DC motor. Also we know that when the load a DC motor increases, the speed reduces which means the voltage at its terminal reduces and it posses more torque. To maintain this motor back to its original speed, the duty cycle of the PWM has to be increased thereby increasing the overall output voltage. Below is the circuit for the feedback control
The circuit above behaves as an amplifier and as a comparator. The circuit ensures that the voltage at the inverting pin is equal to that of the non-inverting pin in so doing the the motor is maintained at a constant speed. If the inverting pin is greater than the non-inverting pin, the output voltage is low and vice versa.
RPM COUNTER
The RPM counter is to be designed using a reflective object sensor (QRD1114) and a 2n3904 NPN transistor. The motor shaft is black with a strip of white line. When the sensor detects a white surface it gives a high voltage and when it detects a black surface it gives low voltage, thereby generating a pulse signal. The 2n3904 transistor will form a darlington pair with the photo transistor thereby generating enough voltage that can be detected. Below is the circuit diagram
The controller that will be used to count the number of pulse will be the PICAXE 20M2 micro-controller. The micro-controller has the ability to sample the number of pulses that enters into any of its input pin. The value counted is multiplied by 60 to find the RPM.
Complete system working
System Simulation
Hardware implemented