Discussion forum for the BasicX family of microcontroller chips.
Slow BLDD motor drive - Tom Becker - Feb 5 13:13:38 2007
I'm trying to slowly drive a small 14-pole, 12-coil brushless outrunner
motor via three channels of H-bridge and all three BX-24 PWM signals
that synthesize three-phase sinusoidal signals. The PWMs directly
connect to the H-bridge but, when filtered with a small RC, the three
sines appear to be in proper phase at ~1Hz.
Still, the motor rocks, apparently between two coil sets and does not
advance. If, however, I manually power only two leads at a time in
proper sequence, I can advance the rotor. I do not understand why
three slow sines won't do the same. Can anyone help?
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: Slow BLDD motor drive - Tom Becker - Feb 5 21:08:57 2007
> ... the motor rocks, apparently between two coil sets ...
Alas, I was on a wrong pin; sorry. It works, afterall.
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: Slow BLDD motor drive - daveleb55 - Feb 6 15:19:49 2007
Tom,
Can you post some details of this circuit? One of the sticking points
of using Brushless motors for robotics is the relative expense and
complexity (compared to brushed) of the controllers. The motors
themselves have gotten a lot more inexpensive.
Thanks,
Dave
--- In b...@yahoogroups.com, "Tom Becker"
wrote:
>
> > ... the motor rocks, apparently between two coil sets ...
>
> Alas, I was on a wrong pin; sorry. It works, afterall.
> Tom
>

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: Slow BLDD motor drive - Tom Becker - Feb 6 21:31:04 2007
> ... One of the sticking points of using Brushless motors for
robotics is the relative expense and complexity (compared to brushed)
of the controllers...
I agree, and I think that still stands. The motor I happen to be
playing with is intended for electric flight, so its typical
controller is not reversible and has relatively poor control
resolution - but the combination is powerful. When powered by a
stiff 12v source the motor can spin an 8" or 9" propeller at 12000
RPM or so with a 25Amp controller. My understanding is that these
controllers take feedback from the unpowered phase and uses
trapazoidal ramps to achieve high speed with good torque.
I'm trying something quite different, a virtually-stepless stepper-
like positioner. The hardware is simply three H-bridges, one for
each motor lead, and a current-limited power supply. The H-bridges
I'm using are L298-based, a poor choice for this low-resistance
motor, actually, but I have them on hand and they work well enough
for demonstration. When running at 1.5A, total of three phases, the
bridge needs about 4.25v and dissipates about five Watts when PWM'd
at 14kHz, so I've got a sizable heatsink on the L298; the motor runs
stone-cold. I use BX-24 Timers 1 and 2 to generate the three PWM'd
phases. I chose the fastest PWM rate to silence an otherwise loudly-
singing external rotor and higher coil current which is, in this
instance, undesirable. In my code, a simple loop increments a shaft
angle value, in radians, by a small amount and calculates the
appropriate PWM pulse widths to synthesize the three 120-degree-
offset sine waves that drive the coils that position the rotor.
The result is a very-slowly rotating shaft, literally as slow as you
want (in this case, about one rotation in 60 minutes),
like a stepper - except the motion is continuous. A sweep second
hand would be easy, too. The shaft can be stationary, of course, by
simply freezing the shaft angle (and, consequently, the three phase
PWM values), or reversed by decrementing the shaft angle. A larger
shaft angle increment per loop makes a faster shaft speed, but too
large an increment will cog, which limits the practical shaft speed.
This isn't a feasible way to drive a brushless motor at higher
speeds, where mechanical dynamics and inductance get in the way of
simplicity. But for very slow positioning motion, this works.
const pinPhaseA as byte = 25 ' Timer2 PWM
const pinPhaseB as byte = 26 ' Timer1A PWM
const pinPhaseC as byte = 27 ' Timer1B PWM
Public Sub InitializePWMs()
Call PutPin(pinPhaseA, bxOutputHigh) ' init PWM pins
Call PutPin(pinPhaseB, bxOutputHigh)
Call PutPin(pinPhaseC, bxOutputHigh)
register.TCCR2 = bx0110_0001 ' Timer2 8-bit PWM, Clk/1
register.OCR2 = 0 ' Clear duty cycle
Register.TCCR1A = bx1010_0001 ' Timer1 8-bit PWM
Register.TCCR1B = bx0000_0001 ' Clk/1
Register.OCR1AH = 0 ' Clear duty cycles
Register.OCR1AL = 0
Register.OCR1BH = 0
Register.OCR1BL = 0
End Sub
Public Sub SetPWMs(ByVal PWMA As Byte, ByVal PWMB As byte, ByVal PWMC
As Byte)
Register.OCR2 = PWMA 'set duty cycles
Register.OCR1AH = 0
Register.OCR1AL = PWMB
Register.OCR1BH = 0
Register.OCR1BL = PWMC
End Sub
Sub Main()
call sleep(0.5)
call InitializePWMs
call putpin(15, 1) ' enable L298 channels
call putpin(16, 1)
dim Phase as single, P(0 to 2) as byte
const TwoPi as single = 6.2831853 'per cycle, 7 cycles/rotation
const PhaseStep as single = 0.00062831853 ' 1/7000 rotation/loop
do 'endless
Phase = Phase + PhaseStep
if Phase >= TwoPi then 'Phase = Phase mod TwoPi
Phase = Phase - TwoPi
elseif Phase < 0.0 then
Phase = Phase + TwoPi
end if
P(0)= cbyte(255.9*(sin(Phase)+1.0)*0.5)
P(1)= cbyte(255.9*(sin(Phase+TwoPi/3.0)+1.0)*0.5)
P(2)= cbyte(255.9*(sin(Phase+TwoPi*2.0/3.0)+1.0)*0.5)
call SetPWMs(P(0), P(1), P(2))
loop 'endless
end sub
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: Slow BLDD motor drive - Tom Becker - Feb 7 23:26:47 2007
Here's a 60-second per rotation 3-phase driver that uses a Block Data
vector. If anyone wants it, I'll post the Block Data file, which is
a 4389-sample 8-bit sine. 30723 is the number of samples required
for a 14-pole three-phase motor to complete one revolution in 60
seconds at 512 samples per second. 4389 is one cycle of seven per
rotation.
[Actually, the Block Data vector is two cycles long. That allows
using a simple additive offset, without a Mod function, for the
offset phases' addressing.]
All of the calculation has been done beforehand here, so the task to
generate the phases is trivial and can easily run at the system tick
rate, so the rotation rate can be expected to be one RPM (0.01%).
The motor is absolutely silent.
'4389-sample 8-bit sine
public Sines As New ByteVectorData("b4389Sines8bitPWM.blk")
const pinPhaseA as byte = 25 ' Timer2 PWM
const pinPhaseB as byte = 26 ' Timer1A PWM
const pinPhaseC as byte = 27 ' Timer1B PWM
Public Sub InitializePWMs()
Call PutPin(pinPhaseA, bxOutputHigh) ' initialize PWM pins
Call PutPin(pinPhaseB, bxOutputHigh)
Call PutPin(pinPhaseC, bxOutputHigh)
register.TCCR2 = bx0110_0001 ' Timer2 8-bit PWM, Clk/1
register.OCR2 = 0 ' Clear duty cycle
Register.TCCR1A = bx1010_0001 ' Timer1 8-bit PWM
Register.TCCR1B = bx0000_0001 ' Clk/1
Register.OCR1AL = 0 ' Clear duty cycles
Register.OCR1BL = 0
End Sub
Sub Main()
call sleep(0.5)
call InitializePWMs
call putpin(15, 1) ' enable motor
call putpin(16, 1)
dim i as integer, j as integer, k as integer, lT0 as long
do 'endless
j = 1463 ' 120 degree offset
k = 2926 ' 240
for i = 1 to 4389 ' 4389 steps/cycle, 30723/rotation
lT0 = register.RTCTick
do until register.RTCTick <> lT0
loop 'wait for 512Hz tick
j = j + 1
k = k + 1
Register.OCR2 = Sines(i)
Register.OCR1AL = Sines(j)
Register.OCR1BL = Sines(k)
next
loop 'endless
end sub
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: Re: Slow BLDD motor drive - kali rajan - Feb 12 23:46:55 2007
hai Tom Becker
i saw your BLDD motor drive specicfication, it was simply superb. but i need a
detail about universal motor diagram and specicfication. if you have any idea about this
motor please send mail to me assoon as possible
Tom Becker
wrote:
Here's a 60-second per rotation 3-phase driver that uses a Block Data
vector. If anyone wants it, I'll post the Block Data file, which is
a 4389-sample 8-bit sine. 30723 is the number of samples required
for a 14-pole three-phase motor to complete one revolution in 60
seconds at 512 samples per second. 4389 is one cycle of seven per
rotation.
[Actually, the Block Data vector is two cycles long. That allows
using a simple additive offset, without a Mod function, for the
offset phases' addressing.]
All of the calculation has been done beforehand here, so the task to
generate the phases is trivial and can easily run at the system tick
rate, so the rotation rate can be expected to be one RPM (0.01%).
The motor is absolutely silent.
'4389-sample 8-bit sine
public Sines As New ByteVectorData("b4389Sines8bitPWM.blk")
const pinPhaseA as byte = 25 ' Timer2 PWM
const pinPhaseB as byte = 26 ' Timer1A PWM
const pinPhaseC as byte = 27 ' Timer1B PWM
Public Sub InitializePWMs()
Call PutPin(pinPhaseA, bxOutputHigh) ' initialize PWM pins
Call PutPin(pinPhaseB, bxOutputHigh)
Call PutPin(pinPhaseC, bxOutputHigh)
register.TCCR2 = bx0110_0001 ' Timer2 8-bit PWM, Clk/1
register.OCR2 = 0 ' Clear duty cycle
Register.TCCR1A = bx1010_0001 ' Timer1 8-bit PWM
Register.TCCR1B = bx0000_0001 ' Clk/1
Register.OCR1AL = 0 ' Clear duty cycles
Register.OCR1BL = 0
End Sub
Sub Main()
call sleep(0.5)
call InitializePWMs
call putpin(15, 1) ' enable motor
call putpin(16, 1)
dim i as integer, j as integer, k as integer, lT0 as long
do 'endless
j = 1463 ' 120 degree offset
k = 2926 ' 240
for i = 1 to 4389 ' 4389 steps/cycle, 30723/rotation
lT0 = register.RTCTick
do until register.RTCTick <> lT0
loop 'wait for 512Hz tick
j = j + 1
k = k + 1
Register.OCR2 = Sines(i)
Register.OCR1AL = Sines(j)
Register.OCR1BL = Sines(k)
next
loop 'endless
end sub
Tom
---------------------------------
Here’s a new way to find what you're looking for - Yahoo! Answers
[Non-text portions of this message have been removed]

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: Re: Slow BLDD motor drive - Tom Becker - Feb 12 23:59:26 2007
> ... universal motor diagram and specification...
Your request is not clear to me. Do you mean an AC/DC "Universal"
motor, like in small appliances?
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )