![]() |
|
George Vastianos |
---|
Dipl. from Electronics Department, Faculty of Technological Applications, Technological Educational Institute of Piraeus, Greece www.vastianos.com |
Table of contents
0. Abstract
1. Robot's hardware
1.1 The Mini SSC II Serial Servo Controller
1.2 Hardware implementation of CRAWLY robot
2. Robot's software
2.1 Locomotion mathematical model
2.2 Software implementation of CRAWLY robot
3. References
Keywords: Artificial intelligence & life, crawling type robots, mobile robotic systems, micro-robotics.
0. Abstract
CRAWLY is a robotic caterpillar. The locomotion mathematical model of this robot is based on a sinusoidal type of formula that makes it capable to scrawl on a variety of different types of terrain. CRAWLY robot is constructed by six small servos and is controlled through an SSC II serial servo controller. The robot's 0,5Kgr body is divided in seven segments and is 60cm long. Modifications in CRAWLY's locomotion mathematical model can make its chassis capable to travel inside pipes for telepresence access in earthquake affected buildings.
1. Robot's hardware
1.1 The Mini SSC II Serial Servo Controller
The Mini SSC II (serial servo controller) is a small pre-assembled dedicated servo controller. This handy little device makes controlling servos from a microcontroller or a PC serial port practically plug and play. The servos can be easily positioned by sending simple instructions as illustrated below.
How does it work? Controlling servos from a microcontroller is not difficult, however when the number of servos that need to be controlled grows, the general purpose microcontroller can become bogged down servicing the servos, leaving no time for monitoring sensors or other I/O. The SSC takes care of the timing and leaves the host computer free to deal with other issues.
The modular connector makes controlling the SSC from a PC very easy. Simply plug the cable into the serial port and the SSC, and sending positioning data to the serial port as follows:
Byte1 = Sync (255)
Byte2 = Servo #(0-7)
Byte3 = Position (0-254)
So sending a 255,3,180 would move servo 3 to position 180, sending 255,6,25 would move servo 6 to position 25. Any computer or programming language that can send serial data at 2400 or 9600 baud can be used. The SSC is addressable to allow up to sixteen servos to be controlled from one serial port, or one pin on a microcontroller. Special order units allow control of up to 255 servos from a single port.
The Mini SSC is a trademark and product of Scott Edwards Electronics Inc., AZ-USA, (www.seetron.com).
1.2 Hardware implementation of CRAWLY robot
The robot's brain is based on the SSC II serial servo controller that described above. The controller is connected through an RS-232 connection with a personal computer that runs the robot's Control Panel software. The controller is connected with the PC through the RJ11 connector. The range of servos' motion is defined for 180 degrees, so the R jumper is on. The servo addresses identification is defined for 0-7, so I jumper is off. And the communication speed is defined in 9600 baud, so the S jumper is on. The robot uses six servos with servo addresses 0-5. The electronics setup of the robot is illustrated bellow:
The robot's body is consisted by seven segments and has a total length of 60cm. The three of the seven segments have been constructed by connecting two servos back-to-back. The rest four segments have been constructed by pieces of aluminum. The head and tail segments carry two small plastic boxes for cable connections and the SSC II servo controller. The mechanical setup of the robot is illustrated bellow:
2. Robot's software
2.1 Locomotion mathematical model
After a lot of experiments on testing different functions for the locomotion of the robot's chassis, I developed a sinusoidal type of formula that gives the most effective locomotion. So the locomotion mathematical model of this crawling type robot has the following formula format:
In the above formula, n is the servo index number:
y is the position value that is transmitted to the SSC II controller:
and x is the step index number:
The alpha factor is equal to:
where Vol is the volume and Inv is an Inversion factor that added in the function to overcome the problem of the back-to-back mechanical installation of the servos.
The theta factor (phase) is equal to:
where Dir is the direction factor (0 = forward crawling, 1 = backward crawling).
And the beta factor is equal to:
where ZP is the zero position from where each axis moves relatively from +Vol to -Vol, and ZPE is the zero position error of each axis that depends from the servo's mechanical construction tolerance.
From all the above equations the final form of the locomotion mathematical model formula is the following:
2.2 Software implementation of CRAWLY robot
The robot's control software (Control Panel) has been developed in Visual Basic 6. The program's GUI includes six buttons for the easy control of the robot. The "Port" button is used for the definition of the serial port and the "Mode" button is used to define if the robot will crawl only one step at a time or it will crawl continuously. The "Straighten Body" is used to put the robot's body in a "rest" position and the "Crawl Forward", "Crawl Backward" and "Stop Crawl" buttons are used for the crawling. A screenshot of the Control Panel software is illustrated bellow:
The source code of the Control Panel software is listed bellow:
File: crawlybot.vbp
Type=Exe Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\SYSTEM\stdole2.tlb#OLE Automation Object={648A5603-2C6E-101B-82B6-000000000014}#1.1#0; MSCOMM32.OCX Form=crawlybot.frm IconForm="frmCrawlybot" Startup="frmCrawlybot" HelpFile="" Title="CRAWLY Caterpillar Robot" ExeName32="crawlybot.exe" Command32="" Name="prjCrawlybot" HelpContextID="0" Description="CRAWLY Caterpillar Robot - [Control Panel]" CompatibleMode="0" MajorVer=1 MinorVer=0 RevisionVer=0 AutoIncrementVer=0 ServerSupportFiles=0 VersionFileDescription="CRAWLY Caterpillar Robot - [Control Panel]" VersionLegalCopyright="(c) 2002 by George Vastianos" VersionProductName="CRAWLY Caterpillar Robot" CompilationType=0 OptimizationType=0 FavorPentiumPro(tm)=0 CodeViewDebugInfo=0 NoAliasing=0 BoundsCheck=0 OverflowCheck=0 FlPointCheck=0 FDIVCheck=0 UnroundedFP=0 StartMode=0 Unattended=0 Retained=0 ThreadPerObject=0 MaxNumberOfThreads=1 DebugStartupOption=0
File: crawlybot.frm
VERSION 5.00 Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX" Begin VB.Form frmCrawlybot BorderStyle = 1 'Fixed Single Caption = "CRAWLY Caterpillar Robot - [Control Panel]" ClientHeight = 2865 ClientLeft = 45 ClientTop = 330 ClientWidth = 5895 Icon = "crawlybot.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False Picture = "crawlybot.frx":0442 ScaleHeight = 2865 ScaleWidth = 5895 StartUpPosition = 3 'Windows Default Begin MSCommLib.MSComm cntPort Left = 5280 Top = 2280 _ExtentX = 1005 _ExtentY = 1005 _Version = 393216 DTREnable = -1 'True End Begin VB.Timer tmrTimer Enabled = 0 'False Left = 4800 Top = 2400 End Begin VB.CommandButton cmdPort BackColor = &H00FFC0C0& Caption = "&Port: COM1" Height = 375 Left = 120 Style = 1 'Graphical TabIndex = 0 Top = 120 Width = 1815 End Begin VB.CommandButton cmdMode BackColor = &H00FFC0C0& Caption = "&Mode: Continuous" Height = 375 Left = 2040 Style = 1 'Graphical TabIndex = 1 Top = 120 Width = 1815 End Begin VB.CommandButton cmdStopCrawl BackColor = &H00FFC0C0& Caption = "&Stop Crawl" Enabled = 0 'False Height = 375 Left = 2040 Style = 1 'Graphical TabIndex = 5 Top = 2400 Width = 1815 End Begin VB.CommandButton cmdCrawlBackward BackColor = &H00FFC0C0& Caption = "Crawl &Backward" Height = 375 Left = 3960 Style = 1 'Graphical TabIndex = 4 Top = 2400 Width = 1815 End Begin VB.CommandButton cmdCrawlForward BackColor = &H00FFC0C0& Caption = "Crawl &Forward" Height = 375 Left = 120 Style = 1 'Graphical TabIndex = 3 Top = 2400 Width = 1815 End Begin VB.CommandButton cmdStraightenBody BackColor = &H00FFC0C0& Caption = "S&traighten Body" Height = 375 Left = 3960 Style = 1 'Graphical TabIndex = 2 Top = 120 Width = 1815 End End Attribute VB_Name = "frmCrawlybot" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False '*************************** '* C R A W L Y * '* Caterpillar Robot * '* [Control Panel] * '* R&D by George Vastianos * '*************************** 'Define global variables and constants Dim x As Integer Dim y As Byte Dim n As Byte Const Axes = 6 Const Vol = 32 Const ZP = 128 Dim ZPE(0 To Axes - 1) As Integer Dim Dir As Byte Private Sub Robot_Init() 'Servo(0) = Head of caterpillar 'Servo(1-4) = Body of caterpillar 'Servo(5) = Tail of caterpillar 'Define zero position errors ZPE(0) = 6 ZPE(1) = -11 ZPE(2) = 1 ZPE(3) = -3 ZPE(4) = -8 ZPE(5) = 12 'Init timer tmrTimer.Enabled = False tmrTimer.Interval = 20 x = 360 End Sub Private Sub Robot_StartMove() cmdPort.Enabled = False cmdMode.Enabled = False cmdStraightenBody.Enabled = False cmdCrawlForward.Enabled = False cmdStopCrawl.Enabled = True cmdCrawlBackward.Enabled = False On Error Resume Next cntPort.PortOpen = True tmrTimer.Enabled = True End Sub Private Sub Robot_StopMove() tmrTimer.Enabled = False On Error Resume Next cntPort.PortOpen = False cmdPort.Enabled = True cmdMode.Enabled = True cmdStraightenBody.Enabled = True cmdCrawlForward.Enabled = True cmdStopCrawl.Enabled = False cmdCrawlBackward.Enabled = True End Sub Private Sub cmdPort_Click() If cmdPort.Caption = "&Port: COM1" Then cmdPort.Caption = "&Port: COM2" cntPort.CommPort = 2 Else cmdPort.Caption = "&Port: COM1" cntPort.CommPort = 1 End If End Sub Private Sub cmdMode_Click() If cmdMode.Caption = "&Mode: Continuous" Then cmdMode.Caption = "&Mode: Step" Else cmdMode.Caption = "&Mode: Continuous" End If End Sub Private Sub cmdCrawlForward_Click() Dir = 0 x = 0 Call Robot_StartMove End Sub Private Sub cmdCrawlBackward_Click() Dir = 1 x = 0 Call Robot_StartMove End Sub Private Sub cmdStopCrawl_Click() Call Robot_StopMove Call cmdStraightenBody_Click End Sub Private Sub cmdStraightenBody_Click() On Error Resume Next cntPort.PortOpen = True For n = 0 To 5 cntPort.Output = (Chr(255) & Chr(n) & Chr(ZP + ZPE(n))) Next n cntPort.PortOpen = False End Sub Private Sub Form_Load() Call Robot_Init End Sub Private Sub Form_Unload(Cancel As Integer) Call cmdStopCrawl_Click End Sub Private Sub tmrTimer_Timer() On Error Resume Next If x = 360 Then x = 0 End If Dim Pi Pi = 3.14159 For n = 0 To 5 y = CInt((-1) ^ n * Vol * Sin((x + ((-1) ^ Dir) * n * (360 / Axes)) * (Pi / 180))) + ZP + ZPE(n) cntPort.Output = (Chr(255) & Chr(n) & Chr(y)) Next n x = x + 10 If ((x = 360) And (cmdMode.Caption = "&Mode: Step")) Then Call cmdStopCrawl_Click End If End Sub
3. References
|