PDA

View Full Version : New guy with questions



ducktapeguy
03-01-2005, 06:07 AM
Hi, I'm very new to all electrical and computer stuff, so bear with me if these are dumb questions.· I've got a project where I need to control a couple of servos of a steering shaft.· I was trying to come up with a simple solution, when I friend recommended using a basic stamp to control it.· I started looking at the possibilities, and I think it might work.· However, since I'm completely ignorant at this, I had a few questions.

1)· Can I use the input from an optical or regular mouse to control it?· I think it is some sort of square wave, but I have no experience.· Anyone know?

2)· Assuming it is some sort of encoder that outputs a square wave, can a basic stamp be programmed to keep the position?· For example, the steering shaft is able to rotate 1080 degrees or so, but a servo only rotates for 180 degrees.· If I were to turn the steering wheel from center and move the servo, the servo will hit it's limit a lot sooner than the steering shaft.· When I turn it back, will it be able to keep track of where the original zero (i.e. centered position)·is?

3) Which basic stamp is best for this application?· I see a lot of choices for the basic stamp, and even a servo control kit which looks very similar to what I want, but will it work?· I already have servos and stuff,·but if it's easier to get everything in that package then I'd be willing to pay a little extra.· I just want to make sure this is possible before I start spending money.

·

kelvin james
03-01-2005, 03:09 PM
I don't know about anyone else, but i am a little confused on what you are trying to accomplish here. If you can go into detail on the exact operation you are trying to create, it will be a lot easier to give some answers. Like, are you physically turning the steering wheel, or are you using servos to turn the shaft, or do you just want to monitor the position of the shaft? There are many ways to deal with any of this, and the stamp will handle all of them.

kelvin

Jon Williams
03-01-2005, 09:47 PM
The instruction load times of the BASIC Stamp may preclude the direct use of a mouse or similar device. There are interface chips that make connecting a mouse to a BASIC Stamp simpler, or you could consider using the SX micro and our SX/B compiler.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA

The Dead Bug
03-02-2005, 12:21 AM
FYI on mice...

Having hacked mice before to try to use them for other things I can tell you that a clean simple square wave is not so easy to get. The chip in the mouse puts out a rather complex serial code every time the mouse is moved that has position and direction data. The output from each chopper·sensor is (if I recall correctly) undulating DC the peaks of which vary in frequency and amplitude with the speed of motion. That's where I stopped. It was just going to be more work than my applicatiion justified.

Bruce

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Name: Bruce Clemens

Work:· Clemensb@otc.edu (mailto:Clemensb@otc.edu)
Good Stuff on my Bolg: http://theDeadBug.journalspace.com (http://theDeadBug.journalspace.com)

ducktapeguy
03-02-2005, 12:54 AM
Thanks for all the responses, I'll try and clarify my intentions. Basically, what I want is to have an optical mouse control a servo. So when I move the mouse left or right, I can get the servo to move left or right. The whole part about the steering shaft was the end use for it. I was going to mount the mouse over a shaft, so instead of moving the mouse over a flat surface, in reality it's reading the outside diameter of a shaft while it's rotating. I think those two would be pretty much the same in terms of the mouse inputs. I guess to simplify the problem, I want to use my mouse as a position sensor instead of buying a rotarty encoder.

As for the second part of my question, I'll try and describe what I mean. Imagine if I'm moving the mouse over a flat surface. And for every inch of mouse movement my servo moves 90 degrees. So if I start out at a zero position, and move my mouse 10 inches to the left, the servo will only respond for the first inch of movement, after that, it will have reached it's limit. Now I'm 10 inches to the left, if I start moving it back to the right, will the servo start moving immediately and I will reach the nominal position at 9 inches? Or can I program it to keep track in such a way that will will know to start moving again only AFTER I have moved 9 inches to the right and therefore return to the nominal position when I hit zero again? I guess in mechanical terms that would be considered hysteresis.

Deadbug,
I was doing more research, is it possible to use the outputs straight from the mouse, without hacking it down to the optical encoder level? According to one website, the mouse sends out 3 bytes of information everytime it moves. Will the basic stamp be able to read those? Like I said, I'm not too familiar with all this stuff, I come from strictly a mechanical background.

Jon,
When you talk about load times for the basic stamp, does that mean an optical mouse overloads it with information that it can't keep up? And does that depend on how fast the mouse is moving? I won't need much speed for this application, nor that much precision,so I don't know if that helps any. And I'll look at some of those other chips mentioned.



Thanks for all the help, I appreciate it.

Jon Williams
03-02-2005, 06:31 AM
"Much speed" is a relative term. If you have a serial mouse that is sending serial data you may be able to make it work ... sort of. My colleague, Andy Lindsay, did a mouse-to-servo control demo using the Javelin; but then, the Javelin has buffered serial so it doesn't miss data while doing other things.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA

The Dead Bug
03-02-2005, 09:08 AM
I can't give you much more from experience as I didn't go any farther after my initial mouse investigations. I will say that Stamp is technically capable of decoding that data coming from the mouse but it might be too slow for what you are doing. I would think a Javelin or certainly an SX could keep up. You might try a simple proof-of-concept project using the BS2 to assess whether you have the speed necessary and then try to port it to an SX under SX/B.

Maximize your chance for success by doing this in small manageable increments and you will be solving only one problem at a time.
Good luck,

Bruce

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Name: Bruce Clemens

Work:· Clemensb@otc.edu (mailto:Clemensb@otc.edu)
Good Stuff on my Bolg: http://theDeadBug.journalspace.com (http://theDeadBug.journalspace.com)

ducktapeguy
03-02-2005, 12:49 PM
Thanks for all the responses.· From what it sounds like, I can technically make it work with a basic stamp, but I'm probably better off using some other form of control.·· Am I going down the right path here trying to·use a Stamp in this way?· Or am I way off and should be looking at something else completely?· And would this be something that would make it work?

http://www.awce.com/pak11.htm

I might get a Basic or Javelin stamp anyway because I think I want to try and learn this stuff.

Jon,
Is this what your coworker worked on?
http://www.parallax.com/javelin/applications.asp#AN010
I'm trying to read it but it's almost like reading a foriegn language for me.·


Thanks for the help, I appreciate it.· I'll probably be asking a lot more questions in the future.



Post Edited (ducktapeguy) : 3/2/2005 4:52:34 AM GMT

Paul Baker
03-02-2005, 01:29 PM
why not just use a slide pot (if you want 1 degree of freedom) or a joystick (for two axis of freedom)? Im refering to the potentiometer type joystick and not the cheap shaft mounted to 4 buttons type.

ducktapeguy
09-27-2005, 12:32 AM
I'm back again with more questions :)

I've taken a break from this project, but now I'm starting working on it again.

Just to clarify what my original intentions were, I'm trying to control a servo using an optical mouse. From the responses here and on some other posts, it seems that the Basic stamp can't handle the input from the mouse. But, there are other boards I can use to make this possible?

PAK-XI
http://www.awce.com/pak11.htm

or this?
http://www.awce.com/gp5.htm

It seems like PAK-XI is cabable of doing this, but is it easier if I use the GP5? Seems like the GP5 would output a simple position command that I can input to the stamp, at this point I'm willing to spend the extra money if it makes my life easier.

And I also found this
http://www.multilabs.net/ezMOUSE.html

I'm still not clear what the ezMouse does though, but it seems like it would help

I know the SX chip was recommended for this, but I'm having enough trouble trying to learn how to use the Basic stamp, I think I would have even more trouble learning the SX one.


Thanks again