some renaming

This commit is contained in:
Eyck Jentzsch 2018-10-21 00:14:14 +02:00
parent 9f9088a110
commit 458c75c5e4
2 changed files with 5 additions and 7 deletions

View File

@ -199,7 +199,7 @@ void next_commutation_step(void) {
} }
} }
void start_motor(void){ void start_open_loop(void){
nextCommutationStep = 0; nextCommutationStep = 0;
//Preposition. //Preposition.
gpio0::port_reg() = (gpio0::port_reg() & ~DRIVE_MASK) | driveTable[nextCommutationStep]; gpio0::port_reg() = (gpio0::port_reg() & ~DRIVE_MASK) | driveTable[nextCommutationStep];
@ -218,12 +218,10 @@ void start_motor(void){
auto bemf = bemf_1>bemf_0?bemf_1-bemf_0:bemf_0-bemf_1; auto bemf = bemf_1>bemf_0?bemf_1-bemf_0:bemf_0-bemf_1;
next_commutation_step(); next_commutation_step();
nextDrivePattern = driveTable[nextCommutationStep]; nextDrivePattern = driveTable[nextCommutationStep];
// if(i>12 && bemf>32 && ((zcPolRise && bemf_0<2048 && bemf_1>2047) || (!zcPolRise && bemf_0>2047 && bemf_1<2048)))
// return;
} }
} }
void run_motor(void){ void run_closed_loop(void){
auto count=0; auto count=0;
auto zc_delay=0U; auto zc_delay=0U;
auto tmp=0U; auto tmp=0U;
@ -241,9 +239,9 @@ void run_motor(void){
int main() { int main() {
platform_init(); platform_init();
printf("Starting motor\n"); printf("Starting motor\n");
start_motor(); start_open_loop();
printf("done...\n"); printf("done...\n");
// Switch to sensorless commutation. // Switch to sensor-less closed-loop commutation.
run_motor(); run_closed_loop();
return 0; return 0;
} }