dirty_d
10 kW
i just ordered one of those 130kV 6.5kW motors from hobbycity to replace my poor melted MY1020 motor that my brushed controller killed. i could buy a beefy R/C ESC, but i think it would be more fun and cheaper to make one. also i think most of the rc controllers use a low PWM freq like 8khz, im pretty sure that will make a loud audible sound because when i first programmed my brushed controller i used 10khz pwm by mistake and it was loud as hell like a speaker, 20khz was silent.
i got a pretty good idea of what im going to do, ill use a ATMega168 at 20MHz to control the whole thing, ill only need one PWM output and i will use 6 AND gates controlled by 6 of the general purpose I/O pins to route the PWM signal to the correct high and low side fet's driver. ill need 6 because im going to apply the same signal to both the high and low side, the only way i can measure the backemf during the PWM off time is if the low side fet is also off, not just the high one. i need to get backemf information all the time because of the commutation speed of the motor im using, there is only 278us where each phase is floating to measure backemf. the ADC would only be able to take 4 samples in this time period at full resolution, thats nowhere near good enough. what im going to do is use is 3 analog comparators that compare each phase voltage with half the voltage across the other two phases. this will work during PWM on and off time but with some noise that needs filtering, the three signals will be the same as 120degree hall sensors except 30 degrees in advance. the signals will go to 3 different interrupt enabled pins, when the signal changes from low to high or high to low an interrupt routine will be called that will doublecheck the state of all three pins then set a timer up to trigger an interrupt when the commutation should occur. the timed interrupt will use a lookup-table to change the two on of four off AND gates to energize the correct phases, it could also doublecheck the states of the 3 signal pins again to make sure the interrupt wasnt triggered by PWM noise.
theres a lot of stuff to do there in a very short amount of time(278us), so id have to prioritize things. the most important i think would be the commutation timing, so it would use interrupts and everything else would be done in the spare time(throttle sampling, current sampling and limiting), current limiting is also very important, but i could have something like an emergency current limit enforced by analog circuitry, if it goes over it a comparator will pull down the PWM output of the MCU and turn off all the fets.
what do you all think? does it make sense?
i got a pretty good idea of what im going to do, ill use a ATMega168 at 20MHz to control the whole thing, ill only need one PWM output and i will use 6 AND gates controlled by 6 of the general purpose I/O pins to route the PWM signal to the correct high and low side fet's driver. ill need 6 because im going to apply the same signal to both the high and low side, the only way i can measure the backemf during the PWM off time is if the low side fet is also off, not just the high one. i need to get backemf information all the time because of the commutation speed of the motor im using, there is only 278us where each phase is floating to measure backemf. the ADC would only be able to take 4 samples in this time period at full resolution, thats nowhere near good enough. what im going to do is use is 3 analog comparators that compare each phase voltage with half the voltage across the other two phases. this will work during PWM on and off time but with some noise that needs filtering, the three signals will be the same as 120degree hall sensors except 30 degrees in advance. the signals will go to 3 different interrupt enabled pins, when the signal changes from low to high or high to low an interrupt routine will be called that will doublecheck the state of all three pins then set a timer up to trigger an interrupt when the commutation should occur. the timed interrupt will use a lookup-table to change the two on of four off AND gates to energize the correct phases, it could also doublecheck the states of the 3 signal pins again to make sure the interrupt wasnt triggered by PWM noise.
theres a lot of stuff to do there in a very short amount of time(278us), so id have to prioritize things. the most important i think would be the commutation timing, so it would use interrupts and everything else would be done in the spare time(throttle sampling, current sampling and limiting), current limiting is also very important, but i could have something like an emergency current limit enforced by analog circuitry, if it goes over it a comparator will pull down the PWM output of the MCU and turn off all the fets.
what do you all think? does it make sense?