Cheap way to modulate a signal.


We have a sprayed that gets a 24 volt signal. What’s a cheap way we can modulate that signals duty cycle.
My initial thought is a programmable relay and some sort of analog dial.

Suggestions appreciated.
Please explain what your particular 24V signal is.
A binary discrete signal, meaning 0V or 24V?
Or a pulse width modulated signal; a binary discrete signal whose on/off periods vary in width?
Or a continuously modulated 0-24Vdc signal?
Or something else?