Mario, Can you provide some references for the current control of the phase coils? I think that would interesting for reference...
EBo -- "Mario." <[email protected]> said: > --0016e6d77ed3d8b6420480862da9 > Content-Type: text/plain; charset=UTF-8 > > Dave: I already have the analog output driver made and it makes a real > difference. The motor is quiet. At 2000usteps/revolution, when spinning > Shinano Kenshi SST83D1C011 motor slowly, you can see every movement clearly. > I reconnected the windings inside to be only bipolar, to get lower losses > and higher maximum RPM. > > The output stage is boosted 3A amplifier, acting as a voltage to current > converter. The A/D conversion is done with a Linkwitz filter. The > preprocessing and megahertz capable quadrature inputs is done by PIC18F4431. > The firmware uses table reading in the interrupt loop. All written in > assembly. There is another function: accelerating or decelerating to > operating speed in exactly 1 revolution. The acceleration is precalculated > to be extremely smooth. > > Driving stepper motors with PWM is the second worst idea in precision motors > I have seen. > > EVERY TWITCH OF THE PWN PULSE GETS TRANSPORTED TO THE MECHANICS, making the > microstepping less accurate than intended! > > In other words: microstepping is meaningful ONLY when you can supply > separately and precisely controlled currents to the coils, AND al low speeds > too. > > But then you can separate a step into 100 microsteps, just like anybody else > on the optics industry. Steps as small as 8 nanometers are used :) > > Mario. > > On Fri, Feb 26, 2010 at 8:07 PM, Slavko Kocjancic <[email protected]> wrote: > > > I hate step/dir as it make a lot of overhead if software stepgen is > > used. (set new direction, wait proper time, make step signal active, > > wait again, relase step signal ..... wait, .... wait) > > For that reason the best is 2 phase (quadrature) just change and forget. > > > > Let's stay on original problem/feature. Is it possible? (well the answer > > is yes but I'm not smart enought to do that) > > > > > > > Once you get much beyond 10 microsteps you are pretty much wasting > > > your time with more. There is no increase in actual mechanical > > > resolution. > > > > > > The trick is that step and direction is a "standard" and unless you > > > are making your own drivers reinventing the wheel is probably not very > > > useful. > > > > > > I remember Gray code well. I had it on some exams in college and we > > > weren't using steam engines at the time..... We were using IBM > > > punch cards to "write" software though.. ;-) > > > > > > Dave > > > > > > On 2/26/2010 11:24 AM, Mario. wrote: > > >> I had a similar idea long time ago, and I implemented it in the file, > > >> but never used. Not yet. > > >> > > >> First of all, the output encoding should use GRAY CODE format! > > >> In other words, quadrature output in 2-bit gray code. Between any two > > >> adjacent positions, there is only SINGLE bit change. > > >> Also, gray codes are used on absolute position linear and rotary > > >> encoders, which allowed useful automation back in the steam engine > > >> era ;-) > > >> The advantage of that system would be - in the era of analog > > >> microstepping - that you could change the stepper output by more than > > >> one step at a time. > > >> that would allow for high RPM of the motor, while still attaining the > > >> microstepped precision. It does consume a LOT of output pins still - > > >> but has very low latency. > > >> > > >> The theory behind that is the output code is directly translated to A > > >> and B phase currents by the motor controller from a lookup table. > > >> The disadvantage is that even for a nothing-special 32-steps per > > >> electrical period, you need already 5 pins. That is only 8x better > > >> resolution than bipolar full step (which it improves by using sine > > >> and cosine waveforms for A and B phase.) > > >> > > >> I used 32, 40, 80, 160 steps per electrical phase with great deal of > > >> success, but since the EMC2 can give output of only about 50k changes > > >> per second, that results in very slow maximum RPM. > > >> (common stepper motors have 200 steps per revolution, that is 50 > > >> electrical periods per revolution, 160*50 is 8000 per revolution.) > > >> You get the idea... > > >> > > >> Mario. > > >> > > >> On Fri, Feb 26, 2010 at 7:27 AM, Slavko Kocjancic <[email protected] > > >> <mailto:[email protected]>> wrote: > > >> > > >> Hello... > > >> > > >> I'm already post that question/wish on the linuxcnc forum and I got > > >> response that here is the right place to ask that. Se here is copy. > > >> > > >> > > >> > > ;-------------------------------------------------------------------------- > > >> > > >> Hello... > > >> > > >> I'm have homemade stepper driver and have phase inputs. The input to > > >> driver is 3 bit wide and is simply binary count from 0 to 7. After > > >> thinkering I modified stepgen.c and append my sequence to lokup > > >> table so > > >> modified part of stepgen.c is now like > > >> [code] > > >> /* lookup tables for stepping types 2 and higher - phase A is the > > >> LSB */ > > >> > > >> static const unsigned char master_lut[][10] = { > > >> {1, 3, 2, 0, 0, 0, 0, 0, 0, 0}, /* type 2: Quadrature */ > > >> {1, 2, 4, 0, 0, 0, 0, 0, 0, 0}, /* type 3: Three Wire */ > > >> {1, 3, 2, 6, 4, 5, 0, 0, 0, 0}, /* type 4: Three Wire Half > > >> Step */ > > >> {1, 2, 4, 8, 0, 0, 0, 0, 0, 0}, /* 5: Unipolar Full Step 1 */ > > >> {3, 6, 12, 9, 0, 0, 0, 0, 0, 0}, /* 6: Unipoler Full Step 2 */ > > >> {1, 7, 14, 8, 0, 0, 0, 0, 0, 0}, /* 7: Bipolar Full Step 1 */ > > >> {5, 6, 10, 9, 0, 0, 0, 0, 0, 0}, /* 8: Bipoler Full Step 2 */ > > >> {1, 3, 2, 6, 4, 12, 8, 9, 0, 0}, /* 9: Unipolar Half Step */ > > >> {1, 5, 7, 6, 14, 10, 8, 9, 0, 0}, /* 10: Bipolar Half Step */ > > >> {1, 2, 4, 8, 16, 0, 0, 0, 0, 0}, /* 11: Five Wire Unipolar */ > > >> {3, 6, 12, 24, 17, 0, 0, 0, 0, 0}, /* 12: Five Wire Wave */ > > >> {1, 3, 2, 6, 4, 12, 8, 24, 16, 17}, /* 13: Five Wire > > >> Uni Half */ > > >> {3, 7, 6, 14, 12, 28, 24, 25, 17, 19}, /* 14: Five Wire > > >> Wave Half */ > > >> {1, 2, 3, 4, 5, 6, 7, 0, 0, 0} /* 15: CAA MODE */ > > >> }; > > >> > > >> static const unsigned char cycle_len_lut[] = > > >> { 4, 3, 6, 4, 4, 4, 4, 8, 8, 5, 5, 10, 10, 8 }; > > >> > > >> static const unsigned char num_phases_lut[] = > > >> { 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 3, }; > > >> > > >> #define MAX_STEP_TYPE 15 > > >> > > >> [/code] > > >> > > >> Now I have no clue how to update that this to be included in next > > >> relase > > >> (I don't want to recompile each relase to work with my driver) > > >> > > >> I have better idea for other's too. > > >> Maybe is possible to make step_type 15 custom. So when I startup > > >> stepgen > > >> with > > >> [code] > > >> loadrt stepgen step_type=15,15,15 > > >> [/code] > > >> > > >> to use something like > > >> > > >> [code] > > >> loadrt stepgen step_type=15,15,15 step_phases=3 step_cycle_len=8 > > >> step_phase_table 1,2,3,4,5,6,7,0 > > >> [/code] > > >> > > >> In this way all other phase sequences can be supported. > > >> I'm just not a C programmer to do that. > > >> > > >> Is there some herro to do that?!? > > >> > > >> > > >> Thanks > > >> Slavko. > > >> > > > > > > > > ------------------------------------------------------------------------------ > > Download Intel® Parallel Studio Eval > > Try the new software tools for yourself. Speed compiling, find bugs > > proactively, and fine-tune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > Emc-developers mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/emc-developers > > > > --0016e6d77ed3d8b6420480862da9 > Content-Type: text/html; charset=UTF-8 > Content-Transfer-Encoding: quoted-printable > > =C2=A0Dave: I already have the analog output driver made and it makes a rea= > l difference. The motor is quiet. At 2000usteps/revolution, when spinning S= > hinano Kenshi SST83D1C011 motor slowly, you can see every movement clearly.= > I reconnected the windings inside to be only bipolar, to get lower losses = > and higher maximum RPM.<br> > <br>The output stage is boosted 3A amplifier, acting as a voltage to curren= > t converter. The A/D conversion is done with a Linkwitz filter. The preproc= > essing and megahertz capable quadrature inputs is done by PIC18F4431. The f= > irmware uses table reading in the interrupt loop. All written in assembly. = > There is another function: accelerating or decelerating to operating speed = > in exactly 1 revolution. The acceleration is precalculated to be extremely = > smooth.<br> > <br>Driving stepper motors with PWM is the second worst idea in precision m= > otors I have seen.<br><br>EVERY TWITCH OF THE PWN PULSE GETS TRANSPORTED TO= > THE MECHANICS, making the microstepping less accurate than intended!<br> > <br>In other words: microstepping is meaningful ONLY when you can supply se= > parately and precisely controlled currents to the coils, AND al low speeds = > too.<br><br>But then you can separate a step into 100 microsteps, just like= > anybody else on the optics industry. Steps as small as 8 nanometers are us= > ed :)<br> > <br>Mario.<br><br><div class=3D"gmail_quote">On Fri, Feb 26, 2010 at 8:07 P= > M, Slavko Kocjancic <span dir=3D"ltr"><<a href=3D"mailto:[email protected]= > om">[email protected]</a>></span> wrote:<br><blockquote class=3D"gmail_q= > uote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0= > pt 0.8ex; padding-left: 1ex;"> > I hate step/dir as it make a lot of overhead if software stepgen is<br> > used. (set new direction, wait proper time, make step signal active,<br> > wait again, relase step signal ..... wait, .... wait)<br> > For that reason the best is 2 phase (quadrature) just change and forget.<br= > > > <br> > Let's stay on original problem/feature. Is it possible? (well the answe= > r<br> > is yes but I'm not smart enought to do that)<br> > <div><div></div><div class=3D"h5"><br> > <br> > > =C2=A0Once you get much beyond 10 microsteps you are pretty much wasti= > ng<br> > > your time with more. =C2=A0 There is no increase in actual mechanical<= > br> > > resolution.<br> > ><br> > > The trick is that step and direction is a "standard" and unl= > ess you<br> > > are making your own drivers reinventing the wheel is probably not very= > <br> > > useful.<br> > ><br> > > I remember Gray code well. =C2=A0 I had it on some exams in college an= > d we<br> > > weren't using steam engines at the time..... =C2=A0 =C2=A0We were = > using IBM<br> > > punch cards to "write" software though.. =C2=A0 ;-)<br> > ><br> > > Dave<br> > ><br> > > On 2/26/2010 11:24 AM, Mario. wrote:<br> > >> I had a similar idea long time ago, and I implemented it in the fi= > le,<br> > >> but never used. Not yet.<br> > >><br> > >> First of all, the output encoding should use GRAY CODE format!<br> > >> In other words, quadrature output in 2-bit gray code. Between any = > two<br> > >> adjacent positions, there is only SINGLE bit change.<br> > >> Also, gray codes are used on absolute position linear and rotary<b= > r> > >> encoders, which allowed useful automation back in the steam engine= > <br> > >> era ;-)<br> > >> The advantage of that system would be - in the era of analog<br> > >> microstepping - that you could change the stepper output by more t= > han<br> > >> one step at a time.<br> > >> that would allow for high RPM of the motor, while still attaining = > the<br> > >> microstepped precision. It does consume a LOT of output pins still= > -<br> > >> but has very low latency.<br> > >><br> > >> The theory behind that is the output code is directly translated t= > o A<br> > >> and B phase currents by the motor controller from a lookup table.<= > br> > >> The disadvantage is that even for a nothing-special 32-steps per<b= > r> > >> electrical period, you need already 5 pins. That is only 8x better= > <br> > >> resolution than bipolar full step (which it improves by using sine= > <br> > >> and cosine waveforms for A and B phase.)<br> > >><br> > >> I used 32, 40, 80, 160 steps per electrical phase with great deal = > of<br> > >> success, but since the EMC2 can give output of only about 50k chan= > ges<br> > >> per second, that results in very slow maximum RPM.<br> > >> (common stepper motors have 200 steps per revolution, that is 50<b= > r> > >> electrical periods per revolution, 160*50 is 8000 per revolution.)= > <br> > >> You get the idea...<br> > >><br> > >> Mario.<br> > >><br> > >> On Fri, Feb 26, 2010 at 7:27 AM, Slavko Kocjancic <<a href=3D"m= > ailto:[email protected]">[email protected]</a><br> > </div></div><div><div></div><div class=3D"h5">>> <mailto:<a href= > =3D"mailto:[email protected]">[email protected]</a>>> wrote:<br> > >><br> > >> =C2=A0 =C2=A0 Hello...<br> > >><br> > >> =C2=A0 =C2=A0 I'm already post that question/wish on the linux= > cnc forum and I got<br> > >> =C2=A0 =C2=A0 response that here is the right place to ask that. S= > e here is copy.<br> > >><br> > >><br> > >> =C2=A0 =C2=A0 ;---------------------------------------------------= > -----------------------<br> > >><br> > >> =C2=A0 =C2=A0 Hello...<br> > >><br> > >> =C2=A0 =C2=A0 I'm have homemade stepper driver and have phase = > inputs. The input to<br> > >> =C2=A0 =C2=A0 driver is 3 bit wide and is simply binary count from= > 0 to 7. After<br> > >> =C2=A0 =C2=A0 thinkering I modified stepgen.c and append my sequen= > ce to lokup<br> > >> =C2=A0 =C2=A0 table so<br> > >> =C2=A0 =C2=A0 modified part of stepgen.c is now like<br> > >> =C2=A0 =C2=A0 [code]<br> > >> =C2=A0 =C2=A0 /* lookup tables for stepping types 2 and higher - p= > hase A is the<br> > >> =C2=A0 =C2=A0 LSB */<br> > >><br> > >> =C2=A0 =C2=A0 static const unsigned char master_lut[][10] =3D {<br= > > > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 3, 2, 0, 0, 0, 0, 0, 0, 0}, =C2=A0= > =C2=A0/* type 2: Quadrature */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 2, 4, 0, 0, 0, 0, 0, 0, 0}, =C2=A0= > =C2=A0/* type 3: Three Wire */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 3, 2, 6, 4, 5, 0, 0, 0, 0}, =C2=A0= > =C2=A0/* type 4: Three Wire Half<br> > >> =C2=A0 =C2=A0 Step */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 2, 4, 8, 0, 0, 0, 0, 0, 0}, =C2=A0= > =C2=A0/* 5: Unipolar Full Step 1 */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {3, 6, 12, 9, 0, 0, 0, 0, 0, 0}, =C2= > =A0 /* 6: Unipoler Full Step 2 */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 7, 14, 8, 0, 0, 0, 0, 0, 0}, =C2= > =A0 /* 7: Bipolar Full Step 1 */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {5, 6, 10, 9, 0, 0, 0, 0, 0, 0}, =C2= > =A0 /* 8: Bipoler Full Step 2 */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 3, 2, 6, 4, 12, 8, 9, 0, 0}, =C2= > =A0 /* 9: Unipolar Half Step */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 5, 7, 6, 14, 10, 8, 9, 0, 0}, =C2= > =A0/* 10: Bipolar Half Step */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 2, 4, 8, 16, 0, 0, 0, 0, 0}, =C2= > =A0 /* 11: Five Wire Unipolar */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {3, 6, 12, 24, 17, 0, 0, 0, 0, 0}, /* = > 12: Five Wire Wave */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 3, 2, 6, 4, 12, 8, 24, 16, 17}, = > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* 13: Five Wire<br> > >> =C2=A0 =C2=A0 Uni Half */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {3, 7, 6, 14, 12, 28, 24, 25, 17, 19},= > =C2=A0 =C2=A0 /* 14: Five Wire<br> > >> =C2=A0 =C2=A0 Wave Half */<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {1, 2, 3, 4, 5, 6, 7, 0, 0, 0} =C2=A0 = > =C2=A0 /* 15: CAA MODE */<br> > >> =C2=A0 =C2=A0 };<br> > >><br> > >> =C2=A0 =C2=A0 static const unsigned char cycle_len_lut[] =3D<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 { 4, 3, 6, 4, 4, 4, 4, 8, 8, 5, 5, 10,= > 10, 8 };<br> > >><br> > >> =C2=A0 =C2=A0 static const unsigned char num_phases_lut[] =3D<br> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 { 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, = > 5, 3, };<br> > >><br> > >> =C2=A0 =C2=A0 #define MAX_STEP_TYPE 15<br> > >><br> > >> =C2=A0 =C2=A0 [/code]<br> > >><br> > >> =C2=A0 =C2=A0 Now I have no clue how to update that this to be inc= > luded in next<br> > >> =C2=A0 =C2=A0 relase<br> > >> =C2=A0 =C2=A0 (I don't want to recompile each relase to work w= > ith my driver)<br> > >><br> > >> =C2=A0 =C2=A0 I have better idea for other's too.<br> > >> =C2=A0 =C2=A0 Maybe is possible to make step_type 15 custom. So wh= > en I startup<br> > >> =C2=A0 =C2=A0 stepgen<br> > >> =C2=A0 =C2=A0 with<br> > >> =C2=A0 =C2=A0 [code]<br> > >> =C2=A0 =C2=A0 loadrt stepgen step_type=3D15,15,15<br> > >> =C2=A0 =C2=A0 [/code]<br> > >><br> > >> =C2=A0 =C2=A0 to use something like<br> > >><br> > >> =C2=A0 =C2=A0 [code]<br> > >> =C2=A0 =C2=A0 loadrt stepgen step_type=3D15,15,15 step_phases=3D3 = > step_cycle_len=3D8<br> > >> =C2=A0 =C2=A0 step_phase_table 1,2,3,4,5,6,7,0<br> > >> =C2=A0 =C2=A0 [/code]<br> > >><br> > >> =C2=A0 =C2=A0 In this way all other phase sequences can be support= > ed.<br> > >> =C2=A0 =C2=A0 I'm just not a C programmer to do that.<br> > >><br> > >> =C2=A0 =C2=A0 Is there some herro to do that?!?<br> > >><br> > >><br> > >> =C2=A0 =C2=A0 Thanks<br> > >> =C2=A0 =C2=A0 Slavko.<br> > >><br> > <br> > <br> > ---------------------------------------------------------------------------= > ---<br> > Download Intel&#174; Parallel Studio Eval<br> > Try the new software tools for yourself. Speed compiling, find bugs<br> > proactively, and fine-tune applications for parallel performance.<br> > See why Intel Parallel Studio got high marks during beta.<br> > <a href=3D"http://p.sf.net/sfu/intel-sw-dev" target=3D"_blank">http://p.sf.= > net/sfu/intel-sw-dev</a><br> > _______________________________________________<br> > Emc-developers mailing list<br> > <a href=3D"mailto:[email protected]">emc-develop...@list= > s.sourceforge.net</a><br> > <a href=3D"https://lists.sourceforge.net/lists/listinfo/emc-developers" tar= > get=3D"_blank">https://lists.sourceforge.net/lists/listinfo/emc-developers<= > /a><br> > </div></div></blockquote></div><br> > > --0016e6d77ed3d8b6420480862da9-- > > -- ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
