Pal, an obedient autonomous truck

Hey, a home for my robot, Pal.

(this is blog format so the beginning of the experiment is on the 3rd page from here)

I'm tired of carrying my electric RC truck around from hill to hill while working it up in the dirt. just seems kinda of humiliating to both of us, ya know?

Also, I think one of the best/simplest ways to instill a sense of awareness in a robot is for it to know where you are. towards that goal i''m adding some ultrasonics and some brains to it so it will follow it's control unit around like an obediant doggy. 

The latest posts appear after this one, look down at the bottom for the Block Diagrams early discussion.

I'm using ultrasonics mounted on the truck and the handheld transmitter to act as a beacon so the truck knows where the master is... maybe can also make it race in circles around a central fixed beacon 

michael


This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/pal-an-obedient-autonomous-truck

Sounds like a pretty cool
Sounds like a pretty cool project. Post pics as it goes along so we can see what kind of stuff you’re doing with it.

Sensing
Sounds impressinve. How are you detecting the location of teh "control unit"?

Ultrasonic Beacon

my plan is to have the control unit act as an US repeater, when it hears a beep, it replies with a beep. also with some pulse identification, i believe, for enhanced echo-immunity.

for a direction heading i’m going to try first using a 360degree pan stage on the truck, cause it will be neat to have that thing swinging around and locking in on “you”, but i’m really interested in trying a InterAuralDelay technique also; have three US receivers in a triangle shape on the truck and be able to get a direction heading on every pulse…

 

since it’s mostly software at this point, pictures aren’t very interesting. but soon they should be!

 

then the next challenge will be to implement a Kalman filter or particle filter for localization. that’s something i’m interested in getting some practical experience on.

 

Thanks for the comments!

michael

 

 

**Back to Work **

OK, now finally back to working on Pal.

Fine tuned some of the timing loops. setting acquisition rate at 50uS/sample = 5/8"/sample = 0.625"/samp, or 1.6samples/inch.
this is probably a little too fine resolution, but let’s stick with it for now.

PulseSep is the time, in Timer2 ticks of 256uS, between pulses. this is now set to 10, or 2.56mS.

the two graphs on the left are results from the last data point only, which wasn’t pointing at the transmitter. but this was in a crowded BotShed, there were plenty of echo sources. the top-left is the returned signal showing the three pulses about 2.5mS apart. the bot-left graph is the correlation function looking for the three pulses at that expected distance apart from each other.

|x

the graphs on the right show about 5 seconds of data from scanning the receiver through about 45 degrees. the top right shows the amplitude variations while scanning back and forth.
the bottom right shows delay calculated for each point, which shouldn’t change at all, optimally. the peak-to-peak variation in delay at around 275uS which is about +/- 1.7", about 3 samples closer or further away. eh, i’m not doing any averaging at this point. not sure it will be necessary at this stage of the signal processing. the three-point correlation routine is really simple. perhaps improvements here would be beneficial.

now to workup a lockin loop on the maximal signal amplitude direction.

Fine Tuning the Analog section
Ok, worked today on tweaking the analog pre-amp circuit. working pretty fine now, quiet. no dynamic gain adjustment yet. not sure when i’ll need that.

here’s the schematic.

|x



from the results of this circuit i’m estimating i should be good out to 15’ or more. that might be enough for now. i can put off implementing the dynamic gain adjustment until later.

now i’ve got about 1250ADC counts per Volt of signal. so, if my smallest signal is 50 counts, then that’s about 15’ according to the inverse square law.

here’s a pic of the signals.

|x



you can see the last acquired pulse in this scan on the top left. peaks are well defined and quiet and easily separated. they could be closer together.
the top right graph is the receiver scanning back and forth past the transmitter for a total swing of about 90 degrees. the peak was not at the end of a swing so it looks double here.
the delay scan on the bottom right is locked for almost all headings. the finest resolution is 50uS since that’s the sample time of the ADC. as good as it gets.


