Let's Make Robots!

PIC-AIM

Remote controlled, extremely precise (yeah, right!) 2-axis laser death ray

This started out as a top secret destruction weapon to be placed on the moon with plans of taking the world hostage, in order to make a trillion dollars... (...mmm... I think I´ve seen this movie before...)... and it ended up being a laser pointer mounted on a two axis jig, made out of Futaba servos. It is controlled by a hacked, 22-year-old IBM analogue joystick.   
Now back to reality: This really started as a comment by user chench (http://letsmakerobots.com/user/5049) to a forum post of mine, (http://letsmakerobots.com/node/27588) suggesting an analogue gauge. The neuron that was handling that idea collided with another one that was taking its time to decide what to do with a spare laser pointer I have. Presto-pronto an idea was born. 
A hacked 2 axis analogue joystick going straight to 2 ADC pins. That value mathematically translated to servo values (thank´s to Chench´s formula) and the laser pointer cable-tied to the horn. Let´s not forget the bracket I improvised to attach on servo to the other.
I am using a Picaxe 18X and here´s the code:
init: 
servo 4,75
servo 5,75
main:
readadc 1,b1
readadc 0,b0
let b2=b0/2+75
let b3=b1/2+75
servopos 4,b2
servopos 5,b3
goto main
The problem I´m having (take a look at the video) is that of servo jitter. As fas as I can tell, it is caused by the instability of the ADC reading coming from the joystick, even when I don´t touch it. I have gone though many posts in the Picaxe forum trying to find a solution, with no real luck. The best I can think of, is writing code to round up the values. According to the debug screen, my instability is smaller than value 5 (inside of the 0-255 range).
 Any ideas, community? H-E-L-P!

UPDATE (July 25th, 2011)
Finally I have been able to integrate the new 3A power supply to the old experiment and the jitter is more under control than before. See secong video near the top. Next step is to tie down all unused inputs and change the pots in the joystick as suggested by many "colleagues" in the forum.
Thanks to all!

UPDATE (July 26th, 2011)
At this point, and after today´s experiments, I believe it is safe to say that I have tried out every suggestion posted here and on the Picaxe forum. "We" have managed to reduce the jitter an awful lot, but it is still there. Take a look at the third video uploaded. Here´s an unofficial list of everything I´ve tried, hoping that it will be useful to someone else who decides to go this route.
  • I´ve run the servos and the logic from the same power supply and from different ones. The last one I´ve used for the servos alone was 3A properly regulated.
  • I have made sure that, if using 2 PS, that the GNDs were common.
  • I have switched the pots from the hacked joystick from 100KΩ to brand new and noiseless 10KΩ.
  • I have tied all unused inputs from the Picaxe down via 10KΩ resistors.
  • I have tried to implement filtering in the code.
...and none of this has truly solved the problem.
The jitter has diminished considerably... but it is still there. I don´t think it is going to get any better than this, so I´ll move on to other things.

I want to express my most heartfelt gratitude to all those who took the time to read the thread and chime in ideas.


UPDATE (Sep 4th, 2011)
Down in the commentary section, Dan M. (among others) suggested trying servopos commands on their own, isolating them from the readadc commands. I has taken me a while, but finally I got around to trying it out. This is in the context of another experiment. However all the boards and servos are exactly the same as the PIC-AIM project, with the exception of the joystick. 
The idea come to me while watching one of Chris the Carpenter´s recent videos, a quick demo on a GGBot. That particular bot, while asleep, has the PING))) sensor looking straight down. When you wake it up, the turret tilts up for distance sensing in autonomous mode. I don´t know if that is only for personality sake or not. However, I thought that it would look cool to have just one (Sharp, in this case) sensor to determine distance and to make sure that there is floor ahead of the robot. You can watch what I have come up with in the last video uploaded.
With this experiment, it becomes obvious that the hardware is not the problem. I can also discard the joystick as a source of jitter, because I´ve changed all the pots in it. Conclusion: I don´t think my approach can be built like I wanted, at least not without the addition of a servo controller, like LordGG suggested in the comments. 

