Maker Pro
Maker Pro

DC motor to microcontroller electrical problems

J

joshc

Jan 1, 1970
0
Hi,

I'm trying to get a closed loop motor controller running using a
Freescale PowerPC MPC5554 microcontroller and a brushless DC motor. The
motor has 2 quadrature encoder outputs that I am reading with my
microcontroller to determine speed and direction. The problem I am
running into is that when I wire everything up, and with the evaluation
board not connected to power, as soon as I turn on the bench power
supply that powers the motor, the 5V power status LED on the eval board
lights up dimly and I see 2 volts there. This only happens when the
quadrature encoder B signal is hooked up to the microcontroller
quadrature decoder input(eTPU).

I have a Bench power supply with 0-30V output, an evaluation board with
a 12V DC power supply, and a brushless DC motor.

I have the bench power supply +/- hooked up to the motor power/ground.
I have a motor enable signal going from a 5V post on the evaluation
board to the enable input on the DC motor. I have a PWM output from the
microcontroller going to the input on the DC motor. I have the 2
quadrature encoder signals from the motor connected to 2 decoder inputs
on the microcontroller.

The bench power supply has a GND output too. Do I need to connect this
to anything? I tried connecting the "-" output of the power supply to
the GND pin on the bench power supply and then connecting the GND on
the bench power supply to a GND pin on the evaluation board. The
current leakage still occurred regardless of whether or not I connected
the GND from the bench supply to the evaluation board. How should I be
using the GND pin on the bench supply and should I be common grounding
the bench supply and the evaluation board the way I was doing above?

Can someone please help me understand what might be wrong here with my
wiring? I know this is a bit lengthy, but feel free to ask for
clarifications. I am clearly NOT a hardware guy.

Thanks,

Josh
 
C

Chris

Jan 1, 1970
0
joshc said:
Hi,

I'm trying to get a closed loop motor controller running using a
Freescale PowerPC MPC5554 microcontroller and a brushless DC motor. The
motor has 2 quadrature encoder outputs that I am reading with my
microcontroller to determine speed and direction. The problem I am
running into is that when I wire everything up, and with the evaluation
board not connected to power, as soon as I turn on the bench power
supply that powers the motor, the 5V power status LED on the eval board
lights up dimly and I see 2 volts there. This only happens when the
quadrature encoder B signal is hooked up to the microcontroller
quadrature decoder input(eTPU).

I have a Bench power supply with 0-30V output, an evaluation board with
a 12V DC power supply, and a brushless DC motor.

I have the bench power supply +/- hooked up to the motor power/ground.
I have a motor enable signal going from a 5V post on the evaluation
board to the enable input on the DC motor. I have a PWM output from the
microcontroller going to the input on the DC motor. I have the 2
quadrature encoder signals from the motor connected to 2 decoder inputs
on the microcontroller.

The bench power supply has a GND output too. Do I need to connect this
to anything? I tried connecting the "-" output of the power supply to
the GND pin on the bench power supply and then connecting the GND on
the bench power supply to a GND pin on the evaluation board. The
current leakage still occurred regardless of whether or not I connected
the GND from the bench supply to the evaluation board. How should I be
using the GND pin on the bench supply and should I be common grounding
the bench supply and the evaluation board the way I was doing above?

Can someone please help me understand what might be wrong here with my
wiring? I know this is a bit lengthy, but feel free to ask for
clarifications. I am clearly NOT a hardware guy.

Thanks,

Josh

Hi, Josh. There are a number of possibilities here, and I'm not really
sure what advice to offer to start out with.

As a WAG, I'd guess you've got either a conceptual problem or wiring
problem, and have accidentally hooked up the motor so the 12V is
getting into the EVB through the motor coil or one of the signal lines.
Unless there's optoisolation of the signals going to and from the
motor, you must have the GNDs connected together. Potentials only
exist from a reference voltage, and if you've got two power supplies,
you have to somehow connect them together for voltages from one to
achieve potentials relative to the other.

Is it possible you might be able to post the schematic of your circuit?
That would give a lot more information.

Cheers
Chris
 
J

joshc

Jan 1, 1970
0
Hi, Josh. There are a number of possibilities here, and I'm not really
sure what advice to offer to start out with.

As a WAG, I'd guess you've got either a conceptual problem or wiring
problem, and have accidentally hooked up the motor so the 12V is
getting into the EVB through the motor coil or one of the signal lines.
Unless there's optoisolation of the signals going to and from the
motor, you must have the GNDs connected together. Potentials only
exist from a reference voltage, and if you've got two power supplies,
you have to somehow connect them together for voltages from one to
achieve potentials relative to the other.

