Ferroelectric materials are used to manufacture precision mechanical actuators and sensors. Lead zirconia titanate (PZT) is one of the best materials for the job because of its excellent electromechanical properties. Potassium sodium niobate (KNN) is a promising lead-free alternative to PZT. The effects of atomic defects, domain walls and grain boundaries, which play a role during industrial manufacturing processes, are investigated using density functional theory (DFT) and atomistic simulations. This makes it possible to modify specific material properties.