Generating a 0-40 ohm signal

Maybe my phrasing is incorrect? I need a 0-40 ohm input into a sensor. I currently use a stepper that varies a potentiometer between 0-40 ohms. I would like to improve upon this and have a cleaner signal to vary between 0-40 ohms.