wirelesss servo controller using xbee « tutorial by cytron

14
8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 1/14 0 0 Home Projects Forum Cytron Technologies Official Website Navigation open all | close all Getting Started rero Buying Guides Product Guides Projects Seminars & Events News Useful Tools / External References Live Search Sign In User Password Remember me Send Become a Member Recover Password Recent Comments Amiy Mechatronics on How to use IR sensor bobby on Control and Monitor via SMS ober on Recovering Your XBee captain zeff on PROJECT 4 – KNIGHT RIDER LIGHT BAR Diego on An Arduino Room Monitoring Web Server Home Projects › Wirelesss Servo Controller Using XBee Tags: servo , Servo controller , SKXBee , wireless , xbee Wirelesss Servo Controller Using XBee Send 11 Like

Upload: blashko-blaze-gjorgjiev

Post on 27-Dec-2015

33 views

Category:

Documents


1 download

DESCRIPTION

Wirelesss Servo Controller Using XBee « Tutorial by Cytron

TRANSCRIPT

Page 1: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 1/14

0 0

HomeProjects

Forum

Cytron Technologies Official Website

Navigation

open all | close allGetting Started

rero

Buying Guides

Product Guides

Projects

Seminars & Events

News

Useful Tools / External References

Live Search

Sign In

User Password

Remember me Send

Become a Member

Recover Password

Recent Comments

Amiy Mechatronics on How to use IR sensorbobby on Control and Monitor via SMS

ober on Recovering Your XBee

captain zeff on PROJECT 4 – KNIGHT RIDER LIGHT BARDiego on An Arduino Room Monitoring Web Server

Home › Projects › Wirelesss Servo Controller Using XBee

Tags: servo, Servo controller, SKXBee, wireless, xbee

Wirelesss Servo Controller Using XBee

Send 11Like

Page 2: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 2/14

Introduction

Ever think to create a wireless servo controller to control movement of servo motor at a distance? If yes, this tutorial is totally applicable to you. In this tutorial, awireless servo controller circuit will be established and a servo motor will be controlled wirelessly from a computer through a Servo Control Panel GUI provided by

Cytron Technologies. The wireless module that will be used is XBee Series 1, a simple wireless communication module which offers point to point and also meshnetwork, simple configuration to communicate, good communication range up to 100 m and space-saving due to its compact size. Plus, a few ready-made modules

by Cytron Technologies like 4 Channels Logic Converter (LC04A),Breadboard Power Stick 5V 3V3 (BPS-5-3), and 8 Channels Servo Controller (SC08A) are

included to facilitate the establishment of wireless servo controller circuit by minimizing the soldering works.

Basically, the concept of wireless controlling of servo motor project in this tutorial can be illustrated by the flow diagram below:

Figure 1: Flow diagram of project wireless controlling of

servo motor

As seen from Figure 1, in the host computer, a command on controlling servo motor assigned by Servo Control Panel GUI will be sent to XBee #1 from XBee #2

through the wireless link established between them with the help of SKXBEE Board. Then, at the servo controlling circuit side, the command received by XBee #1will be sent to a programmed servo controller (SC08A) through UART communication. As the servo controller (SC08A) received the command, it will reacts with aspecified response (depends on the command receive), for example makes the servo connected to it to rotate to a specific position. Sounds interesting? Well, withoutany extra delay, let’s start!!

Hardware Required:

XBee Series 1 (XBEE) – 2

XBee Starter Kit without module (SKXBEE Board) – 1Breadboard Power Stick 5V 3V3 (BPS-5-3) - 14 Channels Logic Converter (LC04A) – 18 Channels Servo Controller (SC08A) – 1

Breadboard – 1Power adapter DC 12V – 1Servo motor – 1

XBee Breakout Board (BB-XBEE) - 1Straight Pin Header (Male) 1×40 Ways – 1Straight 2mm Female Header 1×10 Ways – 2

Jumper (Male-Male)Jumper(Male-Female)External DC power source 4.8 – 6V

Soldering equipmentsComputer

Page 3: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 3/14

XBee Series 1 SKXBEE Board BPS-5-3

LC04A SC08A Breadboard

Power adapter DC 12V Servo motor XBee Breakout Board

Straight 2mm Female Header 1×10 Ways Straight Pin Header (Male) 1×40 Ways

Jumper (Male-Male) Jumper(Male-Female)

Software Required :

