based on raspberry pi with the application of stepper
TRANSCRIPT
TEACHER:張大緯 老師
TEAM:1
MEMBER:陳冠宇、傅翔祺、胡浩晟、周佳惠
103 IODD Project Report
Based on Raspberry Pi with the application of stepper
NCKU CSIE 1032IODD TEAM-1 1
Agenda
Result ArchitectureMethod
• Control Motor
• Xenomai
NCKU CSIE 1032IODD TEAM-1 2
Result
•A application program to control the device via library “bcm2835”
•A kernel module
•2-axis platform
3NCKU CSIE 1032IODD TEAM-1
NCKU CSIE 1032IODD TEAM-1 4
Architecture•Controller
• Raspberry Pi Model B (BCM2835、BCM2708、ARM1176JZ-F)
• Xenomai-3
•Device
• 42 type Stepper Motor * 2
• A4988 Stepper motor drive board *2
5NCKU CSIE 1032IODD TEAM-1
Architecture
•Controller
•A4988
6NCKU CSIE 1032IODD TEAM-1
Architecture
•2-axis platform
•45 * 40 (cm2)
•Motor : 1.8o per step
7NCKU CSIE 1032IODD TEAM-1
Method
•Controller
•Library “bcm2835”
• bcm2835_gpio_fsel()
• bcm2835_gpio_write()
• bcm2835_gpio_lev()
8NCKU CSIE 1032IODD TEAM-1
Method
•Controller
•Modify context to control peripheral
9NCKU CSIE 1032IODD TEAM-1
Method
10NCKU CSIE 1032IODD TEAM-1
Method
11NCKU CSIE 1032IODD TEAM-1
Method
void Position(int x, int y, char type);
//Move length(unit)
void Move_len(int len, int dir, int motor);
void Init_home();
Start
Moving to specify position
Initialization
12
End
NCKU CSIE 1032IODD TEAM-1
Method「We are engineers from a wide background collaborating in theopen to offer the most adequate options for running real-timeapplications on embedded Linux© platforms.」 Ref. Xenomai.org
13NCKU CSIE 1032IODD TEAM-1
MethodCobalt Architecture
Mercury Architecture(Xenomai-2 use)
14NCKU CSIE 1032IODD TEAM-1
Method
The linux kernel
Xenomai source code
Cross-Compiler 4.8.3
15NCKU CSIE 1032IODD TEAM-1
Method1. Patch “ipipe-core-3.18.12-arm-1”
2. Modify(Detail in [5])• Kconfig• bcm2708.c• bcm2708_gpio.c• spi-bcm2708.c
3. $make ARCH=arm O=build CROSS_COMPILE=… menuconfig
4. Set option from “*” to “n”• CONFIG_CPU_FREQ • CONFIG_CPU_IDLE• CONFIG_KGDB• CONFIG_CONTEXT_TRACKING_FORCE
16NCKU CSIE 1032IODD TEAM-1
Method5. Compile the source code and create image file
6. $make –j8 ARCH=arm O=build CROSS_COMPILE=$...
17NCKU CSIE 1032IODD TEAM-1
Method
18NCKU CSIE 1032IODD TEAM-1
Method
19NCKU CSIE 1032IODD TEAM-1
Reference1. NCKU Wiki Xenomai
http://wiki.csie.ncku.edu.tw/embedded/xenomai
2. Emp learning in blogger
3. Emp learning in Hackpadhttps://emp-learn.hackpad.com/Beaglebone-black-learn.-mZ2XeVZLECp
4. GPIO Sysfs Interface for Userspacehttps://www.kernel.org/doc/Documentation/gpio/sysfs.txt
5. The patch of raspberry pihttps://git.xenomai.org/xenomai-2.6.git/tree/ksrc/arch/arm/patches/raspberry/ipipe-core-3.8.13-
raspberry-post-2.patch
20NCKU CSIE 1032IODD TEAM-1
NCKU CSIE 1032IODD TEAM-1 21