Modified stepgen.c

More
25 Feb 2010 08:11 #2055 by eslavko
Modified stepgen.c was created by eslavko
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
/* 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

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
loadrt stepgen step_type=15,15,15

to use something like
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

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.

Please Log in or Create an account to join the conversation.

More
26 Feb 2010 04:42 #2066 by cmorley
Replied by cmorley on topic Re:Modified stepgen.c
neat idea.
You need to talk to the developers on the developers mail list or irc.
Chris m

Please Log in or Create an account to join the conversation.

More
11 Dec 2013 15:18 #41500 by tiffany
Replied by tiffany on topic Modified stepgen.c
hello?

I want to find stepgen.c file, but I could find it by src/hal/components/stepgen.c

even I could not find src/hal
any other way ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum