Simple Logic Elevator Group 10: Zhen Yu Wu Wai Seng Ho Tat Chi Chio.
-
date post
20-Dec-2015 -
Category
Documents
-
view
217 -
download
1
Transcript of Simple Logic Elevator Group 10: Zhen Yu Wu Wai Seng Ho Tat Chi Chio.
Simple Logic ElevatorSimple Logic Elevator
Group 10: Zhen Yu WuGroup 10: Zhen Yu Wu
Wai Seng HoWai Seng Ho
Tat Chi ChioTat Chi Chio
OverviewOverviewProposalProposalSpecificationsSpecificationsFeaturesFeaturesDesign ProcessDesign ProcessComputer CodeComputer CodeCircuit DiagramCircuit DiagramAutoCADAutoCADCost EstimateCost EstimateConclusionConclusion
ProposalProposal
A three-floored elevatorA three-floored elevator
One door with safety sensorOne door with safety sensor
IndicatorIndicator
Suitable for parking garage, subway Suitable for parking garage, subway station, etc.station, etc.
SpecificationsSpecifications
Prototype is controlled by BS2Prototype is controlled by BS2
Safety circuitrySafety circuitry
Instantaneous automatic and manual Instantaneous automatic and manual controlcontrol
Included actuators and sensorsIncluded actuators and sensors
Feedback systemFeedback system
Design ProcessDesign Process
Mechanical constructionMechanical construction1.1. TrackTrack
2.2. Elevator boxElevator box
3.3. Sliding doorSliding door
Design processDesign process
Programming & Electrical circuitProgramming & Electrical circuit1.1. ElevationElevation
2.2. Door movementDoor movement
3.3. Status indicationStatus indication
4.4. BS2 protectionBS2 protection
5.5. User interface hardwareUser interface hardware
Computer CodeComputer Code'{$STAMP BS2}debug "start program", crposition var nibrct var wordx var wordn var worda var bitlog var bit(6)ptr var nibptr=0position=1for x=0 to 5'initialize array to all 0slog(n)=0next
high 7
mainloop:gosub check0'constantly checking user inputs
start:for n=ptr to 5 'set pointer to the first destinationif log(n)=1 then setptrnext
for n=0 to ptr 'set pointer to the first destinationif log(n)=1 then setptrnextif in8=0 then alarm
loop:debug "floor = ",dec position,tab, "pointer ", dec ptr, crif (position=1) and (ptr=2 or ptr=3) then goup1fif (position=1) and (ptr=4 or ptr=5) then goup2fif (position=2) and (ptr=0 or ptr=1) then godown1fif (position=2) and (ptr=4 or ptr=5) then goup1fif (position=3) and (ptr=0 or ptr=1) then godown2fif (position=3) and (ptr=2 or ptr=3) then godown1fif a=1 then stopelevatorif (position=1) and (ptr=0 or ptr=1) then donothingif (position=2) and (ptr=2 or ptr=3) then donothingif (position=3) and (ptr=4 or ptr=5) then donothinggoto mainloop
goup1f:gosub close_doorfor x=1 to (8*42)pulsout 11, 300pause 10gosub check0nextgosub open_doorposition=position+1goto start
goup2f:gosub close_doorfor x=1 to (16*42)pulsout 11,300pause 10gosub check0nextgosub open_doorposition=position+2goto start
godown1f:gosub close_doorfor x=1 to (8*36)pulsout 11, 1700pause 10gosub check0nextgosub open_doorposition=position-1goto start
godown2f:gosub close_doorfor x=1 to (16*37)pulsout 11, 1700pause 10gosub check0nextgosub open_doorposition=position-2goto start
check0:
if (in0=1 and log(0)=0) then location0check1:if (in1=1 and log(1)=0) then location1check2:if (in2=1 and log(2)=0) then location2check3:if (in3=1 and log(3)=0) then location3check4:if (in4=1 and log(4)=0) then location4check5:if (in5=1 and log(5)=0) then location5return
location0:log(0)=1if ptr>=4 then setptrto0goto check1
location1:log(1)=1if ptr>=4 then setptrto0goto check2
location2:log(2)=1if ptr>=4 then setptrto0goto check3
location3:log(3)=1if ptr>=4 then setptrto0goto check4
location4:log(4)=1if ptr>=4 then setptrto0goto check5
location5:log(5)=1if ptr>=4 then setptrto0return
setptrto0:ptr=0goto mainloop
setptr:ptr=ngoto loop
alarm:a = 1freqout 9,200,2900ptr = 1debug "alarm", crgoto loop
stopelevator:stop
open_door:out7=1for x=1 to 100pulsout 10, 1200pause 10nextlog(ptr)=0for x=1 to 500gosub check0nextreturn
open:for x=1 to 100pulsout 10, 1200pause 10nextclose_door:for n=1 to 100pulsout 10, 400pause 10high 6RCtime 6,1,rctif (rct>5000) or (rct=0) then opennextdebug "here"out7=0return
donothing:log(ptr)=0goto mainloop
Cost EstimateCost Estimate
Components Price Quantities subtotal, dollars
Button 1.4 6 8.4
LED 1 8 8
Servo-Motor 12 2 24
Continuous Motor 13 1 13
Photodiode 1.5 1 1.5
Resistors 0.2 8 1.6
Construction Materials 35 boards 35
Cost EstimateCost Estimate
Components Price Quantities subtotal, dollars
Capacitors 0.25 1 0.25
Piezo-Speaker 5 1 5
Circuit Board 9 1 9
BS2 100 1 100
Total Cost 205.75