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&#174; 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

Reply via email to