background image

 

ROBOT . HEAD to TOE

 

Product User’s Manual – 

Shield-Servo

 

 

 
6.2 Sample Program for Arduino UNO/CT-UNO

 

 
Driving Servo motor is common necessity in most robotic project based on the embedded system

 

 

   

 

   

 

 

 

   

 

 

 

which uses microcontroller. Considering this reason, Cytron Technologies has also developed

 

 

 

 

 

 

 

 

 

 

 

the sample source code for Arduino. This sample program is developed for

CT-UNO

. If user

 

 

 

 

 

 

 

 

   

 

 

   

 

uses different microcontroller, user may need to modify the sample program based on that

 

 

 

 

 

   

 

 

 

 

 

 

 

particular microcontroller by referring to its datasheet released by manufacturer. 
 
The sample program will control Shield-Servos.  
 

a. We have created a sample sketch for Arduino to communicate with Shield-Servo 

through software UART. The sample code can be downloaded from 

Shield-Servo's 

product page

 or 

Cytron Github repository

. 

 
b. Download the files and extract the zipped file. 
 
c. There are 1 files  available for  the user;  

Shield Servo Example.ino. 

For immediate 

testing, user may load the sketch into Arduino board. 

 
d.  The sample program is based on CT-UNO, an Arduino UNO compatible board. We will 

discuss about how to control Shield-Servos and Servo motor using a CT-UNO through 
UART interface. 

 
e. Ensure the hardware interface for microcontroller to Shield-Servo is setup properly. The 

power  for  Servo  motor  is  also needed.   

 
f.  Power indicator LED on Shield-Servo will turn ON when power is supply to board. 
 
g.  Please  refer  to  

protocol of Shield-Servo

 for  details  on  method  to  send/receive 

command to Shield-Servo. 

 
h.  User must install Arduino IDE if user wants to modify and compile this sample program. 

The free Arduino IDE can be obtained from Arduino official website. You can download 
Arduino Software (IDE) from 

http://www.arduino.cc 

 

 
 
 
 

 

 
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved

17

 

Содержание SHIELD-Servo

Страница 1: ...SHIELD Servo Servo Controller Shield User s Manual V1 1 April 2018...

Страница 2: ...10 5 Installation hardware 11 5 1 Setting up Shield Servo 11 5 2 Connecting to Arduino UNO CT UNO using Signal Pin 12 5 3 Connecting to External Switches 12 5 4 Connecting to Computer through UART 13...

Страница 3: ...control over 6 pin UART with USB to Serial converter UC00A UC00B UC00C or other types of microcontroller UART interface present a flexible fast and easy to use feature This Servo shield has been desig...

Страница 4: ...is able to have more extensive control of the Servo driver and Servo motor User can leave most part of the Servo control algorithm to Shield Servo It saves much software resources on the host For exa...

Страница 5: ...bots Besides signal wire a RC Servo has other two leads for power and ground The control signal is a continuous stream of pulses that are 1 to 2 milliseconds long repeated approximately fifty times pe...

Страница 6: ...ts missing please contact us at sales cytron io immediately Shield Servo comes with 1 x SHIELD Servo board with every component is soldered properly and tested before board is shipped User s Manual an...

Страница 7: ...round for both logic operation and Servo motor power source If power is connect correctly the PWR LED should light up Signal Input Pins Function Description Label Definition Function TX Transmit Pin T...

Страница 8: ...It should be connected to host s transmit pin RX UART Receive Pin connected to Shield servo transmit pin It should be interfaced to 5V logic UART It should be connected to host s receive pin VSEL Sys...

Страница 9: ...ignal K Solder if use internal power A A DIP switch used to select TX and RX pin for Shield Servo B An 8 ways connector for user to connect particular Servo motor Please insert the wire properly by re...

Страница 10: ...lf test When it is pressed and release Shield Servo will start to drive every servo motor connected in predetermined movement and speed H A small green LED to indicate status of power for logic operat...

Страница 11: ...ROBOT HEAD to TOE Product User s Manual Shield Servo 4 1 DIMENSION Created by Cytron Technologies Sdn Bhd All Rights Reserved 10...

Страница 12: ...dicator PWR will light on if the 5V power source available Servo motors can be driven by power source from VM and GND The power source will be regulated via on board switching converter to 5V with max...

Страница 13: ...and D11 or D12 and D13 and utilize the software serial from Arduino library as alternative UART communicatin Please refer to tutorial of software serial from Arduino website for details of using softw...

Страница 14: ...ou may connect more than one UC00A UC00C to your computer and control more than one Shield Servo at the same time A Graphical User s Interface GUI comes together with the source code is provided for u...

Страница 15: ...s developed a Shield Servo GUI using VB net for user to control Shield Servo from computer through virtual COM Port The following steps will guide user to run Shield Servo GUI and use it 1 Extract the...

Страница 16: ...being setup correctly and power to Servo motor is connected If you are using UC00A UC00C driver must be installed 6 After hardware installation choose the correct COM Port Normally the extra virtual...

Страница 17: ...how COMxx connected 8 Now Shield Servo GUI is ready to control the Servo motor using Shield Servo User may on off the motor Active deactive the individual motor change position set motor rotation spee...

Страница 18: ...repository b Download the files and extract the zipped file c There are 1 files available for the user Shield Servo Example ino For immediate testing user may load the sketch into Arduino board d The...

Страница 19: ...d UC00A UC00C driver user is ready to use Shield Servo with computer laptop a Setup Shield Servo according to steps in 5 4 Connect UC00A UC00C to Shield Servo another end of UC00A UC00C to PC b Power...

Страница 20: ...fer to the source code and modify it or write a new program to create own GUI for own application The GUI is written with Microsoft Visual Studio Community 2015 Any older version than this may not be...

Страница 21: ...00000000 0 00 2 Mode Servo channel 0 to active all Turn ON the Servo motor 1 st Byte send 110XXX XX 193 200 C1 C8 1 activate servo 1 st Byte send 00000001 1 01 3 Mode Servo channel 0 to active all Po...

Страница 22: ...annel 1 to 8 represented by the decimal value ii 2nd byte On Off only the LSB is valid 0b 0 0 0 0 0 0 0 X 1 Activate servo motor 0 Deactivate servo motor Position and speed command a The command is be...

Страница 23: ...lse generated Duty cycle resolution x servo position 0 5ms 0 25us x servo position 0 5ms 2nd Byte 7 MSB of servo position 0b 0 X X X X X X X 12 11 10 9 8 7 6 3rd Byte 6 LSB of servo position 0b 0 0 X...

Страница 24: ...starting position command a This command is useful for user to initialize the starting position of servo motors To initialize starting position the command is being sent in packet format Each packet c...

Страница 25: ...iss use is not covered under warranty Warranty does not cover freight cost for both ways Prepared by Cytron Technologies Sdn Bhd www cytron io No 1 Lorong Industri Impian 1 Taman Industri Impian 14000...

Отзывы: