Pages: [1]   Go Down
Author Topic: Brushless Motor Direction control  (Read 3679 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 72
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, i want to make my own version of brushless gimbal. For first step i want to know how to control brushless motor, especially for direction control. Is there any reference that i can learn?

i will use this motor:
http://www.rctimer.com/index.php?gOo=goods_details.dwt&goodsid=871&productname=

And i will use L6234D as a motor driver..

Thank You for your help..
Logged

0
Offline Offline
Shannon Member
****
Karma: 215
Posts: 12455
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a sensorless motor by the look of it, most ESCs are unidirectional (there is no way to cleanly reverse a sensorless motor
without stopping and re-starting it).  The bulk of such motors power airscrews which only ever need to go one way.

However its worth looking for RC model car/truck ESCs to see if there's a reversing one for that application.

[ edit: Oh, that's a high-resistance motor - does it have hall-sensors then? ]
« Last Edit: May 02, 2013, 11:32:34 am by MarkT » Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Jr. Member
**
Karma: 0
Posts: 72
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a sensorless motor by the look of it, most ESCs are unidirectional (there is no way to cleanly reverse a sensorless motor
without stopping and re-starting it).  The bulk of such motors power airscrews which only ever need to go one way.

However its worth looking for RC model car/truck ESCs to see if there's a reversing one for that application.

[ edit: Oh, that's a high-resistance motor - does it have hall-sensors then? ]

Yes, the motor is sensorless. And for brushless gimbal system, i will use IMU as the sensor. This IMU will control the motor using close loop system, like this video:


There is an open source project about brushless gimbal:
https://code.google.com/p/brushless-gimbal/

But, I find it hard for understanding the concept and overall programming code. So I must to learn step by step, start from how to control Brushless Motor Direction..
Logged

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 49
Posts: 2544
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The basic concept is that you're feeding the motor 3 phase AC power with each phase offset by 120 degrees (or 2/3 PI radians). Increase the frequency and the motor spins faster; stop the frequency and the motor stops, etc.

With the L2634 the control is via the IN1, IN2, IN3 inputs. It's basically three half bridges allowing each of the outputs to source or sink current. You have to analogWrite() to the inputs to get your smooth motion; analogWrite(pin, 0) makes the pin sink, analogWrite(pin, 128) is off, analogWrite(pin, 255) is source. So -- going out on a limb here with totally untested code -- for a smooth movement between two poles of the motor:

Code:
for (x = 0; x < 2 * M_PI; x += speed) {
  analogWrite(IN1, 128 + 128 * sin(x));
  analogWrite(IN2, 128 + 128 * sin(x + 2/3 * M_PI));
  analogWrite(IN3, 128 + 128 * sin(x + 4/3 * M_PI));
  delay(100);
}

Is that right? My trigonometry is horriblesmiley-sad-blue
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 72
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The basic concept is that you're feeding the motor 3 phase AC power with each phase offset by 120 degrees (or 2/3 PI radians). Increase the frequency and the motor spins faster; stop the frequency and the motor stops, etc.

With the L2634 the control is via the IN1, IN2, IN3 inputs. It's basically three half bridges allowing each of the outputs to source or sink current. You have to analogWrite() to the inputs to get your smooth motion; analogWrite(pin, 0) makes the pin sink, analogWrite(pin, 128) is off, analogWrite(pin, 255) is source. So -- going out on a limb here with totally untested code -- for a smooth movement between two poles of the motor:

Code:
for (x = 0; x < 2 * M_PI; x += speed) {
  analogWrite(IN1, 128 + 128 * sin(x));
  analogWrite(IN2, 128 + 128 * sin(x + 2/3 * M_PI));
  analogWrite(IN3, 128 + 128 * sin(x + 4/3 * M_PI));
  delay(100);
}

Is that right? My trigonometry is horriblesmiley-sad-blue

Great explanation Chagrin, but i stil wait my brushless motor and L6234D to come. I will try your code when they arrive..
Logged

0
Offline Offline
Shannon Member
****
Karma: 215
Posts: 12455
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sine wave drive may not be optimal - depending on the magnet pole and stator shapes a rectangular or trapezoidal  waveform may give more even torque - I'd recommend using a phase -> drive level lookup
table - you can then try out different waveforms trivially.

In the first instance straight trapezoidal is the easiest, either on or off, you can use PWM for speed
control.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Jr. Member
**
Karma: 0
Posts: 72
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sine wave drive may not be optimal - depending on the magnet pole and stator shapes a rectangular or trapezoidal  waveform may give more even torque - I'd recommend using a phase -> drive level lookup
table - you can then try out different waveforms trivially.

In the first instance straight trapezoidal is the easiest, either on or off, you can use PWM for speed
control.

What is the difference between use sine wave and trapezoid wave? Why sine wave may not be optimal?
Logged

Pages: [1]   Go Up
Jump to: