Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MC3479P and PIC

Status
Not open for further replies.

zhizhi16

New Member
Hi there I've got some problems driving my stepper motor with my pic16F877.

I've connected as mentioned in the mc34.. datasheet.

when i ran the pic and connected the 12V to the stepper motor it will not turn.. it has some noise too.. seems like turning but its not..

Any ideas?

PIC and MC are connected by the CLK(Port B0) and CCW/CW(Port B1).
I've supplied the Clk to the MC3479 chip using a delay and turning that bit high and low.

Have i done something wrong?

Please advise
 
A couple of things spring to mind:

1) Are the wires to the motor connected in the correct sequence?, but you would probably see it juddering.

2) Are you pulsing it slow enough?, if you pulse it too fast it won't move at all, just sit there and buzz.
 
Yeah, nigel, I give some parameters:

Typically, with a 12V stepper and about 100-200mA, you should run it at 100step/second as testing. But the fact that it can run upto 400 step/s. If you run it up to 4000step/s, it seems to be no torque on the motor shaft.

The slower you run your motor, the higher torque you will get.

The max torque is appeared as you apply 2 windings at HIGH.

To know the sequence of wires of a motor. The simplest way is measure the resistor of each winding. However, the problem will happen if the motor is unipolar one. You cannot know which 2 wires are a pair by measure the resistors. You may apply AC supply (use 6VAC in your case) to the motor, measure the AC voltages between the wires, you may know.
 
Nigel Goodwin said:
A couple of things spring to mind:

1) Are the wires to the motor connected in the correct sequence?, but you would probably see it juddering.

2) Are you pulsing it slow enough?, if you pulse it too fast it won't move at all, just sit there and buzz.

1.
Does the two pairs matter? Eg. Stepper has two pairs of wires, Pair A and Pair B.

If i put Pair A1 into Pin2, and Pair A2 into Pin3 of MC3479
or Pair A1 into Pin3, and Pair A2 into Pin2?

The way i found the pair was by measuring the resistance.. If there was a resistance.. then those two wires are considered a pair. The resistance measured is 31 Ohm. The Vm, supply that im giving is 17Volts.

2.
I had an LED hooked up to pin 7, the clk pin and i could see it flashing. so it should be slow enough.. and i believe im expecting very slow turns from the stepper motor.
 
zhizhi16 said:
Does the two pairs matter? Eg. Stepper has two pairs of wires, Pair A and Pair B.

Yes, they have to be connected exactly right, or it won't work - if you don't have the pinout details you will need to work them out. You can do this with a battery, connecting it to the windings in turn to find which sequence makes it rotate.
 
not sure if i got ur instructions right..

Stepper motor... Red, Blu, Yellow, White.

1.5AA battery

Q1.
I've connected Red <-- battery ---> Blue, Then i tried twisting/turning the shaft.. very very difficult to turn it..(this pair gives 31 ohms when a multi meter is used to test it)

Yellow <-- Battery --> White.. same thing.. very hard to turn.. (this pair gives 31 ohms when a multi meter is used to test it)

So it means that i got the correct two pairs right?

Q2.
PairRB and PairYW which one goes to pin23 and which one goes to pin1415
Does it matter?
 
No, you don't try to turn it manually, you only use the battery.

By connecting the battery to one pair of wires you should be able to make the motor step one position. You then need to find the connections to make it move one more step, in the same direction. Continue doing this until you get back to the original first step - then you know the sequence of connections to move the motor.

As it only has four wires, presumably it's a bi-polar motor?, is your driver suitable for that?.
 
Hi eGod...

I tried it.. the same thing.. only PairsYW and PairRB works..

Pairs YW turns if connected + -. then I had to turn it WY for + - and it turns back wards by 1 step.

same goes to PairRB.

If i connect WireY and R or Wire W and B, it won't turn at all..

Marcus
 
zhizhi16 said:
Hi eGod...

I tried it.. the same thing.. only PairsYW and PairRB works..

Pairs YW turns if connected + -. then I had to turn it WY for + - and it turns back wards by 1 step.

same goes to PairRB.

If i connect WireY and R or Wire W and B, it won't turn at all..

Marcus

You need to find the sequence that keeps it turning the same way, so it's probably something like:

YW
RB
WY
BR
 
As I once wrote in this forum that if we need to distinguish the 2 pair of wires of a unipolar stepping.

Firstly, we can easily find the centre wire(s) of the motor by measuring the resistors of each winding.

Secondary, we apply a AC voltage to the center wire and one of the 4 remains (in case of 5 wire motor, if it's 6, 2 of them are centre wires, if it's 8, 4 of them are center and we only take care of the 4 remains).

As you apply the AC voltage (if your motor is 12VDC, you should apply 6VAC to the 2 wires mentioned above).

You may measure the voltage between center wire and 3 other wires. You will see that, there are 2 voltages seem to be zero, and only one seem to be 6VAC as your power supply.

Then, the wires which produce zero volt are a pair. And the wire provide 6VAC and the first wire you chose (not the center wire) are a pair.

Yeah, it's all what you have to do to distinguish the 2 pair A and B of a stepping motor.

Why ?

I cannot explain here because my English is not good enough to explain, but it comes from the vibration of electromagnetic field inside the motor as you apply a VAC to a winding. It will make a resonance between the 2 wires of a winding.

I don't know if my explanation is clear, but you can do it, I'm sure. With 24VDC motor, you should apply 12VAC.

Goodluck
 
for the bipolar motor (2 phase motor), you can directly measure the resistor and find out the 2 pair.

After you have 2 pairs, you want to know the direction of the motor if you power it.

In case of unipolar,

1) Connect (+) to the centre wire
2) Move (-) from A1 to B1 to A2 to B2 .... (which wire you choose as 1 or 2 of a pair is not important, but you have to keep this sequence.
3) Look the direction of the motor.
4) If your motor turn clockwise, and you want to run your motor in clockwise, continue with this sequence

A1, B1, A2, B2, A1, B1, A2, B2....... and keep (+) at centre wire.

If you wanna turn it in ccw
A1, B2, A2, B1, A1, B2, A2, B1...... and keep (+) at centre wire.


In case of bipolar,

1) Connect (+) to RED, (-) to BLUE
2) Change (+) to WHITE and (-) to BLACK
3) Look the direction
4) if it's clockwise, and you wanna run your motor clockwise, continue with this sequence
(+) to RED, (-) to BLUE
(+) to WHITE, (-) to BLACK
(+) to BLUE, (-) to RED
(+) to BLACK, (-) to WHITE
 
Reading from data sheet clk diagram. L1, L2, L3, L4

L1, L2, L3, L4
----------------------
Phase A | H L H L
B | L H H L
C | L H L H
D | H L L H

and since the sequence is
(+) (-)
Y W <--- thus at this stage what will R B be(+ or -), how do i know?
R B
W Y
B R

(+) = High (H)
(-) = High (L)


my stepper motor still can step continuously I think i tried all the combinations. n(n-1) = 4(4-1) = 4(3) = 12 combinations...

any ideas?
 
Well, I don't know what you did, but it seems to be something unexpected

As you power YW, you have to leave BR free (no power). then apply power to BR and leave YW free. Continue the sequence as identically as nigel told you.

Your motor, I guess, is a bipolar motor.

If you drive your motor as you say, you will turn your motor at higher torque.

Because at a certain time, both 2 windings are powered.

In this case, your motor's winding will be powered like this

+ - + -

YWRB
WYRB
WYBR
YWBR

at the same time, you have to power 2 windings.

As you pwr the windings like up there sequence, you can see it if it turn clockwise or ccw. Then if you wanna reverse the direction, you only need to change the sequence to

YWBR
WYBR
WYRB
YWRB

it will work.
 
Note that, as you pwr the windings like that, the torque will be 1.41 times stronger than as nigel wrote. And usually, as people drive steppers for fullstep, they used to do so.

But if you wanna drive the motor half step you need to do this loop forever

YWRB
--RB
WYRB
WY--
WYBR
--BR
YWBR
YW--

-- is leaving relative pins free from power.
 
since im using the stepper motor controller chip. At any instance there would be two coils being powered up.

eg L1 L2 L3 L4
H L H L - Phase A

How do u supply no power? provide those wire with both L L right.. just checking.

And the sequence is all done by the chip. All i need to do is to plug the wires into the correct pins. L1,2,3,4 with RBYW.

The PIC only supplied the Clk to the stepper motor chip where the frequency is pretty slow.. i can see my attached led blinking.
The other pin that is connected to the pic is the CW/CCW.
 
Yes, I understand that your driver is a high level control chip, that is, you dont have to take care of the sequence pwred. The chip will automatically output the sequence as you make a pulse at the inputs.

How do u supply no power? provide those wire with both L L right.. just checking.

Yes, or HIGH - HIGH if you wanna. Because there will be no current flowing the winding then no magnetic field produced.

The PIC only supplied the Clk to the stepper motor chip where the frequency is pretty slow.. i can see my attached led blinking.

I don't know your MC34xx, but I think, frequently, a higher level driver should have another pin to control 2 level speed. If your MC doesn't have this pin, you have a limited speed running. But to control the speed, you change the frequency of input pulse. You may take a look to the datasheet and find the max speed that would be produced by your MC.
 
Could one of the reason why it still didn;t work because the current is not sufficient?

The motor is trying to turn but not turning
 
Did you test the amount of holding torque when the motor is stationary? That is, when there are no pulses going to the MC3479 chip and only power is being applied? Try to turn the motor shaft by hand. Is there a difference when there is no power being applied?

I notice you applied 17V to the motor when the maximum rating is 18V. That is very close to the limit. I have seen motor drivers die when you cross that limit even briefly. And it is very easy to cross it even if your supply voltage is lower than that because the motor generates some back emf. That is why there are protective diodes. You could have a busted driver.

You should test it with a pulse rate of like one pulse per second or slower to really see if you've got it wired right and to check if all of the transistors of the driver are OK.

What is the rating and specification of the motor? A motor model number would be most helpful.
 
Is there a difference when there is no power being applied?
>> YEP there is a difference

That is why there are protective diodes. You could have a busted driver.
>> Doubt so.. cause my batterys are almost 3/4 drained.. it should be less than 17.. Just tested it just now.. only 14V

You should test it with a pulse rate of like one pulse per second or slower >> Clk (LED) pulses aprox twice every second..

What is the rating and specification of the motor? A motor model number would be most helpful.
ASTAOSTN 17PS-C054-03
**broken link removed**

Looking that the stepper sequence diagram there seem to be no way.. im able to get the sequence
RB(HL) YB(--)
RB(--) YB(HL)
RB(LH) YB(--)
RB(--) YB(LH)

There is a diagram to interface the MCxxx chip to a micro
http://www.geocities.com/q_low_designs/image32.gif
Mine differs.
- I've put a 1k resister btw PH_A and +12V
- didn't have uF filter cap.
 
Well, The picture of your motor and the parameter, I cannot understand because it's in Germany. But I guest I got that it is a bipolar motor, 3.6 deg/step.

I cannot view your schemes, because it's firewalled by vietnamese network. May you send it to my email : doanhiep@swissinfo.org?

But because I and some technician here do not know what you did, and cannot see the problems happening to your motor as you powered it. So you follow these steps and tell us if you cannot make it clear at which step

1) Use the batteries 12VDC, apply to YW (+-) and see if there is a torque at the rotor? If yes, continue with RB (+-). If it's clear, continue to step 2

>> Your motor is good, it's not dead, because there are torques as you power the 2 windings.

2) Use the batteries 12VDC (don't use 17VDC) then apply (+-) as the sequence below:

YW
RB
WY
BR

If your motor turns, your motor works good. Why you have to do so is because as you pwr the motor by hand, you cannot run it too fast, and you will sure that your motor works well at slow speed at highest torque.

3) Do not connect your motor to your driver. Use 4 leds (2 red and 2 green) to test the outputs of your MC34xx. Note that you have to put 10K resister to protect the leds. Measure the output voltage, are they near 12VDC as pwr supply?

Test this, you will sure that your driver working. If it works, continue to step 4

4) Connect your motor as identically as you did test, set one pulse to your MC and keep this pulse HIGH, don't turn it off. Check if your motor has its torque. If it works, oki, you nearly make it clear. You don't have to take care of CW/CWW bit. if it turns, GOOD, you don't care bout the direction. We can change it later.

5) Set 2 pulse (1 second a pulse, each duty cycle of a pulse is 50%, which means ON in 500ms, OFF in 500ms, ON in 500ms, OFF in 500ms). If your motor turns 1 step, it works good. Try with 100 pulses (1 second period pulses). If your motor turns 1 revolution, it works good.

6) Reduce the frequency of those pulse to 100 pulses/second.

So, at which step you cannot make it through?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top