PWM period is based on engine period, and is constantly updates by the Hall Sensor. The PWM tells it when to fire (based on the outlined factors) and for how long (1ms should be enough, I think). Any other method of controlling it involves making the code in such a way that it actively harms other functions.
So I need to make a table (or preferably an equation) based on just testing my engine. Right now, I have a 18 degree firing angle. Not sure how good that it, but we'll see. I might build my own dyno, or else use an electric motor as a generator and hook it up to the crank. I'll increase the resistance on the generator (more load, something like that) and use an ammeter, voltmeter--though that shouldn't be necessary--and frequency meter.
For knock sensing, I'm not even going to try with a real knock sensor. Maybe if I have time... Right now I know I'll have no valve clatter, so knock should be very apparent.