Is it possible you might be able to post the schematic of your circuit?
That would give a lot more information.

Cheers
Chris

Thanks for the reply Chris. I'll try to get a schematic of the circuit
up. It's all just straight wires between the motor and EVB but I'll
create one and post it up. As for hooking up the grounds, what you say
makes perfect sense. What I was confused about was the separate GND
banana jack on the bench power supply. I have a +/- output from the
bench power supply. I'd think I just wire the "-" output to the ground
on the EVB and ignore the GND banana jack but I don't know. Can you
clear up this point while I work on creating the schematic?

Thanks.
 
C

Chris

Jan 1, 1970
0
joshc said:
Thanks for the reply Chris. I'll try to get a schematic of the circuit
up. It's all just straight wires between the motor and EVB but I'll
create one and post it up. As for hooking up the grounds, what you say
makes perfect sense. What I was confused about was the separate GND
banana jack on the bench power supply. I have a +/- output from the
bench power supply. I'd think I just wire the "-" output to the ground
on the EVB and ignore the GND banana jack but I don't know. Can you
clear up this point while I work on creating the schematic?

Thanks.

OK, Josh. The question of "ground" is one of the perennial topics
here, and if you google this newsgroup, you'll see the answer many
times over.

Basics for your application is that the thing you call "GND" on your
schematic is actually circuit common, the reference voltage from which
all other board voltages are measured. This is the - end of the power
supply, I'd guess. Actual cold water pipe ground (the green banana
jack on the power supply) is connected to the round plug on the line
cord, and the chassis of the power supply. You don't need it at this
point, and your circuit will certainly work OK without it.

Actually, it might be a bit of a problem, if your motor 12VDC power
supply has any leakage current to ground (sometimes a problem with some
cheapie power supplies). Best to just set up the negative terminal of
your 5VDC power supply with the negative terminal of the 12VDC supply,
connect that node to your circuit "GND", and be done with it.

Hope this has been of help. Look forward to more information. While
you're at it, you might want to specify the EVB and also the motor
setup. Any web links would be helpful.

Good luck
Chris
 
J

joshc

Jan 1, 1970
0
Chris said:
OK, Josh. The question of "ground" is one of the perennial topics
here, and if you google this newsgroup, you'll see the answer many
times over.

Basics for your application is that the thing you call "GND" on your
schematic is actually circuit common, the reference voltage from which
all other board voltages are measured. This is the - end of the power
supply, I'd guess. Actual cold water pipe ground (the green banana
jack on the power supply) is connected to the round plug on the line
cord, and the chassis of the power supply. You don't need it at this
point, and your circuit will certainly work OK without it.

Actually, it might be a bit of a problem, if your motor 12VDC power
supply has any leakage current to ground (sometimes a problem with some
cheapie power supplies). Best to just set up the negative terminal of
your 5VDC power supply with the negative terminal of the 12VDC supply,
connect that node to your circuit "GND", and be done with it.

Hope this has been of help. Look forward to more information. While
you're at it, you might want to specify the EVB and also the motor
setup. Any web links would be helpful.

Good luck
Chris

Chris, I appreciate all your replies. Regarding the ground, I have
found myself reading many threads on it in the past when I was trying
to get to the bottom of "ground loop". Anyways, I think that part is
clear to me now. Here's some information on the motor I'm using.

The data sheet is here:

http://www.myhurst.com/hurstmfg/pdf/BrushlessDC031704.pdf

It is an NT DYNAMO BRUSHLESS DMC4336B10003 CL B 36 VDC 2.50 Amp motor.
If you decode the model number based on the data sheet linked above, I
have the "digital" one which is quite confusing the way it is
explained. The motor definitely spins as expected when I feed it a
square wave from a function generator, i.e. stopped at 50% and
increasing speed either side of 50% in different directions.

The evaluation board I'm using is the MPC5554 Demo from Axiom
Manufacturing:

http://www.axman.com/support/MPC5554DEMO/MPC5554DEMO_SCH_C.pdf

Can you suggest a program to use to make an ascii schematic? I really
just plan on making a little block diagram type thing showing how the
motor is connected to the EVB. Anyways, hopefully the above information
helps. In the meantime, I'm going to try to figure out how to create
the schematic.

Thanks,

Josh
 
H

Homer J Simpson

Jan 1, 1970
0
Can you suggest a program to use to make an ascii schematic? I really
just plan on making a little block diagram type thing showing how the
motor is connected to the EVB. Anyways, hopefully the above information
helps. In the meantime, I'm going to try to figure out how to create
the schematic.

