Hysteresis modelling and compensation for smart sensors and actuators