OLLO servo motor (rotation direction)

Learning ollo servo motor rotation direction

 

Things to Prepare

CM-530

OLLO servo motor (Connected to the external port No.1)

 

Theory

The controller controls rotation direction with MOT1+ and MOT1- via SIG_MOT1+ and SIG_MOT1-

ollo_mot_1.png

 

ollo_mot1_connector.png

 

Refer to controller’s port for port and pin number in 06 OLLO MOTOR ROTATE\APP\src\main.c

 

Source

int main(void)

{

 /* System Clocks Configuration */

RCC_Configuration();

/* NVIC configuration */

NVIC_Configuration();

/* GPIO configuration */

GPIO_Configuration();

SysTick_Configuration();

GPIO_ResetBits(PORT_SIG_MOT1P,PIN_SIG_MOT1P);

GPIO_ResetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M);

GPIO_ResetBits(PORT_LED_POWER, PIN_LED_POWER);

 

while(1)

{

GPIO_SetBits(PORT_SIG_MOT1P,PIN_SIG_MOT1P);

GPIO_ResetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M);

mDelay(5000);

GPIO_SetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M);

mDelay(5000);

GPIO_SetBits(PORT_SIG_MOT1P,PIN_SIG_MOT1P);

GPIO_SetBits(PORT_SIG_MOT1M,PIN_SIG_MOT1M);

mDelay(2000);

}

return 0;

}

 

 

Result

The servo motor rotates for 5 seconds and repeats rotating after a 2-second halt.