Andy's Ascii Circuits

http://www.tech-chat.de/
 
C

Chris

Jan 1, 1970
0
joshc said:
Chris, I appreciate all your replies. Regarding the ground, I have
found myself reading many threads on it in the past when I was trying
to get to the bottom of "ground loop". Anyways, I think that part is
clear to me now. Here's some information on the motor I'm using.

The data sheet is here:

http://www.myhurst.com/hurstmfg/pdf/BrushlessDC031704.pdf

It is an NT DYNAMO BRUSHLESS DMC4336B10003 CL B 36 VDC 2.50 Amp motor.
If you decode the model number based on the data sheet linked above, I
have the "digital" one which is quite confusing the way it is
explained. The motor definitely spins as expected when I feed it a
square wave from a function generator, i.e. stopped at 50% and
increasing speed either side of 50% in different directions.

The evaluation board I'm using is the MPC5554 Demo from Axiom
Manufacturing:

http://www.axman.com/support/MPC5554DEMO/MPC5554DEMO_SCH_C.pdf

Can you suggest a program to use to make an ascii schematic? I really
just plan on making a little block diagram type thing showing how the
motor is connected to the EVB. Anyways, hopefully the above information
helps. In the meantime, I'm going to try to figure out how to create
the schematic.

Thanks,

Josh

OK, Josh. I'd guess we're getting somewhere (after a fashion). Here
are some initial impressions:

* Your Hurst motor has a two pin power connector (36VDC nominal) and a
digital connector. The motor docs aren't clear on any connection
between the two, but I can tell you for sure that, as with most
computer-controlled real-world electronics, you either make sure the
computer is powered up first, or do the design in such a way that you
won't have these problems. Since you've got "spam in a can" (set
board, motor), I'd recommend that you use a relay (driven by the SBC)
to turn on and off the 36V for motor power.

* I'd also be using one of the control signals (Run/Stop), but not
relying on this for safety or overriding motor control. Keep the
safety circuit separate from the uC as much as possible.

* You mention that you've got an enable signal tied directly to the +5V
of your SBC. That might not be a good idea. You might want to tie
that to an output instead.

* Another thing you might have concern for is the logic level of your
signals. I'm not sure from a cursory glance at the schematic about the
output voltage level of your signals, but the motor docs show that they
want TTL-compatible signals. I'd actually guess this is one of the
first places you should look for the source of your original issue. If
your outputs are 3.3V, and they're required to source current, they
might not be getting up to logic transition level. Not only that, but
usually motor control signals have pullups, so it's possible you might
be getting current from the Hurst motor logic through those pullups
(thus lighting the LEDs). If you can get away with open collector
signals, you'll immediately eliminate any possibility of a sneak path
for current getting into your 5V power supply from the motor control
pins.

* Since there's no indication on the motor docs that the motor control
signals are optoisolated from the motor voltage, you'd have to assume
they're not. But you also can't just assume the - of the 36V is the
same as the "Return" of the digital signal. You might want to arrange
to have the 36VDC supply floating (no GND connection or any direct
connection to the 36V power supply). Any connect between the 36V and
the logic common might be made inside the motor, but it won't have any
effect on ground loops that way.

I hope you've at least got a start on places to look. All of this
interface stuff is pretty basic once you know it. Sorry I'm not
familiar with your SBC -- this is all unfortunately very general
advice.

Two other things. If this is a school project and you want to post
again, please note whetehr this is a senior project and when it's due.
Also, the documentation in the "overview" isn't sufficient in and of
itself. You need to get in touch with the apps people at Hurst and ask
for more info. Look at what came with the motor in the box, too.
There's gotta be more documentation.

Good luck
Chris
 
C

Chris

Jan 1, 1970
0
Chris said:
OK, Josh. I'd guess we're getting somewhere (after a fashion). Here
are some initial impressions:

* Your Hurst motor has a two pin power connector (36VDC nominal) and a
digital connector. The motor docs aren't clear on any connection
between the two, but I can tell you for sure that, as with most
computer-controlled real-world electronics, you either make sure the
computer is powered up first, or do the design in such a way that you
won't have these problems. Since you've got "spam in a can" (set
board, motor), I'd recommend that you use a relay (driven by the SBC)
to turn on and off the 36V for motor power.

* I'd also be using one of the control signals (Run/Stop), but not
relying on this for safety or overriding motor control. Keep the
safety circuit separate from the uC as much as possible.

