based on raspberry pi with the application of stepper

21
TEACHER:張大緯 老師 TEAM:1 MEMBER:陳冠宇、傅翔祺、胡浩晟、周佳惠 103 IODD Project Report Based on Raspberry Pi with the application of stepper NCKU CSIE 1032IODD TEAM-1 1

Upload: -

Post on 14-Apr-2017

956 views

Category:

Devices & Hardware


1 download

TRANSCRIPT

Page 1: Based on raspberry pi with the application of Stepper

TEACHER:張大緯 老師

TEAM:1

MEMBER:陳冠宇、傅翔祺、胡浩晟、周佳惠

103 IODD Project Report

Based on Raspberry Pi with the application of stepper

NCKU CSIE 1032IODD TEAM-1 1

Page 2: Based on raspberry pi with the application of Stepper

Agenda

Result ArchitectureMethod

• Control Motor

• Xenomai

NCKU CSIE 1032IODD TEAM-1 2

Page 3: Based on raspberry pi with the application of Stepper

Result

•A application program to control the device via library “bcm2835”

•A kernel module

•2-axis platform

3NCKU CSIE 1032IODD TEAM-1

Page 4: Based on raspberry pi with the application of Stepper

NCKU CSIE 1032IODD TEAM-1 4

Page 5: Based on raspberry pi with the application of Stepper

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

Page 6: Based on raspberry pi with the application of Stepper

Architecture

•Controller

•A4988

6NCKU CSIE 1032IODD TEAM-1

Page 7: Based on raspberry pi with the application of Stepper

Architecture

•2-axis platform

•45 * 40 (cm2)

•Motor : 1.8o per step

7NCKU CSIE 1032IODD TEAM-1

Page 8: Based on raspberry pi with the application of Stepper

Method

•Controller

•Library “bcm2835”

• bcm2835_gpio_fsel()

• bcm2835_gpio_write()

• bcm2835_gpio_lev()

8NCKU CSIE 1032IODD TEAM-1

Page 9: Based on raspberry pi with the application of Stepper

Method

•Controller

•Modify context to control peripheral

9NCKU CSIE 1032IODD TEAM-1

Page 10: Based on raspberry pi with the application of Stepper

Method

10NCKU CSIE 1032IODD TEAM-1

Page 11: Based on raspberry pi with the application of Stepper

Method

11NCKU CSIE 1032IODD TEAM-1

Page 12: Based on raspberry pi with the application of Stepper

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

Page 13: Based on raspberry pi with the application of Stepper

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

Page 14: Based on raspberry pi with the application of Stepper

MethodCobalt Architecture

Mercury Architecture(Xenomai-2 use)

14NCKU CSIE 1032IODD TEAM-1

Page 15: Based on raspberry pi with the application of Stepper

Method

The linux kernel

Xenomai source code

Cross-Compiler 4.8.3

15NCKU CSIE 1032IODD TEAM-1

Page 16: Based on raspberry pi with the application of Stepper

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

Page 17: Based on raspberry pi with the application of Stepper

Method5. Compile the source code and create image file

6. $make –j8 ARCH=arm O=build CROSS_COMPILE=$...

17NCKU CSIE 1032IODD TEAM-1

Page 18: Based on raspberry pi with the application of Stepper

Method

18NCKU CSIE 1032IODD TEAM-1

Page 19: Based on raspberry pi with the application of Stepper

Method

19NCKU CSIE 1032IODD TEAM-1

Page 20: Based on raspberry pi with the application of Stepper

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

Page 21: Based on raspberry pi with the application of Stepper

NCKU CSIE 1032IODD TEAM-1 21