need some help...

Ok so for my Junior year Research Paper I decided to do it on Asimovs Three Laws of Robotics and how it will apply to society, we need an in class example and I figured I would use my VEX kit to show off the laws… but Im not entirely sure how to do that with what Ive got, which is

The original Starter Kit
Hardware kit
Chain and Sprockets
Light Sensor
and Programming Kit

… Yea not much, I really wanted to pick up the Tank treads and Ultrasonic sensor when radioshack was clearing out but they were already sold out. oh and the programming kit is V1 because Im too cheap to upgrade to V2 (which I think is a great upgrade but I dont think I should have to pay for it since I already bought the whole dang thing for $100) Anyways, if you guys dont know the laws they are:

1 A robot may not harm a human or through inaction allow a human to come to harm
2 A robot must obey an order given by a human except where such an order does not conflict with the first law
3 A robot must protect itself whereas such protection does not conflict with the first or second laws

I figure I have Square bot built right now with some bumper switches and a light switch, so far Ive programed out that if it hits something to back up and wait for me to do something on the controller which would be modelling both Law 1 and 3 at the same time and me at the controls models Law 2…

Ive got some other things im working on in the program and Im open to any and all suggestions and comments (as long as theyre constructive). I suppose this isnt truely imparitive to my grade but It would leave a nice impression. All help is appreciated.


hmm…if you had the ultrasonic kit i was gonna say an arm swings at a human but stops

Use the light sensor and have the robot stop when he is about to hit a human.

It may be cooler to get the robot to actually avoid the human, rather than stop. Like if it is moving, then simply drives out of its way to avoid obstacle, in your case, humans.

well, i dont think i can have the robot AVOID a human if all i have are trip limit and light sensors… I might be able to use th light sensor but I dont think it will work in time, and if I used it, it would also make it steer away from shadows… which is not quite what I want it to do because Im going to be demonstrating in a classroom and its liable to run under a desk… Im still working with it and I think I might have it kinda figured out…

Attach an airsoft gun or some sort of arm that hits people.

Then you could attach limit switches with straws or sticks attached to it.

Then you could do remote control and try and hit someone with the arm and when the limit switches are tripped it will override any command given from the remote control.

This is really hard to replicate with vex, you would have to be able to distinguish a human from an object.

The way i would do that is to have an ultrasonic sensor, motion sensor, and thermal sensor all set up so that it could tell if it was a human, object, or some sort of machine like a fan ect…

It dosnt have to be an EXACT replication of the 3 Laws just something that shows it in theory so I think the limit switches with straws idea might work. Thanks guys!

oi, Ive run into some coding problems If any of you guys could help here: that would be awsome. I probably shouldve just tacked it onto the end of this thread but I figured it belonged in the Technical discussion, anyways The project is due soon so If anyone could help it would be GREATLY appreciated! Thanks guys!

Okay, yet more coding problems…

I now have the Ultrasonic Sensor and it works fine… but I just cant get D4N331 to work right… I just cant figure out the coding, mainly because figuring out which loop to use confuses the crud out of me… IF, IF-ELSE, WHILE, FOR… it all seems self explanitory but I cant get it organized in a such a way as to get it to work…

Again what I need EXACTLY:

I need to have manual control to start with, as I drive I need my robot to stop and turn when it is roughly an inch away from something (about 10 or 12 on the ultrasonic reading is right) It also needs to stop if the front limit switch or front bumper switch is tripped (im going to upload images in a second and edit this post with a link)
I need to press a button or SOMETHING and have the robot drive on its own, while still stopping an inch from something or hitting something.

This seems like SUCH a simple problem but I cant figure it out… Im sorry for bugging you guys so much with this but please help me out!

Pics of D4N331:

I also seem to have a problem getting him to turn, he’ll go about halfway and just kinda run outta steam, Hes just a modified Squarebot and he was working fine a few days ago… I dont know if my motors are wearing out or if I just dorked something up but if anyone has any solutions to that problem also it would be greatly appreciated.