* You mention that you've got an enable signal tied directly to the +5V
of your SBC. That might not be a good idea. You might want to tie
that to an output instead.

* Another thing you might have concern for is the logic level of your
signals. I'm not sure from a cursory glance at the schematic about the
output voltage level of your signals, but the motor docs show that they
want TTL-compatible signals. I'd actually guess this is one of the
first places you should look for the source of your original issue. If
your outputs are 3.3V, and they're required to source current, they
might not be getting up to logic transition level. Not only that, but
usually motor control signals have pullups, so it's possible you might
be getting current from the Hurst motor logic through those pullups
(thus lighting the LEDs). If you can get away with open collector
signals, you'll immediately eliminate any possibility of a sneak path
for current getting into your 5V power supply from the motor control
pins.

* Since there's no indication on the motor docs that the motor control
signals are optoisolated from the motor voltage, you'd have to assume
they're not. But you also can't just assume the - of the 36V is the
same as the "Return" of the digital signal. You might want to arrange
to have the 36VDC supply floating (no GND connection or any direct
connection to the 36V power supply). Any connect between the 36V and
the logic common might be made inside the motor, but it won't have any
effect on ground loops that way.

I hope you've at least got a start on places to look. All of this
interface stuff is pretty basic once you know it. Sorry I'm not
familiar with your SBC -- this is all unfortunately very general
advice.

Two other things. If this is a school project and you want to post
again, please note whetehr this is a senior project and when it's due.
Also, the documentation in the "overview" isn't sufficient in and of
itself. You need to get in touch with the apps people at Hurst and ask
for more info. Look at what came with the motor in the box, too.
There's gotta be more documentation.

Good luck
Chris

By the way, I'd start with this for your p.s. hookup:

|
| Hurst
|Power Supply 1 Digital
| Connector
| .-------. .--------------. .-----.
| | | | | | |
| | | | | | |
| | | | o-------------o |
| | +12 o-----------o o-------------o |
| | | | o-------------o |
| | | | SBC o-------------o |
| | | | o-------------o |
| | | | | | |
| | | | | | |
| | COM o-----o-----o GND | .------o4 |
| | | | | | | | |
| | | | | | | | |
| '-------' | '--------------' | '-----'
| | | Power
| '---------------------------' Connector
| .-------. .-----.
| | +o----------------------------------------o1 |
| |+36VDC | | |
| | (Iso.)| | |
| | -o----------------------------------------o2 |
| | | '-----'
| | |
| '-------'
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

This looks as safe as anything else. Be sure both power supplies are
isolated, don't connect the - of the 36V supply to the - of the 12V
supply (at least to start with), and leave ground out of this for now.

Cheers
Chris
 
J

joshc

Jan 1, 1970
0
Chris said:
OK, Josh. I'd guess we're getting somewhere (after a fashion). Here
are some initial impressions:

* Your Hurst motor has a two pin power connector (36VDC nominal) and a
digital connector. The motor docs aren't clear on any connection
between the two, but I can tell you for sure that, as with most
computer-controlled real-world electronics, you either make sure the
computer is powered up first, or do the design in such a way that you
won't have these problems. Since you've got "spam in a can" (set
board, motor), I'd recommend that you use a relay (driven by the SBC)
to turn on and off the 36V for motor power.

Why does the computer have to be powered up first in most real-world
electronics? What electrical issue does this avoid?
* I'd also be using one of the control signals (Run/Stop), but not
relying on this for safety or overriding motor control. Keep the
safety circuit separate from the uC as much as possible.

* You mention that you've got an enable signal tied directly to the +5V
of your SBC. That might not be a good idea. You might want to tie
that to an output instead.

I have connected the run/stop signal on the motor to the 3.3 V output
of the power regulator on the evaluation board. Someone else at work
did this and I didn't think to try a 5 V output instead so I'll try
that tomorrow.
* Another thing you might have concern for is the logic level of your
signals. I'm not sure from a cursory glance at the schematic about the
output voltage level of your signals, but the motor docs show that they
want TTL-compatible signals. I'd actually guess this is one of the
first places you should look for the source of your original issue. If
your outputs are 3.3V, and they're required to source current, they
might not be getting up to logic transition level. Not only that, but
usually motor control signals have pullups, so it's possible you might
be getting current from the Hurst motor logic through those pullups
(thus lighting the LEDs). If you can get away with open collector
signals, you'll immediately eliminate any possibility of a sneak path
for current getting into your 5V power supply from the motor control
pins.

* Since there's no indication on the motor docs that the motor control
signals are optoisolated from the motor voltage, you'd have to assume
they're not. But you also can't just assume the - of the 36V is the
same as the "Return" of the digital signal. You might want to arrange
to have the 36VDC supply floating (no GND connection or any direct
connection to the 36V power supply). Any connect between the 36V and
the logic common might be made inside the motor, but it won't have any
effect on ground loops that way.

I hope you've at least got a start on places to look. All of this
interface stuff is pretty basic once you know it. Sorry I'm not
familiar with your SBC -- this is all unfortunately very general
advice.

Two other things. If this is a school project and you want to post
again, please note whetehr this is a senior project and when it's due.
Also, the documentation in the "overview" isn't sufficient in and of
itself. You need to get in touch with the apps people at Hurst and ask
for more info. Look at what came with the motor in the box, too.
There's gotta be more documentation.

Good luck
Chris

This is actually something I'm working on at work. Unfortunately we are
a small company and I don't have access to any real hardware experts.
Unfortunately I have no more documentation on the motor, but I will
call the company tomorrow to see what they say.

Here's a schematic of how I have been connecting my motor and EVB to
this point:

|
| Hurst
|Power Supply 1 Digital
| Connector
| .-------. .--------------. .-----.
| | | Evaluation Board | |
| | | | | | |
| | | | o-------------o5 |
| | +12 o-----------o o-------------o6 |
| | | | +3.3Vo-------------o9 |
| | | | PWM o-------------o11 |
| | | | | | |
| | | | | | |
| | | | | | |
| | COM o-----o-----o GND | .------o4 |
| | | | | | | | |
| | | | | | | | |
| '-------' | '--------------' | '-----'
| | | Power
| '-----------o---------------' Connector
| .-------. | .-----.
| | +o-----------------|----------------------o1 |
| |+36VDC | | | |
| | | | | |
| | -o-----------------o----------------------o2 |
| | | '-----'
| | |
| '-------'
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Thanks,

Josh
 
C

Chris

Jan 1, 1970
0
joshc said:
Why does the computer have to be powered up first in most real-world
electronics? What electrical issue does this avoid?


I have connected the run/stop signal on the motor to the 3.3 V output
of the power regulator on the evaluation board. Someone else at work
did this and I didn't think to try a 5 V output instead so I'll try
that tomorrow.


This is actually something I'm working on at work. Unfortunately we are
a small company and I don't have access to any real hardware experts.
Unfortunately I have no more documentation on the motor, but I will
call the company tomorrow to see what they say.

Here's a schematic of how I have been connecting my motor and EVB to
this point:

|
| Hurst
|Power Supply 1 Digital
| Connector
| .-------. .--------------. .-----.
| | | Evaluation Board | |
| | | | | | |
| | | | o-------------o5 |
| | +12 o-----------o o-------------o6 |
| | | | +3.3Vo-------------o9 |
| | | | PWM o-------------o11 |
| | | | | | |
| | | | | | |
| | | | | | |
| | COM o-----o-----o GND | .------o4 |
| | | | | | | | |
| | | | | | | | |
| '-------' | '--------------' | '-----'
| | | Power
| '-----------o---------------' Connector
| .-------. | .-----.
| | +o-----------------|----------------------o1 |
| |+36VDC | | | |
| | | | | |
| | -o-----------------o----------------------o2 |
| | | '-----'
| | |
| '-------'
|
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Thanks,

Josh

Hi, Josh. Nice to know this is a real problem instead of just a school
project.

As always, I rely on the product vendor for interface help. Glad
you're going to be talking to the Hurst people. Try to keep them from
talking you into the serial interface if possible -- that's just
locking in a mystery solution. Since you've gotten this far, you
should be able to do it, and they should be able to provide the docs
you need. It helps to tell them something about the potential future
volume of sales of your toy. If you let them know it's a one-off, they
might be a little more reluctant to help. (I hope you're reading
between the lines here ;-)

Looking at your diagram, I'd disconnect the jumper between the +36V
minus side and the +12V minus side. As long as the 36V supply is
floating, you should be OK.

Sneak current paths between SBC I/O pins and interface circuitry can be
a problem. On power-up, they can lead to the SBC gate latching up
(creating an SCR internally, which fries the chip). But even if it
doesn't latch up, this sneak current going into the uC can interfere
with the normal startup reset sequence internal to the uC. That can
mean the uC doesn't come up in a known state, which can wreak havoc
with your program. The uC chip is just not made to do that.

Good luck with your project, sir. Being the "one man gang" that gets
it done can be very satisfying. You may get out late, but you
frequently walk home with real job satisfaction.

Cheers
Chris
 
Top