Magnets, sensors create paths for automated guided vehicles

12/19/2013


Script source

The source code below is written in Roboteq's MicroBasic language and runs inside the motor controller to perform the AGV functionality described in this article.

 

option explicit

' This script provide basic control for an AGV.

' Motor will turn on upon the presence of a track and stop when track disappears.

' The track position information is used to provide left/right steering.

' At forks, the AGV will follow the left or right track depending whether the last

' marker detected was on the left or right side of the track.

' Make sure you precede merges with a marker so that the AGV remains on the main track.

' The presence of a left and right marker simultaneously will cause the AGV to stop for

' 30 seconds or until the operator presses the button

' declare variables

dim Gain as integer

dim DefaultThrottle as integer

dim TapeDetect as boolean

dim MarkerLeft as boolean

dim MarkerRight as boolean

dim Throttle as integer

dim Tape_Position as integer

dim LineSelect as integer

dim Steering as integer

dim GoButton as boolean

dim RunState as boolean

dim NotOnStopMarker as boolean

dim PauseTime as integer

 

' initialize constants

Gain = -7 ' Use negative value to invert steering command

DefaultThrottle = 250 ' Motor power level while the AGV runs

LineSelect = 1 ' Use left track by default

PauseTime = 30000 ' in milliseconds

' main loop to repeat every 10ms

top:

wait(10)

' read sensor data

TapeDetect = getvalue(_MGD)

MarkerLeft = getvalue(_MGM, 1)

MarkerRight = getvalue(_MGM, 2)

 

' Read button state

GoButton = getvalue(_DI, 2)

 

if (GoButton) then SetTimerCount(1, 0) ' Pressing the button will clear the pause timer

if GetTimerState(1) then RunState = true ' When pause timer is cleared, AGV is allowed to run

 

' Use TapeDetect and Pause Timer to apply throttle or not

if (TapeDetect and GetTimerState(1))

                  Throttle = DefaultThrottle

else

                  Throttle = 0

end if

 

' Check Marker presence to select Left or Right track

if (MarkerLeft) then LineSelect = 1

if (MarkerRight) then LineSelect = 2

 

' Detect when transitioning onto stop markers

if (NotOnStopMarker and MarkerLeft and MarkerRight)

                  NotOnStopMarker = false ' Mark stop marker detection so that it is not detected again until AGV moved away

                  SetTimerCount(1, PauseTime) ' Load stop timer timeout value

                  RunState = false

else

                  NotOnStopMarker = true

end if

 

Tape_Position = getvalue(_MGT, LineSelect)

 

' use tape position multiplied with gain as steering

Steering = Tape_Position * Gain

 

' Send throttle and steering to controller Configured in Mixed mode

setcommand(_G, 1, Throttle)

setcommand(_G, 2, Steering)

 

' Log output. Useful for troubleshooting. Comment out when done.

print("\r", TapeDetect,"\t", Tape_Position,"\t", MarkerLeft,"\t", MarkerRight,"\t", Throttle,"\t", Steering,"\t",RunState,"\t",LineSelect)

 

goto top ' Loop forever

 

- Cosma Pabouctsidis is senior technologist, Roboteq Inc.  Edited by Mark T. Hoske, content manager, CFE Media, Control Engineering, mhoske(at)cfemedia.com.

ONLINE

www.roboteq.com

Search AGV at www.controleng.com for other AGV advice.


<< First < Previous 1 2 3 Next > Last >>

No comments
The Top Plant program honors outstanding manufacturing facilities in North America. View the 2013 Top Plant.
The Product of the Year program recognizes products newly released in the manufacturing industries.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
The true cost of lubrication: Three keys to consider when evaluating oils; Plant Engineering Lubrication Guide; 11 ways to protect bearing assets; Is lubrication part of your KPIs?
Contract maintenance: 5 ways to keep things humming while keeping an eye on costs; Pneumatic systems; Energy monitoring; The sixth 'S' is safety
Transport your data: Supply chain information critical to operational excellence; High-voltage faults; Portable cooling; Safety automation isn't automatic
Case Study Database

Case Study Database

Get more exposure for your case study by uploading it to the Plant Engineering case study database, where end-users can identify relevant solutions and explore what the experts are doing to effectively implement a variety of technology and productivity related projects.

These case studies provide examples of how knowledgeable solution providers have used technology, processes and people to create effective and successful implementations in real-world situations. Case studies can be completed by filling out a simple online form where you can outline the project title, abstract, and full story in 1500 words or less; upload photos, videos and a logo.

Click here to visit the Case Study Database and upload your case study.

Maintaining low data center PUE; Using eco mode in UPS systems; Commissioning electrical and power systems; Exploring dc power distribution alternatives
Synchronizing industrial Ethernet networks; Selecting protocol conversion gateways; Integrating HMIs with PLCs and PACs
Why manufacturers need to see energy in a different light: Current approaches to energy management yield quick savings, but leave plant managers searching for ways of improving on those early gains.

Annual Salary Survey

Participate in the 2013 Salary Survey

In a year when manufacturing continued to lead the economic rebound, it makes sense that plant manager bonuses rebounded. Plant Engineering’s annual Salary Survey shows both wages and bonuses rose in 2012 after a retreat the year before.

Average salary across all job titles for plant floor management rose 3.5% to $95,446, and bonus compensation jumped to $15,162, a 4.2% increase from the 2010 level and double the 2011 total, which showed a sharp drop in bonus.

2012 Salary Survey Analysis

2012 Salary Survey Results

Maintenance and reliability tips and best practices from the maintenance and reliability coaches at Allied Reliability Group.
The One Voice for Manufacturing blog reports on federal public policy issues impacting the manufacturing sector. One Voice is a joint effort by the National Tooling and Machining...
The Society for Maintenance and Reliability Professionals an organization devoted...
Join this ongoing discussion of machine guarding topics, including solutions assessments, regulatory compliance, gap analysis...
IMS Research, recently acquired by IHS Inc., is a leading independent supplier of market research and consultancy to the global electronics industry.
Maintenance is not optional in manufacturing. It’s a profit center, driving productivity and uptime while reducing overall repair costs.
The Lachance on CMMS blog is about current maintenance topics. Blogger Paul Lachance is president and chief technology officer for Smartware Group.