Functional electrical stimulation (FES) is a useful technique for restoring motor functions for spinal cord injured (SCI) patients. Muscle contractions can be artificially driven through delivery of electrical pulses to impaired muscles, and the electrical activity of contracted muscles under stimulus recorded by electromyography (EMG) is called M-wave. The FES-induced muscle activation which is represented by evoked EMG recordings can indicate the muscle state. Accurate control of muscle activation level by FES is the preliminary step for achieving more complicated FES control tasks. This paper proposes a real-time FES system for control of muscle activation by online modulating pulse width of stimulus. The excitation muscle dynamics is modelled by Hammerstain system with stimulus pulse width and eEMG as input and output respectively. The model predictive control strategy is adopted to compute the pulse width command sent to the Vivaltis wireless stimulator. Four reference muscle activation patterns are provided to test and validate the real-time closed-loop FES control system. Real-time control results on one able-bodied subject show promising control performances.