狠狠撸

狠狠撸Share a Scribd company logo
??? ??? ??
2015. 3. 28. ???(??)
??
? ??? History
? SmartRover App
? ?? ??
? ???? IDE
? ???? IDE
? ??? ??
? ?? ??
? ?? ??
? ?? ??
??? History
? CupDrone ???
? Multiwii ??? ??? ??? SkyRover Nano ????? F/W ??
? ?? ?? ? ?? ???? ???
Multiwii 2.3
Arduino
AVR
SkyRover
Nano
+
Flexbot ??
I/F
Afroflight32
GCC
STM32F103 ???? ??
+ +
FreeRTOS ??
USB ??
+
LCD Lib
(u8glib)
+
CupDrone
SmartRover App
? ??? ??? ?? ????? App?? ??? Flexbot?? ??? ???
? Google play?? “SmartRover”? ???? ??
???? – ???? IDE
? ??? ???/??? ?? ???? IDE?? ??
? ????
? Java SE (JDK) ??
? http://www.oracle.com/technetwork/java/javase/downloads/index.html
? Eclipse IDE for C/C++ Developers ??
? https://eclipse.org/downloads/
? GNU ARM Eclipse Plug-in ??
? Eclipse ?? ? Help->Install New Software->Add ?? ?
?? ??
Name : GNU ARM Eclipse Plug-ins
Loc : http://gnuarmeclipse.sourceforge.net/updates
???? – ???? IDE
? GNU ARM Eclipse Plug-in ??
? GNU ARM C/C++ Cross Development Tools ?? ? ???
???? – ???? IDE
? ARM GCC ??
? GNU Tools for ARM Embedded Processors
? https://launchpad.net/gcc-arm-embedded ? ???? ?? ??
???? ? ??
? ?? ?? ???? Add path to environment variable ??
???? – ???? IDE
? Cross Build Tools ??
? http://sourceforge.net/projects/gnuarmeclipse/files/Build%
20Tools/ Cross Build Tools.zip ????
? ??? ??
? ?? ??
? C:Program FilesGNU Tools ARM Embedded4.9 2015q1bin
? 3? ?? ??
???? – ???? IDE
? ???? ???? (github.com/oroca)
? File->Import ??
? URI : https//github.com/oroca/SkyRover_Nano ??
???? – ???? IDE
? ???? ???? (github.com/oroca)
? Clone URI ??
? Import existing projects ??
???? – ???? IDE
? ???? ???? (github.com/oroca)
? SkyRover_Nano ???? ??
???? Tool
? STM32LD_GUI
? STM32F ??? ???? ????? ??? ???? ???? ????
? ??? : http://cafe.naver.com/openrt/5943
? ???? : https://github.com/chcbaram/stm32ld_gui
? Visual C++ 6.0?? ???
???? Tool
? STM32LD
? ??? ??? ???? ?????? ???/?/????? ????
? ???? : https://github.com/chcbaram/stm32ld
? ????? ??? (cygwin ? gcc ?? ??)
? gcc -o stm32ld main.c stm32ld.c main_OpenCM.c serial_win32.c -
DWIN32_BUILD
? ?/????? ???
? Mac/Linux gcc -o stm32ld main.c stm32ld.c main_OpenCM.c
serial_posix.c
? ????
? stm32ld ???? ???? ????? 1
? ex) stm32ld COM1 115200 main.bin 1
? ex OpenCM ??) stm32ld COM1 115200 main.bin 1 opencm
???? – ???? IDE
? ???? ?????? ?? ?? ????
? ????? ???? 1.6 ??? SkyRover ?? ??? ???? ??
? ????
? ????IDE 1.6?? ????
? http://arduino.cc/en/Main/Software ?? Zip??? ???? ? ??
??
? SkyRover ?? ??
? https://github.com/oroca/SkyRover_Ardu ?? Download ZIP
?? ?? ????
? Arduino-1.6.1/hardware/oroca ??? ?? ??
???? – ???? IDE
? ??->??->SkyRover ??
???? – ???? IDE
? ??->??->SkyRover->?? ??
??? ??
? ??? ??
???
????
0x08000000
0x08003000
?? ??
12KB
114KB
2KB
0x0801F800
0x08020000
? ????? ?? On/Reset? ?? ???
? STM32F103? EEPROM? ????? ??? 2KB?????? ???? ??
? ??? ????? ???? ???
??? ??
? ?? ??
? lib ??
? RTOS/????/USB/LCD ?????
??? ??
? ?? ??
? obj ??
? ???? ???? obj??? ?? bin ??
??? ??
? ?? ??
? src ??
? ???? ??
? Thread ??
? FreeRTOS? Thread ?? ??
??? ??
? ?? ??
Make ????? ???? ??? ? ?? ? ? ?? ?? ??
???? ??
?? ???? ??
??? ??
? ?? ??
? main.c
? main??? ?? ?? ???/?? ??? ??
? mw.c
? ???? ???? ????, ??/????/?? ??
? sensors.c
? ??? ??? ???? ?? ? ?? ??? ?? ??
? imu.c
? ???/???/???? ?? Roll/Pith/Yaw?? ?? ??
? mixer.c
? ????? ? ??? ???? ??
? serial.c
? ??? ??? ?????? MSP ?? ?? ??
??? ??
? ?? ??
? drv_***.c
? ???? ???? ??? ?? ???? ??? ??
? drv_timer.c
? CPU? PWM ??? ? ?? ??
? drv_pwm.c
? ?? ?? PWM ?? ??
? config.c
? ?? FLASH? ???? ?????? ??? ??
? board.h
? ????/????/LED? ?? ??? ??? ??
??? ??
? ?? ?? ??
? thread ??
main()
thread_main()
thread_mw()
thread_menu()
thread_lcd()
- ??? ?? ?? ??
- USB? ?? ?? ?? ??
- I2C??? LCD ?? ?? ??
??? ??
? ?? ?? ??
? thread_mw
hexairbotFrameComplete()
computeRC()
? ????? ?? ???? ?????? ??
? ??? ???(?,??,?,???,AUX1,AUX2,AUX3,AUX4)? rcData[] ??? ??50Hz
computeIMU()
? ???/???/??? ??? ?? ??? ??
annexCode() ? ??? ??? rcData[]? ??? 1000~2000??(??? 1500), ???? ? rcCommand[]?
0~500 ??? ??
pid_controller()
mixTable()
writeServos()
writeMotors()
? rcCommnad[]?? ???? PID??? ?? ???? ??
? ?? ??? ?? PID??? ?? ?? ???? ?? PWM?? ??
? PWM?? ?? ?? ??
280Hz
??? ??
? ?? ??
? App?? MSP ????? Roll/Pitch/Yaw/Throttle ??? ??
MSP ??
annexCode()
serialCom()
evaluateCommand()
serialRead()
??? ??? ??
??? ??
? MSP ??
? ????? ???? ??? ????
? http://www.multiwii.com/wiki/index.php?title=Multiwii_Seri
al_Protocol
? ?? ??
? App -> CupDrone
? CupDrone -> App
??? ??
? MSP ??
? ??? ??
??? ??
? ?? ??
? CupDrone??? ?? ?? ??(serial.c? ??)
? MSP_SET_RAW_RC_TINY ???? ?? ??? ??
#if defined(SKYROVER)
#define MSP_SET_RAW_RC_TINY 150
#define MSP_ARM 151
#define MSP_DISARM 152
#define MSP_TRIM_UP 153
#define MSP_TRIM_DOWN 154
#define MSP_TRIM_LEFT 155
#define MSP_TRIM_RIGHT 156
#endif
Roll/Pitch/Yaw/Throttle/Aux ??
?? ???
?? ????
??? ??
? MSP_SET_RAW_RC_TINY
evaluateCommand()
{
switch( cmdMSP )
{
case MSP_SET_RAW_RC_TINY:
for(i = 0;i < 4;i++)
{
serialRcValue[i] = 1000 + read8() * 4;
}
auxChannels = read8();
…
Index
0 0~250 – Roll ?
1 0~250 – Pitch ?
2 0~250 – Yaw ?
3 0~250 – Throttle ?
4 0~255 – Aux ?
7:6 bit - Aux1
5:4 bit - Aux2
3:2 bit - Aux3
1:0 bit - Aux4
Aux1
- 0 : Headfree Mode Off
- 2 : Headfree Mode On
Aux2
- 0 : ???? Off
- 2 : ???? On
??? ??
? ?? ??
? board.h
? ?? ?? ??(HEX/QUAD)
? ???? ??
//#define SKYROVER_HEX
#define SKYROVER_QUAD
#define GYRO
#define ACC
#define MAG
#define BARO
#define ACC_AS_MAG
#define SENSORS_SET (SENSOR_ACC | SENSOR_BARO)
??? ??
? ?? ??
? config.c -> resetConf()
? ??? ???? ???
? ?? ?? ??(HEX/QUAD)
? ?? ???
#if defined(SKYROVER_HEX)
mcfg.mixerConfiguration = MULTITYPE_HEX6; // ????
#elif defined(SKYROVER_QUAD)
mcfg.mixerConfiguration = MULTITYPE_QUADX; // ????
#else
mcfg.mixerConfiguration = MULTITYPE_HEX6; // ????
#endif
featureSet(FEATURE_SERIALRX); // ?????? HexAirBot ????? ??? ??
featureSet(FEATURE_MOTOR_STOP); // DC Brushed ?? ??? ?? ??? PWM?? 0?? ?? ??
featureSet(FEATURE_VBAT); // ??? ???? ?? ???
??? ??
? ?? ??
? config.c -> resetConf()
? ????? ?? ? ?? ?? ??
? Yaw? ?? ??
mcfg.serialrx_type = SERIALRX_HEXAIRBOT; // HexAirBot
mcfg.minthrottle = 1150;
mcfg.maxthrottle = 1850;
mcfg.motor_pwm_rate = 1000; // Hz DC ?????? 500 ???? ??
cfg.yaw_direction = 1;
?? ??
? QuadX ?? ??
? ???? ???
? Roll/Pitch/Yaw/?? ???? ?? ???? ??
<Roll> <Pitch> <Yaw> <?/?>
+ + +
?? ??
? ?? ???
? Roll?? ??? ??? ??? ???? ?? ?? ??? ??? ?? ??
<Roll>
???? ??????? ???
FRONT_L ?? ??? = +1 x Roll????
REAR_L ?? ??? = +1 x Roll????
FRONT_R ?? ??? = -1 x Roll????
REAR_R ?? ??? = -1 x Roll????
?? ??
? ?? ???
? Roll/Pitch/Yaw/??? ?? ?? ?? ??? ?? ?? ?? ???
? mixer.c ? ?? ???? ??? ??
FRONT_L ?? ??? = (+1xRoll ????) + (-1xPitch ????) + (-1xYaw ????)
REAR_L ?? ??? = (+1xRoll ????) + (+1xPitch ????) + (+1xYaw ????)
FRONT_R ?? ??? = (-1xRoll ????) + (-1xPitch ????) + (+1xYaw ????)
REAR_R ?? ??? = (-1xRoll ????) + (+1xPitch ????) + (-1xYaw ????)
static const motorMixer_t mixerQuadX[] = {
{ 1.0f, -1.0f, 1.0f, -1.0f }, // REAR_R
{ 1.0f, -1.0f, -1.0f, 1.0f }, // FRONT_R
{ 1.0f, 1.0f, 1.0f, 1.0f }, // REAR_L
{ 1.0f, 1.0f, -1.0f, -1.0f }, // FRONT_L
};
Throttle
Pitch
Yaw
Roll
?? ??
? ?? ??
THROTTLE
ROLL
PITCH
YAW
ROLL???
PITCH???
YAW???
ROLL ???
PITCH ???
YAW ???
PID ???
PID ???
PID ???
ROLL ???
PITCH ???
YAW ???
Mixer
PWM1
PWM2
PWM3
PWM4
??? ?? ??? ??
computeRC( )
annexCode( ) computeIMU( )
pidMultiWii( )
mixTable( ) writeMotors( )
????
? ???? ??
roll_error_angle = Sky.cmd_get_roll() - Sky.imu_get_angle_roll();
pitch_error_angle = Sky.cmd_get_pitch() - Sky.imu_get_angle_pitch();
yaw_error_angle = Sky.imu_get_gyro_yaw();
MotorPwm_RearR = Sky.cmd_get_throttle() + (-1*roll_error_angle) + ( 1*pitch_error_angle) + (-1*yaw_error_angle);
MotorPwm_FrontR = Sky.cmd_get_throttle() + (-1*roll_error_angle) + (-1*pitch_error_angle) + ( 1*yaw_error_angle);
MotorPwm_RearL = Sky.cmd_get_throttle() + ( 1*roll_error_angle) + ( 1*pitch_error_angle) + ( 1*yaw_error_angle);
MotorPwm_FrontL = Sky.cmd_get_throttle() + ( 1*roll_error_angle) + (-1*pitch_error_angle) + (-1*yaw_error_angle);
Sky.motor_set_speed_FRONT_L( MotorPwm_FrontL );
Sky.motor_set_speed_FRONT_R( MotorPwm_FrontR );
Sky.motor_set_speed_REAR_L ( MotorPwm_RearL );
Sky.motor_set_speed_REAR_R ( MotorPwm_RearR );
PID ???
?????.
Ad

Recommended

础苍诲谤辞颈诲起动周りのノウハウ
础苍诲谤辞颈诲起动周りのノウハウ
chancelab
?
?? 01 ARM ???? ??
?? 01 ARM ???? ??
chcbaram
?
[??] ??? ?? [2015.5.23]
[??] ??? ?? [2015.5.23]
chcbaram
?
贵笔骋础+厂辞颁+尝颈苍耻虫実践勉强会资料
贵笔骋础+厂辞颁+尝颈苍耻虫実践勉强会资料
一路 川染
?
基础から学ぶ组み込み础苍诲谤辞颈诲
基础から学ぶ组み込み础苍诲谤辞颈诲
demuyan
?
?? 04 ??? ?? ??
?? 04 ??? ?? ??
chcbaram
?
忙しい人の5分で分かるDocker 2017年春Ver
忙しい人の5分で分かるDocker 2017年春Ver
Masahito Zembutsu
?
オープンソースのドローン用フライトコントローラ「Dronecode」の概要( #OSC15tk)
オープンソースのドローン用フライトコントローラ「Dronecode」の概要( #OSC15tk)
博宣 今村
?
?? 06 ????
?? 06 ????
chcbaram
?
顿辞肠办别谤から肠辞苍迟补颈苍别谤诲への移行
顿辞肠办别谤から肠辞苍迟补颈苍别谤诲への移行
Kohei Tokunaga
?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
?
Pod Security AdmissionによるKubernetesのポリシー制御(Kubernetes Novice Tokyo #21 発表資料)
Pod Security AdmissionによるKubernetesのポリシー制御(Kubernetes Novice Tokyo #21 発表資料)
NTT DATA Technology & Innovation
?
Head First to Container&Kubernetes
Head First to Container&Kubernetes
HungWei Chiu
?
OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)
Takeshi HASEGAWA
?
贰迟丑别谤苍别迟の受信処理
贰迟丑别谤苍别迟の受信処理
Takuya ASADA
?
Linuxベースのオープンソース フライトコントローラーの概要( #ABC2015S )
Linuxベースのオープンソース フライトコントローラーの概要( #ABC2015S )
博宣 今村
?
Janus @ Meetup Tokyo #12
Janus @ Meetup Tokyo #12
Lorenzo Miniero
?
Android?組込み開発基礎コース BeagleBoard編
Android?組込み開発基礎コース BeagleBoard編
OESF Education
?
U-Boot presentation 2013
U-Boot presentation 2013
Wave Digitech
?
Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
Knoldus Inc.
?
IETF111 RATS: Remote Attestation ProcedureS 報告
IETF111 RATS: Remote Attestation ProcedureS 報告
Kuniyasu Suzaki
?
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Kazuto Kusama
?
Android デバッグ小ネタ
Android デバッグ小ネタ
l_b__
?
惭测厂蚕尝と笔辞蝉迟驳谤别厂蚕尝の基本的なパラメータ比较
惭测厂蚕尝と笔辞蝉迟驳谤别厂蚕尝の基本的なパラメータ比较
Shinya Sugiyama
?
レシピの作り方入门
レシピの作り方入门
Nobuhiro Iwamatsu
?
?? 02 ARM ??? ?? ?? ??
?? 02 ARM ??? ?? ?? ??
chcbaram
?
コンテナセキュリティにおける権限制御(OCHaCafe5 #3 Kubernetes のセキュリティ 発表資料)
コンテナセキュリティにおける権限制御(OCHaCafe5 #3 Kubernetes のセキュリティ 発表資料)
NTT DATA Technology & Innovation
?
Docker Swarm 0.2.0
Docker Swarm 0.2.0
Docker, Inc.
?
SkyRover Firmware
SkyRover Firmware
chcbaram
?
Arduino Basic Programming
Arduino Basic Programming
SangGyu Kim
?

More Related Content

What's hot (20)

?? 06 ????
?? 06 ????
chcbaram
?
顿辞肠办别谤から肠辞苍迟补颈苍别谤诲への移行
顿辞肠办别谤から肠辞苍迟补颈苍别谤诲への移行
Kohei Tokunaga
?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
?
Pod Security AdmissionによるKubernetesのポリシー制御(Kubernetes Novice Tokyo #21 発表資料)
Pod Security AdmissionによるKubernetesのポリシー制御(Kubernetes Novice Tokyo #21 発表資料)
NTT DATA Technology & Innovation
?
Head First to Container&Kubernetes
Head First to Container&Kubernetes
HungWei Chiu
?
OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)
Takeshi HASEGAWA
?
贰迟丑别谤苍别迟の受信処理
贰迟丑别谤苍别迟の受信処理
Takuya ASADA
?
Linuxベースのオープンソース フライトコントローラーの概要( #ABC2015S )
Linuxベースのオープンソース フライトコントローラーの概要( #ABC2015S )
博宣 今村
?
Janus @ Meetup Tokyo #12
Janus @ Meetup Tokyo #12
Lorenzo Miniero
?
Android?組込み開発基礎コース BeagleBoard編
Android?組込み開発基礎コース BeagleBoard編
OESF Education
?
U-Boot presentation 2013
U-Boot presentation 2013
Wave Digitech
?
Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
Knoldus Inc.
?
IETF111 RATS: Remote Attestation ProcedureS 報告
IETF111 RATS: Remote Attestation ProcedureS 報告
Kuniyasu Suzaki
?
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Kazuto Kusama
?
Android デバッグ小ネタ
Android デバッグ小ネタ
l_b__
?
惭测厂蚕尝と笔辞蝉迟驳谤别厂蚕尝の基本的なパラメータ比较
惭测厂蚕尝と笔辞蝉迟驳谤别厂蚕尝の基本的なパラメータ比较
Shinya Sugiyama
?
レシピの作り方入门
レシピの作り方入门
Nobuhiro Iwamatsu
?
?? 02 ARM ??? ?? ?? ??
?? 02 ARM ??? ?? ?? ??
chcbaram
?
コンテナセキュリティにおける権限制御(OCHaCafe5 #3 Kubernetes のセキュリティ 発表資料)
コンテナセキュリティにおける権限制御(OCHaCafe5 #3 Kubernetes のセキュリティ 発表資料)
NTT DATA Technology & Innovation
?
Docker Swarm 0.2.0
Docker Swarm 0.2.0
Docker, Inc.
?
顿辞肠办别谤から肠辞苍迟补颈苍别谤诲への移行
顿辞肠办别谤から肠辞苍迟补颈苍别谤诲への移行
Kohei Tokunaga
?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
?
Pod Security AdmissionによるKubernetesのポリシー制御(Kubernetes Novice Tokyo #21 発表資料)
Pod Security AdmissionによるKubernetesのポリシー制御(Kubernetes Novice Tokyo #21 発表資料)
NTT DATA Technology & Innovation
?
Head First to Container&Kubernetes
Head First to Container&Kubernetes
HungWei Chiu
?
OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)
Takeshi HASEGAWA
?
贰迟丑别谤苍别迟の受信処理
贰迟丑别谤苍别迟の受信処理
Takuya ASADA
?
Linuxベースのオープンソース フライトコントローラーの概要( #ABC2015S )
Linuxベースのオープンソース フライトコントローラーの概要( #ABC2015S )
博宣 今村
?
Android?組込み開発基礎コース BeagleBoard編
Android?組込み開発基礎コース BeagleBoard編
OESF Education
?
U-Boot presentation 2013
U-Boot presentation 2013
Wave Digitech
?
Is Rust Programming ready for embedded development?
Is Rust Programming ready for embedded development?
Knoldus Inc.
?
IETF111 RATS: Remote Attestation ProcedureS 報告
IETF111 RATS: Remote Attestation ProcedureS 報告
Kuniyasu Suzaki
?
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Kazuto Kusama
?
Android デバッグ小ネタ
Android デバッグ小ネタ
l_b__
?
惭测厂蚕尝と笔辞蝉迟驳谤别厂蚕尝の基本的なパラメータ比较
惭测厂蚕尝と笔辞蝉迟驳谤别厂蚕尝の基本的なパラメータ比较
Shinya Sugiyama
?
?? 02 ARM ??? ?? ?? ??
?? 02 ARM ??? ?? ?? ??
chcbaram
?
コンテナセキュリティにおける権限制御(OCHaCafe5 #3 Kubernetes のセキュリティ 発表資料)
コンテナセキュリティにおける権限制御(OCHaCafe5 #3 Kubernetes のセキュリティ 発表資料)
NTT DATA Technology & Innovation
?

Similar to ??? ???? ??? ?? 2015. 3.28. (20)

SkyRover Firmware
SkyRover Firmware
chcbaram
?
Arduino Basic Programming
Arduino Basic Programming
SangGyu Kim
?
???????? RC?? ????????
???????? RC?? ????????
Chiwon Song
?
3D ???? ????
3D ???? ????
Chiwon Song
?
??????????? IoT ?????
??????????? IoT ?????
Won Jun Song
?
???????? - ??? ??
???????? - ??? ??
Circulus
?
OSS SW Basics Lecture 14: Open source hardware
OSS SW Basics Lecture 14: Open source hardware
Jeongkyu Shin
?
?????????? Fpga??? ???????? ??????????
?????????? Fpga??? ???????? ??????????
chcbaram
?
MCU(nanheekim)
MCU(nanheekim)
Nanhee Kim
?
???? IoT ??? ?? 4??
???? IoT ??? ?? 4??
??? FunFun Yoo
?
OpenCR ???????? ????????????
OpenCR ???????? ????????????
chcbaram
?
??3?? ????? ????????? ?????? 1????? 1????? ????? App ??
??3?? ????? ????????? ?????? 1????? 1????? ????? App ??
WooSangHwang
?
????
????
?? ?
?
???? ???
???? ???
?? ?
?
ICT DIY 2014 Conference - Demo & Exhibition
ICT DIY 2014 Conference - Demo & Exhibition
Jonathan Jeon
?
Intuitive Understanding of Arduino for IoT
Intuitive Understanding of Arduino for IoT
?? ?
?
???? ???? ???? ???-2015.4.11
???? ???? ???? ???-2015.4.11
SongSup Shin
?
IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2
Park Jonggun
?
?????? Circulus API ???
?????? Circulus API ???
Circulus
?
SkyRover Firmware
SkyRover Firmware
chcbaram
?
Arduino Basic Programming
Arduino Basic Programming
SangGyu Kim
?
???????? RC?? ????????
???????? RC?? ????????
Chiwon Song
?
??????????? IoT ?????
??????????? IoT ?????
Won Jun Song
?
???????? - ??? ??
???????? - ??? ??
Circulus
?
OSS SW Basics Lecture 14: Open source hardware
OSS SW Basics Lecture 14: Open source hardware
Jeongkyu Shin
?
?????????? Fpga??? ???????? ??????????
?????????? Fpga??? ???????? ??????????
chcbaram
?
OpenCR ???????? ????????????
OpenCR ???????? ????????????
chcbaram
?
??3?? ????? ????????? ?????? 1????? 1????? ????? App ??
??3?? ????? ????????? ?????? 1????? 1????? ????? App ??
WooSangHwang
?
???? ???
???? ???
?? ?
?
ICT DIY 2014 Conference - Demo & Exhibition
ICT DIY 2014 Conference - Demo & Exhibition
Jonathan Jeon
?
Intuitive Understanding of Arduino for IoT
Intuitive Understanding of Arduino for IoT
?? ?
?
???? ???? ???? ???-2015.4.11
???? ???? ???? ???-2015.4.11
SongSup Shin
?
IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2
Park Jonggun
?
?????? Circulus API ???
?????? Circulus API ???
Circulus
?
Ad

More from chcbaram (6)

OROCABOY3 ???
OROCABOY3 ???
chcbaram
?
?? 07 ARM ????? ????
?? 07 ARM ????? ????
chcbaram
?
?? 05 ??? PC ?????
?? 05 ??? PC ?????
chcbaram
?
?? 03 ???? ??
?? 03 ???? ??
chcbaram
?
?? ??
?? ??
chcbaram
?
OpenCR tutorial_icra2017
OpenCR tutorial_icra2017
chcbaram
?
OROCABOY3 ???
OROCABOY3 ???
chcbaram
?
?? 07 ARM ????? ????
?? 07 ARM ????? ????
chcbaram
?
?? 05 ??? PC ?????
?? 05 ??? PC ?????
chcbaram
?
?? 03 ???? ??
?? 03 ???? ??
chcbaram
?
OpenCR tutorial_icra2017
OpenCR tutorial_icra2017
chcbaram
?
Ad

??? ???? ??? ?? 2015. 3.28.

  • 1. ??? ??? ?? 2015. 3. 28. ???(??)
  • 2. ?? ? ??? History ? SmartRover App ? ?? ?? ? ???? IDE ? ???? IDE ? ??? ?? ? ?? ?? ? ?? ?? ? ?? ??
  • 3. ??? History ? CupDrone ??? ? Multiwii ??? ??? ??? SkyRover Nano ????? F/W ?? ? ?? ?? ? ?? ???? ??? Multiwii 2.3 Arduino AVR SkyRover Nano + Flexbot ?? I/F Afroflight32 GCC STM32F103 ???? ?? + + FreeRTOS ?? USB ?? + LCD Lib (u8glib) + CupDrone
  • 4. SmartRover App ? ??? ??? ?? ????? App?? ??? Flexbot?? ??? ??? ? Google play?? “SmartRover”? ???? ??
  • 5. ???? – ???? IDE ? ??? ???/??? ?? ???? IDE?? ?? ? ???? ? Java SE (JDK) ?? ? http://www.oracle.com/technetwork/java/javase/downloads/index.html ? Eclipse IDE for C/C++ Developers ?? ? https://eclipse.org/downloads/ ? GNU ARM Eclipse Plug-in ?? ? Eclipse ?? ? Help->Install New Software->Add ?? ? ?? ?? Name : GNU ARM Eclipse Plug-ins Loc : http://gnuarmeclipse.sourceforge.net/updates
  • 6. ???? – ???? IDE ? GNU ARM Eclipse Plug-in ?? ? GNU ARM C/C++ Cross Development Tools ?? ? ???
  • 7. ???? – ???? IDE ? ARM GCC ?? ? GNU Tools for ARM Embedded Processors ? https://launchpad.net/gcc-arm-embedded ? ???? ?? ?? ???? ? ?? ? ?? ?? ???? Add path to environment variable ??
  • 8. ???? – ???? IDE ? Cross Build Tools ?? ? http://sourceforge.net/projects/gnuarmeclipse/files/Build% 20Tools/ Cross Build Tools.zip ???? ? ??? ?? ? ?? ?? ? C:Program FilesGNU Tools ARM Embedded4.9 2015q1bin ? 3? ?? ??
  • 9. ???? – ???? IDE ? ???? ???? (github.com/oroca) ? File->Import ?? ? URI : https//github.com/oroca/SkyRover_Nano ??
  • 10. ???? – ???? IDE ? ???? ???? (github.com/oroca) ? Clone URI ?? ? Import existing projects ??
  • 11. ???? – ???? IDE ? ???? ???? (github.com/oroca) ? SkyRover_Nano ???? ??
  • 12. ???? Tool ? STM32LD_GUI ? STM32F ??? ???? ????? ??? ???? ???? ???? ? ??? : http://cafe.naver.com/openrt/5943 ? ???? : https://github.com/chcbaram/stm32ld_gui ? Visual C++ 6.0?? ???
  • 13. ???? Tool ? STM32LD ? ??? ??? ???? ?????? ???/?/????? ???? ? ???? : https://github.com/chcbaram/stm32ld ? ????? ??? (cygwin ? gcc ?? ??) ? gcc -o stm32ld main.c stm32ld.c main_OpenCM.c serial_win32.c - DWIN32_BUILD ? ?/????? ??? ? Mac/Linux gcc -o stm32ld main.c stm32ld.c main_OpenCM.c serial_posix.c ? ???? ? stm32ld ???? ???? ????? 1 ? ex) stm32ld COM1 115200 main.bin 1 ? ex OpenCM ??) stm32ld COM1 115200 main.bin 1 opencm
  • 14. ???? – ???? IDE ? ???? ?????? ?? ?? ???? ? ????? ???? 1.6 ??? SkyRover ?? ??? ???? ?? ? ???? ? ????IDE 1.6?? ???? ? http://arduino.cc/en/Main/Software ?? Zip??? ???? ? ?? ?? ? SkyRover ?? ?? ? https://github.com/oroca/SkyRover_Ardu ?? Download ZIP ?? ?? ???? ? Arduino-1.6.1/hardware/oroca ??? ?? ??
  • 15. ???? – ???? IDE ? ??->??->SkyRover ??
  • 16. ???? – ???? IDE ? ??->??->SkyRover->?? ??
  • 17. ??? ?? ? ??? ?? ??? ???? 0x08000000 0x08003000 ?? ?? 12KB 114KB 2KB 0x0801F800 0x08020000 ? ????? ?? On/Reset? ?? ??? ? STM32F103? EEPROM? ????? ??? 2KB?????? ???? ?? ? ??? ????? ???? ???
  • 18. ??? ?? ? ?? ?? ? lib ?? ? RTOS/????/USB/LCD ?????
  • 19. ??? ?? ? ?? ?? ? obj ?? ? ???? ???? obj??? ?? bin ??
  • 20. ??? ?? ? ?? ?? ? src ?? ? ???? ?? ? Thread ?? ? FreeRTOS? Thread ?? ??
  • 21. ??? ?? ? ?? ?? Make ????? ???? ??? ? ?? ? ? ?? ?? ?? ???? ?? ?? ???? ??
  • 22. ??? ?? ? ?? ?? ? main.c ? main??? ?? ?? ???/?? ??? ?? ? mw.c ? ???? ???? ????, ??/????/?? ?? ? sensors.c ? ??? ??? ???? ?? ? ?? ??? ?? ?? ? imu.c ? ???/???/???? ?? Roll/Pith/Yaw?? ?? ?? ? mixer.c ? ????? ? ??? ???? ?? ? serial.c ? ??? ??? ?????? MSP ?? ?? ??
  • 23. ??? ?? ? ?? ?? ? drv_***.c ? ???? ???? ??? ?? ???? ??? ?? ? drv_timer.c ? CPU? PWM ??? ? ?? ?? ? drv_pwm.c ? ?? ?? PWM ?? ?? ? config.c ? ?? FLASH? ???? ?????? ??? ?? ? board.h ? ????/????/LED? ?? ??? ??? ??
  • 24. ??? ?? ? ?? ?? ?? ? thread ?? main() thread_main() thread_mw() thread_menu() thread_lcd() - ??? ?? ?? ?? - USB? ?? ?? ?? ?? - I2C??? LCD ?? ?? ??
  • 25. ??? ?? ? ?? ?? ?? ? thread_mw hexairbotFrameComplete() computeRC() ? ????? ?? ???? ?????? ?? ? ??? ???(?,??,?,???,AUX1,AUX2,AUX3,AUX4)? rcData[] ??? ??50Hz computeIMU() ? ???/???/??? ??? ?? ??? ?? annexCode() ? ??? ??? rcData[]? ??? 1000~2000??(??? 1500), ???? ? rcCommand[]? 0~500 ??? ?? pid_controller() mixTable() writeServos() writeMotors() ? rcCommnad[]?? ???? PID??? ?? ???? ?? ? ?? ??? ?? PID??? ?? ?? ???? ?? PWM?? ?? ? PWM?? ?? ?? ?? 280Hz
  • 26. ??? ?? ? ?? ?? ? App?? MSP ????? Roll/Pitch/Yaw/Throttle ??? ?? MSP ?? annexCode() serialCom() evaluateCommand() serialRead() ??? ??? ??
  • 27. ??? ?? ? MSP ?? ? ????? ???? ??? ???? ? http://www.multiwii.com/wiki/index.php?title=Multiwii_Seri al_Protocol ? ?? ?? ? App -> CupDrone ? CupDrone -> App
  • 28. ??? ?? ? MSP ?? ? ??? ??
  • 29. ??? ?? ? ?? ?? ? CupDrone??? ?? ?? ??(serial.c? ??) ? MSP_SET_RAW_RC_TINY ???? ?? ??? ?? #if defined(SKYROVER) #define MSP_SET_RAW_RC_TINY 150 #define MSP_ARM 151 #define MSP_DISARM 152 #define MSP_TRIM_UP 153 #define MSP_TRIM_DOWN 154 #define MSP_TRIM_LEFT 155 #define MSP_TRIM_RIGHT 156 #endif Roll/Pitch/Yaw/Throttle/Aux ?? ?? ??? ?? ????
  • 30. ??? ?? ? MSP_SET_RAW_RC_TINY evaluateCommand() { switch( cmdMSP ) { case MSP_SET_RAW_RC_TINY: for(i = 0;i < 4;i++) { serialRcValue[i] = 1000 + read8() * 4; } auxChannels = read8(); … Index 0 0~250 – Roll ? 1 0~250 – Pitch ? 2 0~250 – Yaw ? 3 0~250 – Throttle ? 4 0~255 – Aux ? 7:6 bit - Aux1 5:4 bit - Aux2 3:2 bit - Aux3 1:0 bit - Aux4 Aux1 - 0 : Headfree Mode Off - 2 : Headfree Mode On Aux2 - 0 : ???? Off - 2 : ???? On
  • 31. ??? ?? ? ?? ?? ? board.h ? ?? ?? ??(HEX/QUAD) ? ???? ?? //#define SKYROVER_HEX #define SKYROVER_QUAD #define GYRO #define ACC #define MAG #define BARO #define ACC_AS_MAG #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO)
  • 32. ??? ?? ? ?? ?? ? config.c -> resetConf() ? ??? ???? ??? ? ?? ?? ??(HEX/QUAD) ? ?? ??? #if defined(SKYROVER_HEX) mcfg.mixerConfiguration = MULTITYPE_HEX6; // ???? #elif defined(SKYROVER_QUAD) mcfg.mixerConfiguration = MULTITYPE_QUADX; // ???? #else mcfg.mixerConfiguration = MULTITYPE_HEX6; // ???? #endif featureSet(FEATURE_SERIALRX); // ?????? HexAirBot ????? ??? ?? featureSet(FEATURE_MOTOR_STOP); // DC Brushed ?? ??? ?? ??? PWM?? 0?? ?? ?? featureSet(FEATURE_VBAT); // ??? ???? ?? ???
  • 33. ??? ?? ? ?? ?? ? config.c -> resetConf() ? ????? ?? ? ?? ?? ?? ? Yaw? ?? ?? mcfg.serialrx_type = SERIALRX_HEXAIRBOT; // HexAirBot mcfg.minthrottle = 1150; mcfg.maxthrottle = 1850; mcfg.motor_pwm_rate = 1000; // Hz DC ?????? 500 ???? ?? cfg.yaw_direction = 1;
  • 34. ?? ?? ? QuadX ?? ?? ? ???? ??? ? Roll/Pitch/Yaw/?? ???? ?? ???? ?? <Roll> <Pitch> <Yaw> <?/?> + + +
  • 35. ?? ?? ? ?? ??? ? Roll?? ??? ??? ??? ???? ?? ?? ??? ??? ?? ?? <Roll> ???? ??????? ??? FRONT_L ?? ??? = +1 x Roll???? REAR_L ?? ??? = +1 x Roll???? FRONT_R ?? ??? = -1 x Roll???? REAR_R ?? ??? = -1 x Roll????
  • 36. ?? ?? ? ?? ??? ? Roll/Pitch/Yaw/??? ?? ?? ?? ??? ?? ?? ?? ??? ? mixer.c ? ?? ???? ??? ?? FRONT_L ?? ??? = (+1xRoll ????) + (-1xPitch ????) + (-1xYaw ????) REAR_L ?? ??? = (+1xRoll ????) + (+1xPitch ????) + (+1xYaw ????) FRONT_R ?? ??? = (-1xRoll ????) + (-1xPitch ????) + (+1xYaw ????) REAR_R ?? ??? = (-1xRoll ????) + (+1xPitch ????) + (-1xYaw ????) static const motorMixer_t mixerQuadX[] = { { 1.0f, -1.0f, 1.0f, -1.0f }, // REAR_R { 1.0f, -1.0f, -1.0f, 1.0f }, // FRONT_R { 1.0f, 1.0f, 1.0f, 1.0f }, // REAR_L { 1.0f, 1.0f, -1.0f, -1.0f }, // FRONT_L }; Throttle Pitch Yaw Roll
  • 37. ?? ?? ? ?? ?? THROTTLE ROLL PITCH YAW ROLL??? PITCH??? YAW??? ROLL ??? PITCH ??? YAW ??? PID ??? PID ??? PID ??? ROLL ??? PITCH ??? YAW ??? Mixer PWM1 PWM2 PWM3 PWM4 ??? ?? ??? ?? computeRC( ) annexCode( ) computeIMU( ) pidMultiWii( ) mixTable( ) writeMotors( )
  • 38. ???? ? ???? ?? roll_error_angle = Sky.cmd_get_roll() - Sky.imu_get_angle_roll(); pitch_error_angle = Sky.cmd_get_pitch() - Sky.imu_get_angle_pitch(); yaw_error_angle = Sky.imu_get_gyro_yaw(); MotorPwm_RearR = Sky.cmd_get_throttle() + (-1*roll_error_angle) + ( 1*pitch_error_angle) + (-1*yaw_error_angle); MotorPwm_FrontR = Sky.cmd_get_throttle() + (-1*roll_error_angle) + (-1*pitch_error_angle) + ( 1*yaw_error_angle); MotorPwm_RearL = Sky.cmd_get_throttle() + ( 1*roll_error_angle) + ( 1*pitch_error_angle) + ( 1*yaw_error_angle); MotorPwm_FrontL = Sky.cmd_get_throttle() + ( 1*roll_error_angle) + (-1*pitch_error_angle) + (-1*yaw_error_angle); Sky.motor_set_speed_FRONT_L( MotorPwm_FrontL ); Sky.motor_set_speed_FRONT_R( MotorPwm_FrontR ); Sky.motor_set_speed_REAR_L ( MotorPwm_RearL ); Sky.motor_set_speed_REAR_R ( MotorPwm_RearR ); PID ???