This paper introduces the main principles of nonlinear optical methods like frequency conversion, second harmonic generation, sum- and difference frequency generation and optical parametric oscillation. These methods require an effective phase matching of the pumping and generated electromagnetic fields. The most effective method for maintaining the phase matching of these two fields on different wavelength is the quasi phase matching which applies a nonlinear crystal with periodically modified domain structure. Crystals with periodically modified domain structure are called periodically polarised crystals, in our case periodically poled lithium-niobate (PPLN).There are several methods to produce PPLN: one of these is the electron beam bombardment. The paper introduces some results of a research project where the aim is to develop a device which is able to create a patterned surface charge density on ferroelectric crystals.The paper will introduce how the surface charge pattern was generated with the help of the electron beam of a scanning electron microscope where the electron beam deflection is controlled by a microcontroller to produce the necessary surface charge pattern. We have determined the parameters of the electron microscope and also we have examined the pattern considering the effects happen in the crystal.