Control Stepper motor by DAQ card in RT-Linux, Linux and Windows environment

A Data AcQuisition (DAQ, PCL-812PG) card is used as a hardware interface. Basically it interfaces between the signal and a PC. The pulses send from the PC goes to the driver circuit through daughter board connected to DAQ card. There are 16 input (higher 8 pins and lower 8 pins)  and 16 output pins in the daughter board. In this case we used first 4 output pins of  daughter board for controlling stepper motor.

Switch to super user

 $ sudo su

For RT-Linux (real time linux), Download the zip file and extract that              Click here from downloading the code

Enable RT-Linux mode

# rtlinux start

Compile the code

# make -f rtl.mk steppermotor.o

Execute or run the thread

# insmod steppermotor.o

The code will be execute and signal will be sent to daughter board’s pin
Now stop the thread, now type following command in terminal

# rmmod stepper motor

Disable or stop RT-Linux mode

# rtlinux stop

For Linux, please download  the code and extract that …                                      Click here for downloading the code
Compile and run the code

# gcc -O stepperMotor.c -o stepperMotor
# ./stepperMotor 

the code will execute and you will get your desire output at daughter board’s pin

 

Eftakhairul Islam

Hi, I'm Eftakhairul Islam, a passionate Software Engineer, Hacker and Open Source Enthusiast. I enjoy writing about technical things, work in a couple of startup as a technical advisor and in my spare time, I contribute a lot of open source projects.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Read previous post:
Installing .sh extension file in Ubuntu

To install .sh extension file.. just type following command in terminal.. [sourcecode="""]sudo sh /path ...../fileName.sh[/sourcecode] or you can change the...

Close