Skip to content

claudyus/kstepper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a stepper driver motor for linux kernel developed to be used
on a board with available gpios.

More info on use and ioctl interface see tthe code or:
	http://www.mignanti.eu/progetti/embd/daisy2

VERSION HISTORY
---------------
tag v0.5:
 * Fix some compile errors
 * Add the motor.py utils to manage the motors on user-space
 * Limits pins are optional

tag v0.4:
 * Reorganize the no-pwm version. Now it using a struct to mangle the data.
 * Update the ioctl to support syscall redefinition for v2.6.38+
 * Add limit support
 * The pwm version is not aligned anymore to the nopwm version (that will be
	the default until pwm api didn't goes upstream)

tag v0.3:
 * Added a version of the driver (stepper-nopwm.c) that emulate the funcition
	of Bill Gatliff's api.
 * On this tag you can found both version compatible with linux kernel v2.6.38
 * Reorder the ioctl value (see motor.h) this values can be consider realiable

tag v0.1:
 * This version of kstepper is featuring a stepper driver build on Bill Gatfill
	pwm api (http://lwn.net/Articles/303978/), this was implement for linux v2.6.35

CROSS-COMPILE
-------------
To cross-compile this driver you need a gcc-arm and configured kernel. Then
simple type:

make KERNELDIR=<path_to_kernel> CROSSCOMPILE=<path to ggc cross compiler>

This will generate stepper-nopwm.ko and stepper-drv.ko

EXAMPLE OF USAGE
----------------
Load the module on your board:
*********************************
# 3 motors without limits
# mot0 over D2 conf A, asse X
# mot1 over D2 conf B, asse Y
# mot2 over D3 conf A, asse Z

insmod stepper-nopwm.ko mot0=63,61,59 mot1=62,60,58 mot2=68,90,86
*********************************

Now we like to test that the motor operation.
Using motor.py we can simple issues some command:
*********************************
./motor.py 0 enable		#enable /dev/motor0
./motor.py 1 enable		#enable /dev/motor1

./motor.py 0 pwm_on		#active the pwm on motor0 w/o counting the steps
./motor.py 1 steps 1000	#set the number of steps that motor 1 should execute
./motor.py 1 start		#execute the previous operation
**********************************


DEVELOP
-------
Feel free to drop me a mail for bugs, suggestion, patch and general
improvement <c.mignanti@gmail.com>

About

Linux kernel stepper motor driver over gpio for arch with or without pwm

Resources

Stars

Watchers

Forks

Packages

No packages published