jim ng 15/1/2014 ceng4480 tutorial 1. about me current mphil student supervised by prof. mak you can...

28
Jim Ng 15/1/2014 CENG4480 TUTORIAL 1

Upload: owen-pitts

Post on 04-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

Jim Ng

15/1/2014

CENG4480 TUTORIAL 1

Page 2: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

ABOUT ME

• Current MPhil Student supervised by Prof. Mak

• You can find me at Rm116 in SHB

• Email : [email protected]

Page 3: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

WHAT WILL YOU DO?

• Learn what is a Microcontroller ()

• Familiarize with the basic setup of the Galileo Board

• Most importantly : Have FUN!!!

Page 4: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

WHAT IS A CONTROL SYSTEM?

Page 5: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

LET’S THINK ABOUT IT

• A control system can react to the outside world by sensing and actuation.

• The outputs are based on the inputs and the internal state of the system.

Control SystemInputs Outputs

Page 6: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

THE FULL PICTURE

Environment

Sensor

Input

Control System

Actuator

Output

Page 7: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

SENSORS

• To convert the outside signals into a form that the microcontroller can understand.

• Thermometer, barometer, magnetometer, gyroscope, accelerometer, light sensor, you name it

Outside Signal Sensor Voltage

(usually)

Page 8: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

ACTUATOR

• To react to the outside, i.e. providing feedback

• Motor (mainly), heater, buzzer, LED, LCD

Internal Signal Actuator Feedback

Page 9: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

STRUCTURE OF THE COURSE

• There will be two Labs

• Lab 1 will guide you through the usage of sensors ( Week 4 )

• Lab 2 will teach you actuate something based on sensor readings ( Week 8 )

• There will be no Lectures if there are Labs.

• Lab exercises are designed such that you can finish it within 2 hours. ( possibly less )

• There are bonus parts which you can complete to learn extra stuff ( and gain extra points ).

Page 10: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

WHAT WILL YOU DO DURING THE LAB

• Finish the lab exercises and demonstrate the results to the tutors.

• Complete the lab report and hand in to the tutor before you leave

• These tasks are finished in group, so plan the flow with your partner to parallelize the operations.

• Each group will receive an intel Galileo® board next week and you can keep it till the end of the course. You will also use it for the project.

Page 11: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

INITIALIZING THE GALILEO BOARD

Page 12: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

POWER UP THE BOARD

Connect the board to the power adapter. You will see a LED immediately turned on indicating that the board is powered.

Power Port

This tiny little LED will turn on once you have connected the power

Page 13: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

CONNECT TO YOUR COMPUTER

• There is another LED indicating the board is ready. After connected to the power, wait until this LED turns on. Then connect the board and the computer using the provided micro USB cable.

Connect the board to the computer via this port using the USB cable

This LED turns on when the board is ready

Page 14: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

DETECT THE DEVICE

• Go to the device manager window in the computer. Ask someone sitting close to you or the tutor if you do not know how to get to this window.

Page 15: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

DETECT THE DEVICE

• If you connect the board to the computer properly, you will notice there is an unknown device shown in the window.

Page 16: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

UPDATE DRIVER

• Right click the unknown device and click “Update Driver Software…”

Page 17: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

UPDATE DRIVER

• A window pops up and there are two options. Click the “Browse my computer for driver software” option. Leave this window alone for a while.

Click this

Page 18: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

EXTRACTING THE PACKAGE

• Download the Arduino Program Package (a zip file) from the course website and extract the contents inside. (http://www.cse.cuhk.edu.hk/~stmak/ENGG4480/)

Page 19: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

CONTINUE TO UPDATE THE DRIVER

• After the extraction, return to the previous driver installation window. Now, click the browse button and go to the directory:

• <your download destination>\arduino-1.5.3\hardware\arduino\x86\tools

• You may want to ask the tutor if you are not sure if the selected directory is correct or not.

Page 20: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

• Once you are done, click “Next”. You confirm the installation no matter how many windows pop up to ask for your permission. After the installation, the device management window should be like this. Take note of the number following the device “Galileo”.

Make a note of this number

Page 21: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

GO TO THE CODE

• Double click the file “sketch_aug07b.ino”. It should pops up a window like this. This is the Arduino environment to program the Galileo Board. Select the right port to locate the Galileo board. The port is the number you have noted down previously.

Page 22: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

UPDATE THE FIRMWARE

• The board will not work properly until you update the firmware. In the menu bar, click the “Help” tap and then click “Firmware Update”.

Page 23: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

CHECK THE BOARD

• It should take around 5~10 minutes to complete the update process. Once it is done, we can load a built in test program into the board to see if it works. To load the test program, in the menu bar, click the “File” tap. Then, go to “Example” and then “01.Basics”. Finally, click “Blink”.

Page 24: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

YOU SEE THE CODE

• A new window with the test program code will pop up. Do not look into the code unless you are brave enough.

Page 25: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

VERIFY

• There two circle buttons at the top left corner under the menu bar. The button with a tick inside is the verification button. Click this button and the program will translate the code to a set of instructions for the board to execute. If you want to know more about this process, ask the tutor.

Page 26: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

UPLOAD

• After the verification process, click the circle button right next to it with an arrow inside. This is the upload button. By clicking this button, the previously built instructions will be transferred to the board. Go ahead and click this button.

Page 27: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

IT BLINKS!

• Once the uploading process is completed, you will find a LED blinking. Congratulations! You finally get this board working!

You will find this LED blinking

Page 28: Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB Email : csng@cse.cuhk.edu.hk

WANT TO PLAY MORE? JOIN US NEXT TIME!