Scanning Receiver Locks In on Transmitter location now
Ok, as much time as i can give it there is progress to be had.
now i’ve got the receiver scanning nicely and locking in on the transmitter with about a +/-5 degree range and about +/-100 in amplitude. notsure if that will get much better. now i’m stepping and waiting 10mS and then listening for 10mS. if i continuously scan, it will move appreciably in 10mS of listening.
but the echo delay data would still be good, even if the signal is skewed a bit. and this won’t matter much when it is on lock.
i have to learn a thing or two about Kalman filters.

So the lock in can only be so tight, movement will have to be gradual. now i’m thinking a solid state time-of-flight recevier would be so much better. but, this scanning thing is pretty neat looking also. maybe put some leds above the US…

Now i need to buildup the Relay circuit for the person to hold. also need to build some omni-directional US antennae. i hear my friend’s company is getting a 3D printer… hum…

Turret Work

well, I’ve got the turret locking in on the transmitter pretty well, at least for now. it can definitely be improved. it’s just heuristics now, i’d like to use a PID or Kalman filter. i think with the kalman filter it would be able to scan something like the car Kitt.

right now it’s stepping the turret horizontally an increment, about 1 degree or so, and then pulsing the transmitter and listening for the pulse with the receiver. then increments again, in one direction or the other, as judged by the heuristics. when it doesn’t have a minimum signal level it jacks the increment up to 5 degrees, which speeds things up.

i think with a kalman filter i could keep the servo scanning back and forth asynch with some specified central heading and half-angle amplitude on the scan. is this true? that’s my impression but i haven’t worked with them before.

i should probably post the source code i got. it’s not terribly pretty, being a work in progress. i’ll try and do that soon.

now i’m capturing the circuit and picking parts to get some boards made up. but there are some things that still need to be tested yet. i’m also gathering some hardware to mount up the circuit board and sensor turret on the RC truck i got. hopefully this week sometime.

ciao

Delay Tube Scan

 

|x

i guess the standing waves in the tube are worse then i thought. still not sure it matters though, unless i want to use this for some quantitative calibration, which shouldn't be necessary. The graphs were made by sampling every 100mS for 10 seconds, making 100 points, as i slowly pushed in the plunger on the tube resulting in shorter distances.

the red curve is the received and digitized signal from the ultrasonic transducer. i'm using bunches of 3 pulses seperated by 1.25mS or so. each point is 50uS and they start with the generation of the first pulse.
The Blue curve is a very simple "gating" correlation anticipating the three peaks and 1.25mS space between them. the highest peak will always correspond to the rising edge of the first pulse. I anticipate a much better algorithm here, but this seems to be reliable in the delay tube anyway

The green curve is the value of the three peaks in each pulse averaged together. here you can clearly see the standing wave behavior of the tube.

The yellow curve is the delay measured, in uS. each point is 50uS so this corresponds to which point the first rising edge is detected at, times 50uS. i suppose the glitches are due to the massive standing wave signals at some positions. at certain exact spots the signal would seem to disappear completely.

now to work up a scanning routine for panning motor, PID lock-in detection....

Basic Ranging working now

i rigged up a very simple, 1D “test range” using a 2.5" diameter plastic tube a meter long (empty plotter paper tube). i put a transmitter and receiver at one end and a sliding plug at the other end.

it works nice enough, but there are standing wave issues. i have the transducers stuff in some foam, and the foam doesn’t absorb the ultrasonic very well, so it echos. i might try just hot-gluing the transducers to the inside of the tube and leave the rest of it open. but it doens’t really matter, i just tune to a slightly different position.

|x

 

 

Pal Rover1 Board Layout

ok, finally got around to getting off the explorer-16 development board and building up my own. i simply used a board from Radio Shack, it was sized pretty well to this app, though the copper is such poor quality it’s amazing.

when i get the schematics all updated i’ll post that too.

|x

 

 

Pal System Block Diagram

here’s a shot at the overall design.

i would like to be able to switch between autonomous, on-board PIC control, or regular 4x4 truck rip-up-the-road control.

i guess those NPN transistors shouldn’t really be neccessary, i didn’t want to burden the PIC with the menial task of supplying current though.

 

|x

Pal Timer Allocation

