These delay functions are actually PWM for the servo motor. The code in while(1) function is determining whether the push button is pressed? if pressed delay functions are called. When ever delay is needed i call the function. Tower Pro servo SG90 9g has duty cycle from 1 ms to 2 ms. If you don’t go through the above tutorial you will be unable to understand the code below. It is upgraded version of TowerPro MG945. The above link is very important to understand the code. This is a popular, very strong servo motor you can use with Arduino and other microcontroller systems to drive. Using Timers of 89c51, 89c52 Microcontroller for generating delays.Here is a small tutorial link on how to calculate delay values? I calculated the values for generating 18 ms,1 ms,1.5,1.8 and 2 ms delay and loaded them in the timer registers. To generate delay using 89c52 microcontroller you need to calculate the values for delay and load them in the timer register. In which 18 ms is low signal and 2 ms is variable high signal. Tower PRO SG90 9g motor has a PWM period of 20 ms. In some servo motors if the duty cycle increases the maximum limit it will have no effect on arm, those particular servos not rotate their arm on duty cycles greater than their specifications. If duty cycle increases 2 ms servo arm will not come back to its position it will go out of order. Speed of arm can be controlled by changing the duty cycle very slowly. To move servo motor arm at 135 degree duty cycle will be 1.75 ms. One can easily rotate the arm at fixed angle by just varying the duty cycle. Moves to 0 degree on duty cycle of 1 ms.Moves to 180 degree on duty cycle of 2 ms.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |