Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
metron9
PostPosted: Sep 19, 2009 - 06:13 AM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Since I plan on building a CNC machine I remembered I had an old 5-Phase Vexta PK564-AA sitting around and i thought I would give a try to making a controller board.
The usual google searches gave me the links below but the sequence is not working.

What happens is the sequence that is in the various posts just dont work. What does work is this sequence
Code:
step1:
ldi temp,0b00011000
out portb,temp
ret
step2:
ldi temp,0b00001000
out portb,temp
ret
step3:
ldi temp,0b00001100
out portb,temp
ret
step4:
ldi temp,0b00000100
out portb,temp
ret
step5:
ldi temp,0b00000110
out portb,temp
ret
step6:
ldi temp,0b00000010
out portb,temp
ret
step7:
ldi temp,0b00000011
out portb,temp
ret
step8:
ldi temp,0b00000001
out portb,temp
ret
step9:
ldi temp,0b00010001
out portb,temp
ret
step10:
ldi temp,0b00010000
out portb,temp
ret


with the exception of the very last step. Instead of going to the next step it starts over at the first step position and I can't find any sense to how to get it to actually rotate all the way around.

The movie here http://www.siliconcoder.com/stepper1/stepper1.html
shows another unipolar motor I was playing with and those are no problem. The end of the movie is the Vexta stepping in the only sequence so far that I have been able to actually make work for 10 steps.

Anyone care to throw in a sequence I might try?

Tha actual motor is VEXTA PK564-AA
The wiring chart i have is attached
The method I am connecting is here http://dsaprojects.110mb.com/electronic ... _ctrl.html
I have tried this pattern from here ( I am using a micro not a parallel port) http://www.cs.uiowa.edu/~jones/step/software.html


steptab[0] = 13; { binary 01101 }
steptab[1] = 9; { binary 01001 }
steptab[2] = 11; { binary 01011 }
steptab[3] = 10; { binary 01010 }
steptab[4] = 26; { binary 11010 }
steptab[5] = 18; { binary 10010 }
steptab[6] = 22; { binary 10110 }
steptab[7] = 20; { binary 10100 }
steptab[8] = 21; { binary 10101 }
steptab[9] = 5; { binary 00101 }

Also this pattern from here http://www.cs.uiowa.edu/~jones/step/types.html
With a 5-phase motor, there are 10 steps per repeat in the stepping cycle, as shown below:

Terminal 1 +++-----+++++-----++
Terminal 2 --+++++-----+++++---
Terminal 3 +-----+++++-----++++
Terminal 4 +++++-----+++++-----
Terminal 5 ----+++++-----+++++- time--->>

The 5 wires i am connecting to positive voltage are red,yellow,purple,grey,green
The blue,white,brown,black,orange are connected to the fets.
A high signal connects the coil to ground as the above link to the schematic shows.
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Sep 19, 2009 - 09:35 AM
10k+ Postman


Joined: Mar 27, 2002
Posts: 21370
Location: Lund, Sweden

Quote:

Terminal 1 +++-----+++++-----++
Terminal 2 --+++++-----+++++---
Terminal 3 +-----+++++-----++++
Terminal 4 +++++-----+++++-----
Terminal 5 ----+++++-----+++++-

Easier to read if quoted as code:

Code:

Terminal 1 +++-----+++++-----++
Terminal 2 --+++++-----+++++---
Terminal 3 +-----+++++-----++++
Terminal 4 +++++-----+++++-----
Terminal 5 ----+++++-----+++++-


I'm no five-phase expert, but why are you energizing all windings at all times? Shouldn't there be some zeroes in that diagram?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Kartman
PostPosted: Sep 19, 2009 - 11:52 AM
10k+ Postman


Joined: Dec 30, 2004
Posts: 11106
Location: Melbourne,Australia

Quote:
Assume these declarations and values for control of a 5-phase motor, with an H-bridge on each of the 5 leads to the motor:


If you're only using a single ended driver, then you would expect to have problems.
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Sep 19, 2009 - 03:06 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 23462
Location: Orlando Florida

Yeah But... Professor Jones uses a single ended drive in a parallel port... Why do you want to use h-bridge again? More torque? I see you're idea... you turn on one coil, then the one cws from it, and it half steps in between the coils, then just the second coil... so there should be 10 positions. Energizing each winding by itself should give 5 steps of 72 deg each. So if it really 'halfsteps' between poles with 2 coils on, that scheme with 3 coils on wont do anything... the 2 outside coils cancel... will be the same as the single coil in the middle.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
metron9
PostPosted: Sep 20, 2009 - 03:08 AM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Quote:
I'm no five-phase expert, but why are you energizing all windings at all times? Shouldn't there be some zeroes in that diagram?


Each coil (coils 1..5) are connected at one end to positive and the other ends are connected to fets. the individual fets turn on with a "+" Logic high to the gate and turn off with a "-" logic Low to tha gate. There are no zeros ust on or off.

So basically it's 5 bits of information and that is a possible 31 patterns exclude 11111 and 00000 and you have 29 possible states. Unless their is a difference in the polarity of the individual coils. Does it make any difference to turn on a coil in the above picture A-Phase Blue positive and red ground or red positive and blue ground?
If not then with 29 possible states I intend to find the farthest move to the left and the farthest move to the right of this motor. If for example the numbers were 5 and 23 then moving from 5 to 23 should move one step in one direction and moving from 23 to 5 the other direction. Then there would be just 8 more to figure out to step from 5 up to 23 in 10 steps. I will attempt to measure the distance using a 10 inch circle attached to the motor shaft and mark the 10 steps.

Not being a numbers guy I think the possible combinations would be 25 bits but finding the maximum and minimum move of the shaft using 1 to 29 should be easy if I can set up a measuring device unless someone tells me the polarity of turning the coil on is different because then you have many more combinations to the puzzle.
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Sep 20, 2009 - 03:45 AM
10k+ Postman


Joined: Dec 30, 2004
Posts: 11106
Location: Melbourne,Australia

The sequence is dictated by the design of the unit. Effectively you have to energise the coils in order to drag the poles of the armature around. Polarity of the coils is important - one way you're attracting, the other you're repelling. When you're using a h-bridge drive, some coils are pushing, the others are pulling, using a single ended drive, you're just pulling. So, i'd say you'd use a 2-1-2-1.. sequence that is two coils on, then one coil on. The sequence would be:

00001
10001
10000
11000
01000
01100
00100
00110
00010
00011

If the stepper in question is a permanent magnet type, then the polarity will be important.
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 20, 2009 - 04:12 AM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Yes Yes Yes finally, i just finished with testing 5 steps 1,2,3,4,5 then I reversed the polarity on 1 and it went one additional step to the right , it's only 10pm now so by 2am i should have this licked.

That's right Kartman I was doing that but not doing polarity, Ahhh I see now the coil is wrapped on a bar and one end pushes and the other end pulls when current flows one way and opposit the other way. I guess the drawings of stepper motors I have looked at did not make this clear. I will have to take one apart I think to see it. i would think both polls are used to maximize power but perhaps not, i don't have a clear picture of how the magnets align with the coils and the bar that becomes tha magnet when current is pushed through.

I guess that means the circuit i posted above from the other guy that said he got it working is simply wrong because you can't reverse the current using this circuit. So I better work on that.
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Sep 20, 2009 - 08:33 AM
10k+ Postman


Joined: Mar 27, 2002
Posts: 21370
Location: Lund, Sweden

Quote:

Each coil (coils 1..5) are connected at one end to positive and the other ends are connected to fets. the individual fets turn on with a "+" Logic high to the gate and turn off with a "-" logic Low to tha gate. There are no zeros ust on or off.

OK. I'm tainted by having played with bipolar motors only (and as there are no center taps on your coils, I interpreted it as such or similar). In bipolars there are three possible states: Energized in one of two directions, or not energized.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
metron9
PostPosted: Sep 20, 2009 - 03:42 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Just fyi while i was searching for H bridges I found this new not available yet allegro product 8 AMP chip. http://www.allegromicro.com/en/Products ... ers/98618/

Looks like a stepper motors drivers dream chip for the do it yourself stepper boards and robot folks.

Yes Johan, I was tainted as well. Even the diagram I posted above shows the coils in a way that makes intuitive deduction that current would matter not clear. This link makes it very clear the arrangement of the electro magnets around the motors magnets and mentions current reversal for those motors that contain more electromagnets.

http://www.imagesco.com/articles/picstepper/02.html
Quote:
There are several types of stepper motors. 4-wire stepper motors contain only two electromagnets, however the operation is more complicated than those with three or four magnets, because the driving circuit must be able to reverse the current after each step. For our purposes, we will be using a 6-wire motor.
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 20, 2009 - 03:49 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

I am still not clear in my head the actual physical arrangement or the magnets and electro magnets in a 5-phase motor but from my experiments it looks like in the full step mode where you turn on phase a,b,c,d,e is the first half of a complete series of steps and then reversing the current starting again with phase a, and continuing with b,c,d,e would complete the series continuing with phase A using the original current flow to start the next series. I have some h bridge 1 amp chips i will connect and put up a complete diagram of how I made a 5-phase stepper work.

Thanks to all for responding, many times I post a question on this board and I compete with myself to come up with the answer before someone else does, it helps me focus as 2 or 10 minds are better than one for brainstorming.
 
 View user's profile Send private message  
Reply with quote Back to top
angelu
PostPosted: Sep 20, 2009 - 09:09 PM
Resident


Joined: May 28, 2006
Posts: 732
Location: Toronto, Canada

Quote:
So if it really 'halfsteps' between poles with 2 coils on, that scheme with 3 coils on wont do anything... the 2 outside coils cancel... will be the same as the single coil in the middle.

You are right, with the exception that the torque will be lower.

metron9, did you try that 20 steps sequence that Professor John talk about? I think it is what you have to do.
For tests, you can use that schematic with five transistors. Once you have the system work, make sure the shaft angle is what you expect in your software, you can switch to a better hardware approach.
If you include a resistor in series with those diodes in parallel with the coils, will allow you to increase the speed a little bit, because now the magnetic field will vanish faster when the coil is not powered. Just make sure your transistors have enough room to accommodate the extra voltage. Start with a lower resistor, test with the scope, for the maximum current, and see how far you can increase the resistor, and keeping the voltage spike in a safe area for the transistors.
And then you can switch to a full drive, either with full bridge, either with half bridges and a differential power supply. Since you will have at least two motors, I would invest in a differential power supply, instead to add a multitude of ICs.
As for full bridge approach, did you explore L6207 from ST ? This IC will accommodate two coils.
George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
metron9
PostPosted: Sep 21, 2009 - 03:44 AM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Wow a resistor in series with the diode, that is cool.
Simulation
http://www.siliconcoder.com/kickback/kickback.html

I guess with just a diode you get current flowing in reverse and it looks like with a resistor you just get rid of a high voltage spike and then the current stops dead, is that the theory?

Now how do you go about selecting a resistor value?
The higher the value the higher the kickback voltage the transistors have to be able to carry?

nice chip, I have added it to my next digikey order, amazing how much they pack in that thing, current control, overheating safety , everything you need, very cool.
 
 View user's profile Send private message  
Reply with quote Back to top
angelu
PostPosted: Sep 21, 2009 - 04:47 AM
Resident


Joined: May 28, 2006
Posts: 732
Location: Toronto, Canada

Your motor is 0.75A rated. If you keep this current, and do not exceed it, and you have a margin of 20V for your transistor, the formula is simple: R = 20/0.75 = 27ohm. Make sure the transistor can handle the power supply voltage plus this '20V'. 20V is just an example. If you can go higher, the faster your motor can go.
Finally you should get to the full bridge, but this is a cheap solution to improve your experiment.
George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
metron9
PostPosted: Sep 23, 2009 - 08:11 AM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

I tested the H-bridge connection on the 5-phase motor. One revolution is 1000 steps using this code. basically going around clockwise you have 5 coils A,B,C,D,E The Hbridges are connected 1Y,2Y to coil A and so on up to the third Hbridge where its 1Y,2Y are connected to coil E.

Turning on 3 coils A,B,C is where step 1 starts. Then A goes OFF in step 2 and C goes on in step 3. Step 4 turns off B and step 5 turns on D when Coil A comes around the current is reversed for the last 10 half steps so there are 20 half steps in this code.
Code:
Main:
cpi      movit,1
brne   main
clr      movit

rcall    stepit
inc      stepnow
cpi    stepnow,21
brne    main
ldi    stepnow,1
rjmp    Main



;' -------------------------------------------------------------------------
;' Subroutines
;' -------------------------------------------------------------------------
stepit:

cpi      stepnow,1
breq    step1
cpi    stepnow,2
breq   step2
cpi      stepnow,3
breq   step3
cpi      stepnow,4
breq    step4
cpi    stepnow,5
breq   step5
cpi      stepnow,6
breq   step6
cpi      stepnow,7
breq    step7
cpi    stepnow,8
breq   step8
cpi      stepnow,9
breq   step9
cpi      stepnow,10
breq    step10
cpi      stepnow,11
breq    step11
cpi    stepnow,12
breq   step12
cpi      stepnow,13
breq   step13
cpi      stepnow,14
breq    step14
cpi    stepnow,15
breq   step15
cpi      stepnow,16
breq   step16
cpi      stepnow,17
breq    step17
cpi    stepnow,18
breq   step18
cpi      stepnow,19
breq   step19
cpi      stepnow,20
breq    step20
error:
ret

step1:
sbi   portb,4
ret
step2:
cbi   portb,0
ret
step3:
sbi portc,0
ret
step4:
cbi portb,2
ret
step5:
sbi portc,2
ret
step6:
cbi portb,4
ret
step7:
sbi portb,1
ret
step8:
cbi portc,0
ret
step9:
sbi portb,3
ret
step10:
cbi portc,2
ret
step11:
sbi portb,5
ret
step12:
cbi portb,1
ret
step13:
sbi portc,1
ret
step14:
cbi portb,3
ret
step15:
sbi portc,3
ret
step16:
cbi portb,5
ret
step17:
sbi portb,0
ret
step18:
cbi portc,1
ret
step19:
sbi portb,2
ret
step20:
cbi portc,3
dec data
brne dataok
xxx:
ldi data,50
sbic pinc,4
rjmp xxx
dataok:
ret


Works very nice. I did not have the patience to use the resistors in series with the diodes and i hope i did the diodes correctly. Two diodes per wire GND----->diode----coil wire--->diode---Positive
From this i found with google.
http://design.stanford.edu/Courses/me11 ... Module.pdf
Quote:
 
 View user's profile Send private message  
Reply with quote Back to top
Kartman
PostPosted: Sep 23, 2009 - 08:23 AM
10k+ Postman


Joined: Dec 30, 2004
Posts: 11106
Location: Melbourne,Australia

Those protoboards are really not suited to circuits with lots of current! I see there is current protection on the battery... not. Looks like a fire about to happen - the battery has more than enough current to make those wires red hot so be aware and careful.
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 23, 2009 - 03:32 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Yes, you are correct. I use a bench supply while designing so I can see the current and I also use a 2 amp ptc fuse inline with the battery. I was just putting everything on a board I could carry to my work so I could show a friend that i actually got it working. I for sure don't leave it connected, it's just for initial design.
 
 View user's profile Send private message  
Reply with quote Back to top
KillerSpud
PostPosted: Sep 23, 2009 - 03:51 PM
Hangaround


Joined: Sep 20, 2008
Posts: 133


I have not seen a 5 poll motor before, but it seems that this gives the user an huge amount of flexibility in both torque and precision.

As with any stepper, I assume it will do the standard full step, this gives the least precision.

Also, the standard Half Step should work just as well, giving double the precision.

However, if the coils are energized in a 'star' pattern (similar to tightening the lug nuts on a truck) this would give you a one third step, giving you triple the precision!

Also, if you go through the effort to utilize a DAC on each pole and step through sine waves (each precisely out of phase) , you could have a huge amount of precision without sacrificing much torque along the way.

I may have to get one of these to play with...

_________________
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-- Douglas Adams
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 23, 2009 - 04:06 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Question for angelu on the resistors and diodes.

First, is there a better way to manage the kickback without using 20 diodes
Does the same rule apply using resistors on all 20 of these diodes? I plan to do a speed test with and without the resistors inline with the diodes but I have to get some 10 watt 16 ohm resistors to run on 12 volts.

My next step is to figure out how to chop the power with PWM and manage the current without resistors just to see if I can do it.
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 23, 2009 - 04:11 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Killerspud Yes, I want to do full and micro step variations as well. I think I bought this at MPJA for 6 bucks with a bunch of other stuff and this motor has been sitting in a drawer for 2 years. Amazing how many wires it takes. I bought a really nice wire stripper though so that is no longer a problem.
 
 View user's profile Send private message  
Reply with quote Back to top
angelu
PostPosted: Sep 24, 2009 - 01:26 AM
Resident


Joined: May 28, 2006
Posts: 732
Location: Toronto, Canada

Ok, now I know how your motor looks like and why your first approach didn't work. I thought at first you mixed some wires on the motor, and the motor is a 5/2 stator/rotor pole pairs ratio, but I notice it is an 5/1 one.

In this case you should use a star connection as someone suggested, and you would need only five half bridges, and not five full bridges. But you need to deal with sin pwm if you want to get rid of the resitors and don't want to have a separate constant current source.

Regarding your question about the resistor in series with the diodes, it is no longer the case, since your resistor is always in series with the winding.
In the data sheet is shown the IC has the diodes integrated, but later in an example there are shown external diodes. I would use a more powerfull IC. When you accelerate or decelerate you can exceed the nominal current.

If you notice, after one coil is unpowered, it is shorted by both full bridges being at the same polarity. If you want to get rid of the resistor and use pwm, you will face the problem not knowing how to drive the bridges, because you do not have the idle state. At low speed it is ok to keep both bridges at the same potential, but when you increase the speed, you will need to power the coil in a reverse, to speed the magnetic field decrease. But if you keep too long this reversed voltage, the current will start to rise in a reverse way, and you don't want.
And again, the best way is to drive it with a sinusoidal current.

George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
metron9
PostPosted: Sep 24, 2009 - 06:58 AM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

I gave that reverse plolarity a try from 1us to 255 us, around 150us it was too much but at lower times it did not seem to make a difference.

The maximum speed with good power now is 2880 steps per second, that's about 166 RPM. I don't know if that is good or bad as I don't know how fast it should be able to go since I have only worked with 200 step bipolars in full step mode.

In the application I planned to use it for is a peristaltic pump using a constant speed. Since when the motor is running 8 Volts works good but when the motor is stopped then 8 Volts is to high and the motor uses too much current.
I thought i would try switching a resistor in the ground line using two fets, one with a resistor and one without. Motor running the fet connects directly to ground, with the motor stopped the other fet turns on that has a resistor in series. I thought about using a variable regulator to turn up the voltage when the motor is running and lower the voltage when it is stopped. Thank's for the reply I keep poking around long enough I may learn something.
 
 View user's profile Send private message  
Reply with quote Back to top
KillerSpud
PostPosted: Sep 24, 2009 - 02:10 PM
Hangaround


Joined: Sep 20, 2008
Posts: 133


Quote:
I thought i would try switching a resistor in the ground line using two fets, one with a resistor and one without. Motor running the fet connects directly to ground, with the motor stopped the other fet turns on that has a resistor in series. I thought about using a variable regulator to turn up the voltage when the motor is running and lower the voltage when it is stopped. Thank's for the reply I keep poking around long enough I may learn something.


Try switching from half steps to full steps, and only energize one coil at a time. This will require some clever code, but I figure it should half the amount of current that is used.

_________________
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-- Douglas Adams
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 24, 2009 - 02:25 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

Hi KillerSpud. The current I am talking about is the difference between the motor not moving and higher speeds. When you increase the switching speed you need higher voltage to push the current faster into the coils since the time the coil is energized is shorter.

For example the motor with 2 or three coils on may draw over 2 amps when stopped and drop to just 350mA when running at 2880 steps per second. Typically current is controlled throughout the speed cycle. Running at just one speed I should be able to simply switch out a resistor to make it simple.

I realized all I need is one fet to ground andthen have a parallel resistor to ground. Switch the fet on when running and turn it off when stopped so the current will then flow through the resistor.
 
 View user's profile Send private message  
Reply with quote Back to top
metron9
PostPosted: Sep 24, 2009 - 02:34 PM
Resident


Joined: Aug 25, 2005
Posts: 911
Location: U.S.A

JohanEkdahl, I finally got a response from orental motors. They emailed a pdf of the 5 phase Pentagon connection. (attached) The arrangement of the coils in this pdf do not match the wire colors in the original attachment in this thread but it can be connected this way. Then you get your + and - and 0 like you pointed out in your post.

I don't think the HBridges i have will do this though as they only have 2 states + and -.
 
 View user's profile Send private message  
Reply with quote Back to top
KillerSpud
PostPosted: Sep 28, 2009 - 04:06 PM
Hangaround


Joined: Sep 20, 2008
Posts: 133


I just looked at that data sheet, and I can hardly imagine a more difficult design to work with! It requires TWO AND A HALF H bridges! (That's TEN FETs!)

I just don't quite understand power systems sometimes.

_________________
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools."
-- Douglas Adams
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits