Friday, 30 April 2010

Design Evaluation






The design of the buggy was good and unique in the fact that it was Lego with a acrylic base for reinforcement. It was suited for the task but could have been improved in the following ways:
1. The Lego could have been glued together to prevent breakages when the buggy was running.
2. The circuitry could have been built on strip board or PCB (printed circuit board) this would have reduced the size of the buggy, which would make it lighter.
3. The variable resistors could have been mounted on the top of the buggy in order to make tuning the circuitry to follow the lines easier.
4.  A cover could have been built in order to cover all the electronic parts using Lego doors in order to access switches and battery compartments.
5. The trolley wheel could have had a better design as it did not suit its purpose and would not swivel as intended causing the buggy to deviate from its intended route.
Overall we believe the design was good and was easy to adapt due to the fact that it was Lego and if something didn’t fit it could be rearranged in order to fit it in, allowing from extensive development during testing.

Sunday, 25 April 2010

Programming Code

main1: if pin0 = 0 then ; if the line tracker mode is on

high 0 ;turn left motor clockwise
high 3 ;turn right motor clockwise

Right: if pin1 = 1 and pin2 = 1 and pin6 = 0 then ;if tank meets right turn
low 0 ;stop left motor
low 3 ;stop right motor
high 0 ;turn left motor clockwise
high 4 ;turn right motor anticlockwise
loop1: if pin7 = 1 then ;if front sensor meets the line
low 0 ;stop left motor
low 4 ;stop right motor
else
goto loop1 ;keep turning until front sensor hits line
endif


Left: elseif pin1 = 1 and pin6 = 1 and pin2 = 0 then ;if tank meets left turn
low 0 ;stop left motor
low 3 ;stop right motor
high 1 ;turn left motor anticlockwise
high 3 ;turn right motor clockwise
loop2: if pin7 = 1 then ;if center front sensor hits line
low 1 ;stop left motor
low 3 ;stop right motor
else
goto loop2 ;keep turning until front sensor hits line
endif


Offtrack: elseif pin1 = 0 then


OffLeft: if pin2 = 1 then ;if right sensor hits line
low 0 ;stop left motor
low 3 ;stop right motor
high 0 ;turn left motor clockwise
high 4
loop3: if pin7 = 1 then ;turn right motor anticlockwise
low 0
low 4
high 0
high 3
else
goto loop3
endif
loop4: if pin1 = 1 then
low 0
low 3
high 3
high 1
else
goto loop4
endif
loop5: if pin7 = 1 then
low 3
low 1
else
goto loop5
endif

OffRight: elseif pin6 = 1 then
low 0
low 3
high 3
high 1
loop6: if pin7 = 1 then ;turn right motor anticlockwise
low 3
low 1
high 0
high 3
else
goto loop6
endif
loop7: if pin1 = 1 then
low 0
low 3
high 0
high 4
else
goto loop7
endif
loop8: if pin7 = 1 then
low 0
low 4
else
goto loop8
endif

else
goto OffLeft ;keep reversing until center sensor hits line
endif
elseif pin0 = 1 then
goto main2

endif
endif
goto main1

main2: if pin0 = 1 then ; if the signal tracker mode is on

high 0 ;turn left motor clockwise
high 1 ;turn right motor clockwise



RightSig: if pin7 = 1 and pin2 = 1 and pin6 = 0 then ;if tank meets right turn
pause 100
if pin6 = 1 then
goto Failsafe
endif
pause 2000 ;drive until center sensor is at apex
low 0 ;stop left motor
low 3 ;stop right motor
high 0 ;turn left motor clockwise
high 4 ;turn right motor anticlockwise
loop9: if pin7 = 1 then ;if front sensor meets the line
low 0 ;stop left motor
low 4 ;stop right motor
else
goto loop9 ;keep turning until front sensor hits line
endif


LeftSig: elseif pin7 = 1 and pin6 = 1 and pin2 = 0 then ;if tank meets left turn
pause 100
if pin2 = 1 then
goto Failsafe
endif
pause 2000 ;drive until center sensor is at apex
low 0 ;stop left motor
low 3 ;stop right motor
high 1 ;turn left motor anticlockwise
high 3 ;turn right motor clockwise
loop10: if pin7 = 1 then ;if center front sensor hits line
low 1 ;stop left motor
low 3 ;stop right motor
else
goto loop10 ;keep turning until front sensor hits line
endif


StopRev: elseif pin7 = 1 and pin2 = 1 and pin6 = 1 then

Failsafe: low 0 ;stop left motor
low 3 ;stop right motor
high 1 ;turn left motor anticlockwise
high 4 ;turn right motor anticlockwise
pause 2000
loop11: if pin1 = 1 then ;if center sensor hits line
low 1 ;stop left motor
low 4 ;stop right motor
goto Endprogram
else
goto loop11
endif

elseif pin0 = 0 then
goto main1
endif

endif
goto main2

Endprogram: End

Project Schedule

  • Project Set - 09/03/10
  • Group meeting - 16/03/10 - 12pm [Labs/costa]
  • Group meeting - 19/03/10 - 12pm [Labs/costa]
  • Group meeting - 23/03/10 - 12pm [Labs/costa]
  • Group meeting - 08/04/10 - James Flat c.1pm
  • Group meeting - 20/04/10 - 12pm [Labs/costa]
  • Group Meeting/buggy test - 24/04/10 - James' Flat
  • Buggy deadline - 27/04/10 - 1pm [mb168]