Hobbies And Interests
Home  >> Science & Nature >> Science

How to Control a Servomotor With the Basic Stamp

Servomotors are not like ordinary motors. They do not turn thousands of times a second -- they rarely turn a complete revolution. Like ordinary motors, servomotors convert electricity into mechanical force, but they are used for control. A servomotor mimics the action of a control, so a servomotor on a ship's rudder might turn the rudder 12 degrees when a small lever in the control room of the ship is turned 12 degrees. Stamps are computers on a chip that have several pins devoted to input and output signals. They are used by hobbyists to control robots and other projects.

Things You'll Need

  • Stamp microprocessor
Show More

Instructions

    • 1

      Write out the plan in detail before you start programming. Use whatever system you are familiar with -- flowcharts, pseudocode, pictorial representation with boxes and arrows or just a detailed description in English. The most serious mistake you can make in writing a program is to start without a plan. Work out all the details in an informal way before writing the first line of code. There is programmer's heuristic that captures this idea: "The sooner you start coding, the longer it takes."

    • 2

      Connect a USB cable between the Stamp and a PC and bring up the PBASIC coding environment. Transcribe your detailed plan into PBASIC code. Read over the code carefully. A single typo could wind up destroying expensive equipment if it is not corrected in time. Download the program to the Stamp.

    • 3

      Test the program before installing it in the equipment it is meant to control. It cannot be tested completely outside the environment, but this preliminary test can find some errors without damaging expensive equipment.

    • 4

      Install the stamp and start the serious testing. Do easy things first, and when you do the extreme testing, take all possible safety precautions. For example, if the Stamp is controlling an anti-aircraft gun, the program should prevent the gun from shooting straight up. When you test this, you should use a blank shell.


https://www.htfbw.com © Hobbies And Interests