UPDATE (Sep 17th, 2011)
For some reason this project of Rick100 came to mind today. I reread his post and downloaded his code for the Picaxe 08M and found what could be the solution to my problem. I quote a bit of his code:
'couldnt use servo and servopos commands because of jitter
'used pulseout for servo pulses and pause commands adjusted with oscope to get close on timing
I will try to adapt his approach for my project tonight.
I´ll keep you guys posted.
Andrés

UPDATE (Mar 18th, 2012)
SUCCESS, finally! I admit this has taken longer than anticipated, but you see, in between I started a company and got married, so I´m sure everyone will understand. The first video from the top shows the laser death ray in action.
I guess the only thing left now, is to figure out a way to get it to the moon so I can fulfil my plan of taking the world hostage, in order to make a trillion dollars...
Andrés

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Let's see, you said: "I guess the only thing left now, is to figure out a way to get it to the moon so I can fulfil my plan of taking the world hostage, in order to make a trillion dollars..."


There is one suggestion.  One of the early Apollo flights placed a corner cube reflector array on the Moon.  You could always aim your death ray at that spot on the Moon.  The death ray should then be directed back to Earth... er... of course, it would direct it back to the exact spot where it came from.  Hmmm, well, on second thought, you may not want that… er… uh... Never mind.

Hey Dan,

Impeccable humour, as always!

It´s been a while. I read on the shout box the other day that you were not feeling all that well as a result from surgery. That´s too bad. Hope that turns out to be nothing.

Take good care of yourself!

Andrés

As to the hospital, I was there for surgery. Would like to turn this to humour, but it was not all that funny.  They removed a large tumor which proved to be cancerous.

After a couple months recovery, they operated a second time to hook everything back the way it was supposed to be. That was over two months ago. I am *almost* fully recovered now.

My concern now is hoping that the surgeon got all of it.  I noticed the first signs clear back in Nov. 2008. I didn't have it checked out as it was only a minor irritation at first that got worse very slowly, sometimes seeming to get better, but never totally.  I finally saw a doctor about it last October, and they scheduled me right away for surgery.  On the good side, I seem to be doing better than I have been for three years.    :-) 

I do hope that the surgeon got it all. You feeling better is certainly a good sign.

Keep us posted, please.

Andrés

Andrés:

I finally understand the jitter pain you dealt with.  I made a small edit to my robot hand program, uploaded to the PICAXE and.... instant jittering.  After much back and forth with the PICAXE support site, I came to the conclusion that the jitter was caused by the newer ver of the PICAXE editor I used to update the robot hand.  Some dissagrement followed, but I finally got a copy of the older PCIAXE editor and re-downloaded the program.  Problem solved and I was able to 100% correlate the jitter to the PICAXE editor rev.

You can read all about the discovery process here: http://www.picaxeforum.co.uk/showthread.php?20023-Robot-hand-suddenly-has-the-jitters

Hey Voltar,

I read the entire post and I felt you pain! BTW, you handled it nicely. I would have lost patience many posts earlier. It is amazing that it all came down to compiler and firmware versions! Lucky for you that someone suggested that.

As for me, I only changed my beat-up joystick with an analogue 2-axis one from Parallax. I also moved on from my homebrew Picaxe board to a professionaly made one. As far as I know, that could have made the difference. The rest of the components were all the same.

It works. And that is enough for me.

I´m glad your hand is working again.

Andrés 

I am not sure if there is still space left for another payload, but you coulod talk to MarkusB when he shoots his rocket to the moon.

Big thumbs up to Lumi! ;)

You could try oversampling to get rid of the ADC-Noise. Just add up 5 readings and then divide it by 5. Maybe you'll Be able to fix your problem.

 

Torrentula

Hey torrentula,

Thanks for the input. I had given that a try after a comment by user Gabriel_f. Unfortunately that didn´t solve the problem successfully.

Andrés