here’s my working layout for getting the 40 KHz ultrasonics generation and 20mS RC servo signal and etc working in a dsPIC33FJ128GP802

|x

 

Turret Rebuild

Ok, i rebuilt the turret so it is much more stable and planar. i’ll post a pic later today.
now there are two platforms holding the gears apart. works pretty well, though i haven’t tested it in system yet.

|x


Mostly i’ve been working on capturing the circuit and laying out the circuit board with Orcad. it’s looking pretty good now, probably 80% of the packages are taken care of, got to do the switches and jacks and mech stuff like that still. i’m leaving room for future expansion, but it would be a new board turn anyway i suppose…

gonna use the PIC32 series chips for this version. why not, they are $11 each from digikey and it will be a great experience. porting should be fairly trivial. mostly just getting the timings straightened out a bit. this puppy will be running at 80MHz. yeah for that.

this is in the 64-TQFP package. Shouldn’t be too hard to solder down in my little workshop.

Digikey Page for PIC32MX440F512H-80I/PT

Circuit Board Layout

Ok, i’m laying out a board now using Orcad. i’m going to add three analog ultrasonic receiver channels instead of the one needed for this design. this way i can implement the Time delay method of orientation by using 3 receivers instead of the panning single receiver. obviously it would respond much more quickly, but then it wouldn’t have that cool Kitt car effect…

anyway, since i’m laying out the board may as well plan for the future. this thing is now 4" by 5", and it’s kinda crowded. i can’t fuss over the design too much if i’m only going to be making 4 boards or so, so i’m not worrying about it much.

here each analog channel also has a programmable gain feature, though i don’t have that in my prototype, and i’m not sure i’ll really need it since i’m not ever listening for actual echoes, my overall signal strength shouldn’t be an issue. but then i’ll want it to reach even further, or maybe use this board for another ultrasonic application.

here’s the circuit board layout and how it would mount on the RC truck i’ll be using.

|x

 

Schematics, as the are now

these are certainly subject to changing. if you notice any glaring error, tell me. i’ll being getting these made up some day real soon now. they deserve a cleaning up in various ways, but i may never get to that. this is a prototype afterall…

|x

Ckt Board on truck

Sort of. just a printout of the board layout and where it will fit on the truck.

i’ll bring up the four supports in the center to some sort of scaffolding to hold up the panning turret that will protrude up through the trucks body.

or, there will be three receivers mounted around the truck instead of the scanning turret.

 

|x

Omni Directional Ultrasonic Antenna

This is really important to the design and still not resolved…

i need an Omni ant on the robot to transmit the initiating signal to the hand-held controller. with the panning receiver version of orientation determination, that uses the normal 20degree receving element for it’s directionality. but if i implement the much more efficient interaural time delay method of angle determination, then i need three more omni antennas for each of the three receivers mounted on the robot. a diagram would be good to insert here, but i am also working on major house repairs… :slight_smile:

my main thought has been to point the trans. or receiver straight up and hang an inverted cone above it. the cone should have a 45 degree cut to it, in this case. i saw this done in a university experiment, but couldn’t find any other approaches.

not sure how to make this cone though. maybe with a 3D printer service. maybe i can fab it up in google sketch-up. not sure of the details and i’ll need something soon.

the other idea is to radially contain the above idea with a couple of horz. disks, one at the base, or top of the cone, and one around the opening of the trans/receiver. i suppose they should be seperated by a wavelength or two. or three. this could make things worse, or could help. testing would be necessary.

 

Omni Directional Ultrasonic Antenna Ver 2.0

here’s my attempt at a small antenna. i Have made a bigger one that is fully adjustable, but i wanted to see how small these could be made.

have not tested this at all yet. i think i would like to put three of these on the car and do time-differential location instead of the panning servo. the panning servo would look coo, but can’t work as well. time-diff will locate on one pulse.

the blue disks are 1.75" in diameter. the “parabolic” cone is made from modeling clay by hand. my 3D printer is on the blink…

|x

exciting DIY tech!

I love the look of this. Awaiting field test results!

Anxiously!