My Senior Project

I make nice robot to play with.  Too bad he's retarded...:(

Explore

  • Actuators / output devices: one servo
  • Control method: Full autonomous
  • Power source: 4 AA batteries
  • Sensors / input devices: AIRRSv2 (Sharp GP2YOAO2YKOF Sensor)
  • Target environment: indoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-senior-project

why can’t it move?, little

why can’t it move?, little bit more info please :slight_smile:

I wish I knew why, I

I wish I knew why, I connected all the wires correctly and input the correct programming but the motors(wheels) will not turn!?! Any idea’s?

check battery wirestry only

  • check battery wires
  • try only the motor wires
  • you have to SOLDER them properly and the solders should be perfect such that they dont touch one another
  • recheck program 
  • check only sensor
  • if wired properly it SHOULD work
  • Keep trying :smiley:

 

this might help

I had this problem too… check ur little bridge up by the top corner of the board. it connects to two pins. Try swithcing them around. hope it helps :slight_smile:

You mean those four little

You mean those four little ones grouped together?

 

Movement

The wires are fine, soldering and everything, the camera works simply put, the wheels are UNRESPONSIVE!  The code I am using is the one form ‘My First Robot’.  I just do not know…

Well… if urs is a 28 pin or whatever

if it is a 28 pin… or i think that is what fritz used then it is the three pins behind the power wires. V and G. flip that bridge around.

If you have a multimeter,

you can check to make sure that you are getting signals to and from where they should be going. Also, make sure you are getting 5 volts to the PICAXE.

First, check the PICAXE pins to make sure you are getting a HIGH where you think you should be getting a HIGH. Follow that to the motor driver chip, L293D I believe. See that you are getting HIGHs and LOWs where they are needed. See that you are getting HIGHs and LOWs on the outputs to the motors.

Make sure that your L293D is plugged in in the correct orientation.

Life

Ok. First off thanks for the help, the motors are running fine now, but I am having some troubles with the code.  First thing, when moving during ‘no danger’ he only scoots forward an inch or so.  How can I tell him to go further?  Also, for some reason when deciding ‘Which way is better’ he acts rather sporadic and only seems to notice the ‘wall’ once, then proceeds to charge it at an inch a minute.

Re-write the whole program

Re-write the whole program all by yourself, know what each line means and does, check the sensor’s sensiblity by using only the sensor program and change your dangerlevel according to your sensor’s sensibility. check if all solders are done properly any loose solders will result in such “sporadic” movements 

All the best 

**You could always **

post your code, if you would like some of the people here to look it over.

ya actually this is a better

ya actually this is a better idea 

code

I know I have correctly soldered for that was my first problem with the motors, and I have a solid dangerlevel for my system.  I have been running through the code so much I can no longer make him run a straight line… so here it is

symbol dangerlevel = 140

symbol turn = 300

symbol servo_turn = 700

 

main:

readadc 1, b1

if b1 < dangerlevel then 

gosub nodanger

else

gosub whichway

end if

goto main

 

nodanger:

low 4 : high 5 : low 6 : high 7

return

 

whichway:

gosub totalhalt

 

gosub lturn

pause servo_turn

readadc 1, b1

gosub totalhalt

 

gosub rturn

pause servo_turn

readadc 1, b2

gosub totalhalt

 

if b1>b2 then

gosub body_lturn

else

gosub body_rturn

end if

return

 

body_lturn:

high 4 : low 5 : low 6 : high 7

pause turn : gosub totalhalt

return

 

body_rturn:

low 4 : high 5 : high 6 : low 7

pause turn : gosub totalhalt

return

 

rturn:

servo 0, 100

return

 

lturn:

servo 0, 200

return

 

totalhalt:

low 4 : high 5 : low 6 : high 7

servo 0, 150

wait 1

return

 

since you are having

since you are having problems with your wheels/motors, try just

 low 4 : high 5 : low 6 : high 7 

and see if the wheels move, if they do move then try changing the value of dangerlevel to a small one like 100

For grins

could you look over this code?

symbol dangerlevel = 140
symbol turn = 300
symbol servo_turn = 700
'new symbols
symbol scenter = 150 'adjust to set servo center
symbol sright = 100 'adjust to set servo right
symbol sleft = 200 'adjust to set servo left
symbol lmbp = 4 'left motor back pin
symbol lmfp = 5 'left motor forward pin
symbol rmbp = 6 'right motor back pin
symbol rmfp = 7 'right motor forward pin
symbol ir_sensor = 1 'analog input pin
symbol sensor_servo = 0 'ir_sensor servo pin
symbol dist_front = b1
symbol dist_left = b2
symbol dist_right = b3

main:
   readadc ir_sensor, dist_front
   if dist_front < dangerlevel then
      gosub nodanger
   else
      gosub whichway
   end if
goto main

nodanger:
   'changed to increase readability
   'low 4 : high 5 : low 6 : high 7
   gosub leftmotorforward
   gosub rightmotorforward
return

whichway:
   gosub totalhalt
   gosub lturn
   'pause servo_turn
   'readadc 1, b1
   gosub totalhalt
   gosub rturn
   'pause servo_turn
   'readadc 1, b2
   gosub totalhalt
   if dist_left > dist_right then
      gosub body_lturn
   else
      gosub body_rturn
   end if
return

body_lturn:
    'high 4 : low 5 : low 6 : high 7
   gosub leftmotorbackward
   gosub rightmotorforward
   pause turn
   gosub totalhalt
return

body_rturn:
    'low 4 : high 5 : high 6 : low 7
   gosub leftmotorforward
   gosub rightmotorbackward
   pause turn
   gosub totalhalt
return

rturn:
   servo sensor_servo, sright
   pause servo_turn
   readadc ir_sensor, dist_right
return

lturn:
   servo sensor_servo, sleft
   pause servo_turn
   readadc ir_sensor, dist_left
return

totalhalt:
   'changed to help readability
   'low 4 : high 5 : low 6 : high 7 'this will make the motors go forward
   gosub leftmotorstop
   gosub rightmotorstop
   servo sensor_servo, scenter
   wait 1
return

leftmotorforward:
   low lmbp
   high lmfp
return

leftmotorbackward:
   high lmbp
   low lmfp
return

leftmotorstop:
   high lmbp
   high lmfp
return

rightmotorforward:
   low rmbp
   high rmfp
return

rightmotorbackward:
   high rmbp
   low rmfp
return

rightmotorstop:
   high rmbp
   high rmfp
return

After some thought,

I now have to wonder if your totalhalt subroutine was not the problem. What I wrote up has more code, but, does the same as your code.