Jun 01, 2012, 02:23 PM
|
|
|
Canada, BC, North Vancouver
Joined Dec 2010
895 Posts
|
Quote:
Originally Posted by mansour.ohms
Simon and TC Thanks for the tips it is working now.
Simon your remark about zero crossing triggerd a thaught. How sensitive is the zero crossing to offset drift? I assume offset drift changes with the temperature variations of the mosfets? Do you use the zero crossing for frequency measurement or is it needed for somthing else?
Thx
Ohms
|
You mean oscillator drift? It doesn't matter that much, I don't think. The not working as well at 8MHz just comes from the filtering being timed by the number of cycles it takes, not by any sort of timer. Zero crossing sensing is used to track the motor timing. As it spins, and the two other phases are held high and low by active FETs, the undriven phase voltage passes across "zero", ie, the neutral or average voltage of the motor phases. This is how we know where the motor is. We then apply the commutation timing wait, and then advance the FET commutation step.
The difficult part is that we're PWMing the high FET on and off unless at full throttle, so this introduces some noise. Since we're only working with a comparator and not an ADC, all we can do is try our best to filter the comparator's input. This loop changes speed with the oscillator speed, but it's not critically important unless it aliases badly with the PWM speed. The PWM speed at 18KHz PWM is 888 cycles at 16MHz, though, so there are quite a few opportunities to process the comparator input.
|
|
|
|
|