A large Schmitt reflector telescope, Large Sky Area Multi-Object Fiber Spectroscopic Telescope(LAMOST), is being
built in China, which has effective aperture of 4 meters and can observe the spectra of as many as 4000 objects
simultaneously. To fit such a large amount of observational objects, the dispersion part is composed of a set of 16
multipurpose fiber-fed double-beam Schmidt spectrographs, of which each has about ten of moveable components realtimely
accommodated and manipulated by a controller. An industrial Ethernet network connects those 16 spectrograph
controllers. The light from stars is fed to the entrance slits of the spectrographs with optical fibers.
In this paper, we mainly introduce the design and realization of our real-time controller for the spectrograph, our design
using the technique of System On Programmable Chip (SOPC) based on Field Programmable Gate Array (FPGA) and
then realizing the control of the spectrographs through NIOSII Soft Core Embedded Processor. We seal the stepper
motor controller as intellectual property (IP) cores and reuse it, greatly simplifying the design process and then
shortening the development time. Under the embedded operating system μC/OS-II, a multi-tasks control program
has been well written to realize the real-time control of the moveable parts of the spectrographs. At present, a number of
such controllers have been applied in the spectrograph of LAMOST.