XCTU 5.2.7.5 Installer (Win XP, 2000, Vista and 7, 32-bit and 64-bit compatible), can download here.

SC08A sample GUI, can download here.SKXBEE Board USB driver, can download here.

References Related:

SKXBEE Board USB driver installation guide, User manual and other related materials can be downloaded from Cytron Technologies, SKXBEE Board.XBee Series 1 datasheet, X-CTU Config & Test Guide and other related materials can be downloaded from Cytron Technologies, XBee Series 1.Tutorial and Sample Project

**Users are encouraged to read through related references, especially “Tutorial and Sample Project” for better understanding on how to configure XBeemodules and use them for wireless communication in controlling your microcontroller circuit wirelessly through using a computer.

Part I: Install USB Driver for SKXBEE Board

Page 4: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 4/14

1. Download SKXBEE Board USB driver installer.

2. Install the USB driver for SKXBEE Board by following the instructions stated in USB driver installation guide.

Part II : Configure XBees Using X-CTU software

There are two options to configure XBee module which is through using software X-CTU or a microcontoller circuit. Please refer to “Tutorial and Sample Project”under the “References Related” section above.In this tutorial, the option chosen is configuring XBee module using software X-CTU. By the way, why do we need toconfigure XBee module? This question will be clarified in the following paragraphs.

Basic configuration of a XBee involves setting XBee module self- address and destination address (the address of another XBee be transmitted to). For example, thetable below showing the concept of setting basic configuration of two XBee modules (named XBee #1 and XBee #2) for wireless communication between them.

Table 1: The concept of setting basic configuration of twoXBee modules for wireless communicaton

As seen from table 1, it is clear that the destination address of XBee #1 is set to match self-address of XBee #2 , which is “2222″ and also the destination address of

XBee #2 is set to match self addresss of XBee#1, which is “1111″. These address matching are very important so that XBee #1 and XBee #2 are able to associatedwith each other sucessfully to establish wireless link between them for communication when they are powered up.Let’s follow the procedure below to configure twoXBee modules used in this tutorial. The configurations are based on the address setting in Table 1 above.

1. Download X-CTU installer which suits your computer system.

2. Extract the installer.zip file and double-click the .exe setup file in the extracted folder for X-CTU installation.

3. After the installation is completed, please do not launch the X-CTU software yet. Next, connect the SKXBEE Board to the host computer using USB cable (TypeB) and then plug in a XBee module onto the XBee socket of SKXBEE Board as shown below.

Figure 2: Connect SKXBEE Board to the host computer and plug in XBee onto XBee socket

4. After that, launch the X-CTU software through the shortcut on Desktop. A window will appears as below.

Page 5: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 5/14

Figure 3: X-CTU start up window with “PC Setting” tab

5. Choose the USB Serial Port (COM26, in this case) and press the “Test/Query button”. Then, a window will pops up as below.

Figure 4: “COM test” window that showing communication status

6. Click OK and then open the “Terminal” tab. The X-CTU Terminal window appears as shown below.

Page 6: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 6/14

Figure 5: X-CTU Terminal window

7. Enter the command as shown in the sequence below:

**Each line of command will be response with a “OK” message if the command is entered in a correct way.

Line #1: Enter “+++”

Meaning: Initiate AT command mode

Line #2: Enter “atmy1111″ and press “Enter”

Meaning: Setting XBee module address as “1111″

Line #3: Enter “atwr” and press “Enter”

Meaning: Write the XBee module address into non-volatile space

Line #4: Enter “atdl2222″ and press “Enter “

Meaning: Setting destination address (or address of wireless device to be transmitted to) as “2222″ for transmitting purpose

Line #5: Enter “atwr” and press “Enter”

Meaning: Write destination address of XBee for transmission into non-volatile space

Line #6: Enter “atcn” and press “Enter”

Meaning: Terminate the AT command mode

8. The completed command for configuring XBee #1 is shown by the window below:

Page 7: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 7/14

Figure 6: Completed command for configuring XBee #1

9. Remove the XBee #1 from the XBee socket of SKXBEE Board and plug in the XBee #2 onto the same socket. Go back to “PC Setting Tab” of X-CTU

software window and repeat procedure from step 5 to step 7. In step 7, instead of same as previous, do the following modifications for command Line #2 andcommand Line #4:

Line #2: Enter “atmy2222″ and press “Enter”

Meaning: Setting XBee module address as “2222″

Line #4: Enter “atdl1111″ and press “Enter”

Meaning: Setting destination address (or address of wireless device to be transmitted to) as “1111″ for transmitting purpose.

10. The configurations for communication for both XBees are done here. The completed command for configuring XBee #2 is shown by the window below.

Figure 7: Completed command for configuring XBee #2

Part III: Establish the Wireless Servo Controller Circuit

1. Let’s start with some soldering works so as to make the 4 Channels Logic Converter (LC04A) and the XBee fitable to breadboard.

**LC04A is used in this tutorial for the UART communication between the SC08A (5V device) and the XBee (3.3V) by converting logic level 5V to 3.3V orvice versa.

2. LC04A is included with two 1 x 6 ways header pin (Male) when purchased. Solder these two header pin onto LC04A. The resulted LC0A is shown as below.

Figure 8: Top view and bottom view of soldered LC04A

Page 8: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 8/14

3. Regarding the XBee breakout board, firstly, insert each 2mm 1 x 10 ways header (Female) into the leftmost and the rightmost unlabeled holes array (that designed

to suit 2mm 1×10 ways header (Female) or XBee) from the “Up” side of breakout board. Solder the 2mm headers from the “Down” side of breakout board.

Figure 9: Insert 2mm headers (Female) onto XBee breakout board

**XBee breakout board is used to make the XBee fitable to breadboard since the original header pins separation of XBee module is 2mm while the holesseparation of breadboard is 0.1 inch, approximately 2.5mm.

4. Then, cut two 1 x 1o ways header pin (Male) from a 1 X 40 ways header pin (Male). Insert each resulted 1 x 10 ways header pin (Male) into the left and rightlabeled holes array from the “Down” side of breakout board. Solder the header pins from the “Up” side of breakout board.

Figure 10: Insert header pins (Male) onto XBee breakout board

5. The soldered XBee breakout board is shown as below.

Figure 11: The soldered XBee breakout board

6. Plug in the Breadboard Power Stick 5V 3V3 (BPS-5-3), LC04A and XBEE breakout board onto the breadboard as shown below.

Figure 12: Breadboard Power Stick (BPS-5-3), LC04A and XBEE breakout board onbreadboard

**BPS-5-3 is used to provide regulated voltages of 5V and 3.3V so as to power up SC08A (5v device) and XBee (3.3V device).

Page 9: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 9/14

7. Based on the schematic provided in Figure 13 and connection diagrams in Figure 14, complete the connections of wireless servo controller circuit using jumper.

Figure 13: Wireless servo controller circuit schematic

a) Connection of the external power source and servo b) Connection of UART at SC08A