okay… well thanks to those who DID help me anyways, Ive got the coding propblem pretty much figured out but as I said earlier, my bot is having problems turning (tank style controls) I think its cuz the gears are dragging on the carpet but i dont know what that would stop him only mid-turn and not from the get go… which leads me to believe theres still something wrong…

if anyones got any ideas on this let me know, where im doing the demonstration dossnt have quite as soft a carpet but its still carpeted so i need to know what it is thats causing problems and if i need to buy tank treads or something.

Is it making a clicking sound when it turns? You could always try omni directional wheels, or add more motors.

no clicking sounds… the more i look at it the more i think its just dragging on the carpet… i think im going to modify one of my servos and turn it into a four motor design, that should be enough power to move the darn thing… if i have the four motors that would take out the big gear in the middle and thats whats dragging, so hopefully this’ll work.

Thanks guys

EasyC is driving me INSANE! okay so I rebuilt my bot and now it has 4 individual motors each driving a small wheel, they all work fine with the default coding downloaded to the microcontroller but when I try using the Tank - 4 Motor function block my robot decides its just going to sit there… ive tried everything I know to fix it, setting the RX to 0 and actually tethering the controller to the microcontroller, messing with different slots for the 3 pin connectors… nothing I do works, The ONLY thing I can figure that might be messing something up is that I modified one of my Servo’s to make it a Motor… though I really dont think that would change anything…


If you have y cables, try using a 2 motor tank module and then use y cables on 2 of the motors. I would need to see your code to give more help. If you could take a few pictures and upload them I’m sure someone would help. Take a look at your code and look if there is anything obviously wrong. Are there 2 green lights on your robot when you are running your code?

yes theres 2 green lights, Right now the only block i have running is the Tank function:

Tank4 ( 1 , 3 , 2 , 3 , 1 , 4 , 2 , 0 , 0 , 0 , 0 ) ;

Ill upload some updated pics in a minute

Unfortunately I dont have any Y cables, I might be able to pick some up if they have any at radioshack though.

You may wanna try setting it to RX 1 or 2, and then making sure ur tether is plugged into the right port. But i dun think that would affect it.

Also, if you are using a competition template, beware of the twenty second autonomous mode. I’ve freaked out a lot when i program something and i’m sitting there and it won’t move. Either wait for autonomous to end or put a jumper into one of the interupts. ( i think it’s the last one.)

Im not in competition mode, Im trying to design this bot for a Demonstration of the 3 laws, anyways when I use the jumper it works but That wont work if I download a User created Code into the microcontroller will it?

My latest are the first 4 labeled G15K4RD

wow… Im a Grade A idiot… I forgot to put the function in a loop… Sorry for bugging you guys!

mental note to self: ALWAYS consult the help file first

bangs head on desk youve got to be kidding me…

Okay so I figured out how to run the Tank Code by itself, but when I insert it into the rest of the program (i.e. a IF Else statement) it magically stops working, and Its probably because Its not in a while loop anymore…

BUT it was working fine with my previous 2 motor tank code and I didnt have it in a while loop… and now when I go back and try running the older code it wont work, I have NO IDEA whats going on now… I consulted the help files and found nothing and I cant figure anything that would cause it to spontaneously just stop working…

im about ready to kick my robot if it wasnt for the fact that I know it would hurt me more…


I finally I have the code down, I think the modified servo was messing me up so I removed it and the other front motor, Instead of using one large gear or sprocket in the center to turn two smaller gear/sprockets, I decided to leave the Back motors in place and just use the two smaller sprockets and a chain.

Now I can run my previously working code and he can roam around all by himself OR under my control!

Thank you everyone for helping me! Im sure with this addition to my presentation Im going to get an A+!

Major thanks to MarkO, the XY Mode switch is engineous!