So I've found that if I use a sample time that is extraordinarily higher than the actual frequency that it tends to get closer (but never exactly to) the duty cycle that I'm putting in.
At the moment, I'm having to use a sample period that is 200 time higher than the desired frequency.