Help getting our robot off a tethered cord!

Profw

Member
To All,
My name is Charles Walsh I pastor a wonderful church here in Montana and about 25 years ago started teaching young minds how to design and build all types of robots. Now I can design and build robots, but barely have enough time to make a program to use them. As an educator in the study and construction of mechanical designed robots I have been pressed for time to get the robots moving. So, because of this restraint I have simply controlled the robots with tethered wires. It's time to cut the cord and make a programmable robot to run the gambit courses with a program using an 18M2+ chip as we have some in the class inventory. But, I need help, How about a program that uses 4 buttons which represent compass directions. We have lots of mini push button switches, and some led's as a feedback to the student. The student can then map out the course it wants the robot to follow by pressing direction arrows say one press of the north button moves the robot 4 inches or so straight ahead, pressing the east button turns the robot say 45 degrees and so on for the other buttons. The program would record the presses and then when the student is ready, play back the moves with actual movement. Which will get our cool robots off the wires which dangle twist and tangle. We have a cool robot I call grip_bot it uses three geared motors, one for left side locomotion, one for right side locomotion, and a final for opening a cool gripper I designed for the 3D printer. if you prefer we could use continuous rotation servos thus using the PWM control. In fact I would appreciate all the help we can get and the goal is to get the robot off the cord! i have checked out Mr. Eric Ostendorff's very ingenious Big Trak robot mode, but it works on a 20X and I checked all the links trying to find the article he wrote to construct his robot in Robot Magazine dated Sept-Aug of 2012, but, to no avail. Thank you All in advance.
 

lbenson

Senior Member
You will probably do well with the HC-12 wireless modules, which can effectively act like a wireless serial connection.

Here is the best picaxe thread (if you have time for a long read): http://www.picaxeforum.co.uk/showthread.php?28893-HC-11-and-HC-12-transceiver-modules

The M2 picaxes can use background receive with HSERIN to receive transmitted data. There is only a 2-byte buffer, but that should be plenty, since upper-case letters alone can give you 26 commands. The HC-12 units don't have the problem that dumb 433 wireless modules have, which continually receive garbage characters from ambient electrical noise.

Robert Rozee has provided very useful utilities for programming these modules: http://www.thebackshed.com/forum/forum_posts.asp?TID=8246&PN=8

My favorite setting is: FU4, ch 1, 8dBm, 1200,none,1,8

These are 433mHz units. As a caveat, there are restrictions on their use in the U.S. (widely ignored), but the FCC regulations allow some general low-duty-cycle uses of 433mHz under emitting specifications which do not very understandably correlate to the kinds of specifications which the 433mHz module vendors provide.
 

hippy

Technical Support
Staff member
It should certainly be possible to have a robot which can be programmed to hold a series of steps like the Big Trak used. Simply record what button pushes there are and then play them back -

Code:
Record:
  index = 0
  Do
    Gosub GetKeyPress
    Write index, keyPress
    index = index + 1
  Loop Until index = 0 Or keyPress = END_KEY
  Return
Code:
Playback:
  index = 0
  Do
    Read index, keyPress
    index = index + 1
    Gosub ObeyKeyPress
  Loop Until index = 0 Or keyPress = END_KEY
  Return
It should be possible to extend that to storing more complex commands rather than just key presses.
 

techElder

Well-known member
... and then there's editing for mistaken entries. :D

... next, someone will want to plug in a mouse. :D

... then, we need a much larger screen. :D

... ... ...

So, create your "programming interface" on the robot to receive characters (commands) from a wired serial cable to a machine (PC etc.) that has an editor for the "program."

Unplug the programming cable.

Then just press "GO!" on the robot.

That's closer to the real world interfaces we use.
 

erco

Senior Member
Hi Charles. I'm Eric, who wrote that Big Trak program for my 20M2 robot. Your 18M2 should work fine, maybe with a few pin reassignments. Were you having trouble getting the info from ROBOT magazine, which is no more? Let me know how I can help, I can dig up the 20M2 code if you need.

Pastor, huh? Awesome! I'll have to introduce you to my robot-building Episcopal priest buddy Whit in Louisiana. He's very active on the Parallax forum and has his own blog: http://roboticsunderthestole.blogspot.com/
 

erco

Senior Member
Charles: I've attached my 20M2 Bigtrak code. It uses three touch sensors, but you could easily modify it to use pushbutton switches instead. I was limited to 3 pins since I had lots of other hardware connected, but you're free to use as many pins as you like. I had to double and triple up on touch sensors to get enough functions, so more buttons (each with a single function) would be preferable.

Feel free to PM me if you need more details.

 

Attachments

Profw

Member
Eric ! Yes !
Oh it's great to meet you, I have been checking everywhere for your robot code. Too bad Robot magazine is gone, I couldn't even get a back issue on the construction of your robot. All other information promised the complete article until you actually checked it to find a link was deleted or some other new hurdle. Can you send me off post any other helpful information on your penny robot, it will be greatly appreciated. Thank you for the code..... yes now to go play.
 

Profw

Member
Need help converting erco's program to use the 18M2 and regular push buttons. Please. How do I use the code window?
 

Buzby

Senior Member
Have you studied Erco's code ?

Can you determine what the lines between 'touchpad:' and 'goto touchpad' do ?

You could edit this section either :
(a) put simulated touch values into the w1,w2,w3 variables, with numbers based on whether a real button is pressed or not.
or
(b) replace this section with some code that just sets b0,b1,b2 directly from the buttons.

Post your coding attempts here, and we'll help.
( We don't like to do all the work for you, 'cos you won't learn anything by just 'copy&paste'. This is not A******land )

Cheers,

Buzby
 

premelec

Senior Member
Looking at erco's code I'd suggest defining a lot of symbols for variables and constants and pin #s rather than using the bx variable notations and such - would make it easier to read and modify by changing some of the symbol definitions rather than going through all the code changing 'b1' etc. Initially you can use a find and replace edit to substitute b1 etc with it's symbol...
 

Profw

Member
Buzby,
How do I post the modified code. Do I take a picture of it and post it? It looks like others use some sort of code window???
 

AllyCat

Senior Member
Hi,

You can select the text and then > Edit > "Copy for Forum" from the PICaxe Editor, and paste directly into the Forum edit window. Or more generally, cut and paste any text and put it between [ code ] and [ /code ] tags (with no spaces) in the Forum window.

Cheers, Alan.
 

The bear

Senior Member
If you add any PICAXE BASIC program code to your post, please enclose it within
Code:
tags e.g.
Code:
high 1
pause 1000
low 1
Other formatting tags are described here.

If you attach any image, please make sure it is a small, low resolution file - e.g. don't upload pictures straight off your 6megapixel digital camera - they will be huge files! Images may be moderated before they are publically available.
Regards, bear..
 
Top