When the neuron is stimulated, it causes rapid depolarisation of the cell surface membrane. This will not generate an action potential unless it is large enough to exceed the threshold potential. If it does exceed threshold, voltage-gated sodium channels open and sodium ions diffuse into the cell, depolarising the membrane. This forms a positive feedback mechanism. Then, a membrane potential is reached (+40mV) where the voltage-gated sodium channels close, and voltage-gated potassium channels open. Potassium ions diffuse out of the cell, causing repolarisation. Voltage-gated potassium channels can be slow to close, which may cause a slight hyperpolarisation where the membrane potential goes below resting membrane potential.