at SC08A (Don’t turn on the external power source yet)

Page 10: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 10/14

c) Connection at LC04A d) Connection at XBee breakout board

Figure 14: Connection diagrams

**Voltages 5V and 3.3V are provided by the Breadboard Power Stick 5V 3V3(BPS-5-3)

**Here is provided with short description on the usage of 4 Channels Logic Converter (LC04A). LC04A is bidirectional, thus able to steps down 5Vsignals to 3.3V or steps up 3.3V signals to 5V. It works fine with 2.8V and 1.8V devices also. This feature is important in interfacing process between two

devices with different logic level voltages ( for eg: 5V and 3.3V), especially in typical serial communications like I2C, SPI, UART and so on. Hence,LC04A is used in this tutorial for UART communication between 8 Channels Servo Controller (SC08A, a 5V device) and XBee Series 1(a 3.3V) devices.

As shown in Figure 14c), LC04A is powered up with two voltages with 5V at the HV (+) pin and 3.3V at the LV (+) pin.

Note:

**HV (+) pin can be connected to voltage up to 5V only while LV (+) pin can be connected to voltage as low as 1.8V.

**LV (+) voltage must be lower than HV (+) voltage.

Both (-) pins at HV and LV sides must be connected to ground since that pins are not internally connected. In this case, 3rd & 4th channels that involves

pins LT2, LR2 at LV side and pins HT2 and HR2 at HV side are used. Connections of stated pins are shown below:

LT2 -> DOUT of XBee

LR2 -> DIN of XBee

HT2 -> RX of SC08A

HR2-> TX of SC08A

Example of operation:

When the XBee (3.3V system) outputs a logic high (3.3V) through its DOUT pin, a logic high (5V) will be detected at the RX pin of SC08A (5V system).Logic conversion is achieved and thus allows interfacing between XBee and SC08A.

8. The complete circuit is shown in Figure 15 below.

Figure 15: The complete circuit of wireless servo controller

Page 11: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 11/14

Figure 16: The complete circuit of wireless servo controller design using Fritzing

9. Plug in the XBee #1 onto the XBee breakout board and then connect the Breadboard Power Stick (BPS-5-3) with a power adapter DC12V, subsequently turn

on the power adapter so as to power up LC04A, XBee #1 and SC08A. The power indicators (green leds) on both BPS-5-3 and SC08A are turned on.

10. Turn on the external power source (4.8-6V) for servo power supply of SC08A. The servo power indicator (orange led) will turned on. The servo motor may

rotate due to position initialization of SC08A on the servo motor connected to it.

Part IV: Controlling Servo Motor Wirelessly Through Servo Control Panel GUI

1. Extract the downloaded SC08GUI_VB2010.zip.

2. In the extracted folder, there have a folder named “SC08A VB project1″ and a SC08A_GUI.exe file . Double-click the SC08A_GUI.exe to launch the ServoControl Panel GUI. The Servo Control Panel GUI will appears as shown below.

Page 12: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 12/14

Figure 17: Servo Control Panel GUI

2. Plug in the XBee #2 onto the XBee socket of SKXBEE Board.

3. Connect the SKXBEE Board to the host computer through using a USB cable (Type B).

4. Click the “Search” button in the Servo Control Panel GUI. Choose the COM port installed for SKXBEE Board from the combo box beside the “Search button”.In this demonstration, “COM26″ is choosen.

5. Then, click the “Connect” button and message “COM26 connected” in this case will apppears in the textbox below the “Connect” button. Click the “Activate”

button for Channel 1 to activate SC08A Channel 1 (since the servo is connected to SC08A Channel 1 in this demonstration).

6. After the Channel 1 is sucessfully activated, try to move the “Position control” scroll bar to assign desired position for servo Channel 1 . As the result the servomotor connected to Channel 1 of SC08A will rotates to reach the position assigned.

**Commands related to servo motor controlling like servo channel activation/deactivation, servo position assignation or reset and so on will be transmitted to XBee#1 from XBee #2 through wireless link established between them, and from XBee #1 to SC08A through the UART communication internally. As the commandreceived by SC08A, it will controls the servo motor connected to it accordingly.

Page 13: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 13/14

0 0

Figure 18: Setting for Servo Controller Panel GUI

7. The aim to establish a wireless servo controller to control servo motor is achieved. Users can try to connect the servo motor to another channel of SC0A and then

activate that channel through Servo Control Panel GUI. Then, try to move the “Position control” scroll bar for that channel. Same result will be seen.

That’s all from me. Have a nice day. See you next time.

Send via E-mail programPost to BloggerAdd to Evernote

Add to Tumblr

Related Posts:

Wireless RFID Reader Using XBees

Getting Started with XBee-WiFi

XBee Series 2 Point to Point Communication

Example GUI Project 2

PROJECT 14 – WIRELESS TEMPERATURE LOGGING

Published by: Suan Kian on July 26, 2012.

3 Responses to “Wirelesss Servo Controller Using XBee”

Send 11Like

Page 14: Wirelesss Servo Controller Using XBee « Tutorial by Cytron

8/7/2014 Wirelesss Servo Controller Using XBee « Tutorial by Cytron

http://tutorial.cytron.com.my/2012/07/26/wirelesss-servo-controller-using-xbee/ 14/14

1. Senthil says:

February 10, 2013 at 3:24 pm

Hello,

I would like to know if we can replace the transmitter part using a potentiometer , do you have a product for that ? Or if you can guide us the message formatwe can see if we can build one ourself

2. ober says:February 14, 2013 at 10:00 am

hi, we do not have example using potentiometer to control servo directly. You will need a microcontroller to read the voltage from potentiometer and translate

into Servo controller command and send to XBee or SKXBee. You can always discuss in our technical forum: http://forum.cytron.com.my

3. dennis says:March 1, 2013 at 4:03 pm

Hello,

was wondering if you could share the Fritzing models for all your products? as i am doing a project and need them. or you could email me the files.Thanks

Leave a Reply

Name (required)

Mail (will not be published) (required)

Website

Submit Comment

Help us improve the wiki Send Your Comments

© 2012 Tutorial by Cytron | Powered By Wordpress