how do you calculate the duty cycle
Use an ordinary diode such as 1N4148 and 1MΩ variable resistor.
Connect the diode in series with VR and connect this circuit in parallel to resistor R.
By changing direction of a diode you will be able to adjust high or low ratio
If you use two diodes and VR between them connected in such a way that the middle pin of VR will be connected at one side of R and both diodes at the other end of R you will be able to adjust duty cycle from, say, 5% to 95%.
Regards,
IanP