If you live in Malaysia and Cytron is one of your resources, you should have seen all those expensive brush less motors called Vexta. They come with a gearbox and a speed controller.
I looked at the data sheet and I did not see anything about PWM, so I tried to use PWM to control it and I failed. I was using a roughly 60KHz PWM and it did not work. I tried with 16MHz and I am getting a very good result from them. I am using an AVR board which has an Atmega 1280 on it.
I just wrote the following program to make it work.
////////////////////
int a=0;
while(1)
{
OCR0A=a;
OCR0B=a;
a+=10;
delay_ms(3000); //delay_us(500)
if(a>240)
{
a=0;
}
}
//////////////////////
necessary registers are the following:
PORTB=0x00;
DDRB=0x80;
TCCR0A=0x83;
TCCR0B=0x01;
TCNT0=0x00;
OCR0A=0x00;
OCR0B=0x00;
Keep in mind that I was using a 16MHz clock.
There is something else that I have to share, in the catalog there is a page called connection and operation, in that page all on are indicating gnd and all off the indicate +5 (High). (I don't know why)
So in order to run it with PWM, this is what you do with the speed controller:
PIN 1: not connected
PIN 2: not connected
PIN 3: GND
PIN 4: GND
PIN 5: PWM
PIN 6: not connected
PIN 7: +5V (HIGH)
PIN 8: +5V (HIGH)
PIN 9: GND for clockwise. 1 for counter clockwise
PIN 10: GND
PIN 11: GND
This is the video of the Vexta motor running.
No comments:
Post a Comment