A microcontroller is a type of microprocessor that includes all or most of the interfaces, facilities and memory required to perform some range of tasks in a single cheap and convenient package. A microcontroller typically has a fixed and limited amount of in-built memory, for instance, rather then access to large banks of memory via a (data) bus. Although one can buy very powerful computer-on-a-chip packages that can do anything a PC can, the sort of thing that drives a Palm PC for example, a microcontroller usually means a much smaller, weaker and cheaper device. One that, for example, can be programmed and integrated to perform some relatively simple task such as monitoring the internal temperature of a fridge and using this information to drive the cooling system at the proper rate to maintain the temperature at some value that is also read from a dial, while noting when the door of the fridge is open and turning on the light at such times.
Typical feature of a modern microcontroller are
- a small, simple CPU, typically 8 or 16-bit, though 32-bit CPUs are also available,
- a little ROM - one or a few kilobytes - (non-volatile, read-only memory) to store the program the microcontroller should run,
- a little RAM - from as little as twenty bytes to a few kilobytes - to store variables the program produces and uses at run-time,
- a clock generator, producing digital pulses at a high, constant rate for timing purposes,
- programmable timers that will alert the program when a certain length of time has elapsed, and other interrupts (signals) triggered by the various inputs the chip possesses,
- a variety of input/output interfaces. Typically one or more analogue inputs passing through analogue-to-digital converters, some digital inputs and digital outputs and one or more standard serial ports.
An industrial robot might consist of several modules, each controlled by its own microcontroller. It might very well have input/output ports where material to be processed is loaded into or out of the machine, a gripper to hold material while it is being transported or processed and an arm driven by electric motors to move the material to and from the I/O port to the processing port.
I ought probably make it very clear that the machine's I/O ports are physical locations where processing material may be placed, whereas the microcontroller's I/O ports are electronic circuits connecting the microcontroller to external circuits. I'm going to call physical I/O ports placements from here on in the hope of avoiding confusion.
The microcontroller of an input placement might be connected to one or more digital pressure sensors that indicates whether an object is present and properly aligned in the placement, and possibly also to a light curtain indicating where something - a user's hand perhaps - is in the placement though not resting in it. These sensors would connect to a microcontroller via it's digital input ports. The placement may well also posses a door that must be opened to allow the material to be inserted or extracted, and closed to protect the operator, or to allow the placement to be evacuated before a second door to the processing enclosure is opened. These doors might be controlled by relays connected to the microprocessor's digital outputs and further sensors indicating that they are either open or closed. The placement microprocessor would therefore run a program that waits for an article to be inserted in the placement, opening and closing doors at the proper times, possibly triggering a pump to evacuate the placement or opening a valve to allow air in, and, when a door is open, watching out that man and machine do not both have a hand in the enclosure at the same time for safety reasons. It would supply a summary of the state of the placement - whether it is full or empty, ready to load or to unload - to other components in this machine via digital outputs or a serial connection.
When material is present in the placement and ready to be loaded from it into the processing enclosure, a robot arm might extend it's gripper into the placement and pick up the material. The motors driving it would be controlled via the analogue and/or digital I/O ports of a second microcontroller, and this microcontroller would calculate the proper outputs to move the motors as quickly as possible while maintaining a smooth motion - not triggering resonances in the robot arm.
The gripper might be driven by a third microcontroller, with sensors indicating whether the gripper is open or closed and whether it is holding something or not and relays that allow it to open or close it's hand.
Each of these microcontrollers must communicate with at least one other to allow material to be input, carried to the processing port of the machine and returned to the user after processing. |