As you have feedback I assume that you are regulating the speed of the servo. If you
turn the lens at a constant speed then:
1. grab the position
2. record the time
3. start a conversion and record the start time (rtl_get_time)
4. do this X times and record times for each.
5. go to 1 until you have your total number of samples
6. use the time information with the servo velocity to calculate the distance and
check with the recorded positions from 1&2
Things you will likely have problems with:
1. backlash (introduce friction and drive one way only. this has control implications
as u>0 for all time)
2. encoder resolution (or are you using a pot and taking readings?)
3. perfecting speed regulation to allow you to calculate the sample locations exactly.
4. Dither due to the PC bus as noted on rtl list.
Hope this helps perhaps stirring better thoughts from all,
Good luck and please let me know how you solved or tried to solve this.
John
On Wednesday, August 11, 1999 5:06 AM, Luis A. Aguirre [SMTP:[EMAIL PROTECTED]] wrote:
> Andrew Xiang wrote:
> >
> > I am doing a project that turns a lens using a servo motor for about 10mm
> > and take 10K readings in the interval. When the lens turns, it direct
> > different light into a detector and I take
> > reading from the A/D that is connected to the detector. The whole process
> > should take only about
> > 1-2 seconds or less.
>
> The time that takes to turn your servomotor depends on the load and the
> size
> of the motor. The load is made of actual lens load + the acceleration
> load.
> Is like moving a fast car with a 100 lbs load for one mile, takes less
> than
> moving 1000 lbs with the same car. Or, if you use a town truck to move
> the same loads you get different timings. As an extreme, a small lense
> on a
> "galvo" (short for Galvonometer) can rotate a small lens in
> microseconds.
> >
> > I have 2 ideas.
> > 1. First idea is to move the servo to a position, wait it for settle, and
> > then take reading; then repeat for 10K times. I suspect this will take too
> > long, like couple minutes.
> > Does anyone know how long it takes to move the Servo motor couple um and
> > settle?
> >
> > 2. Second is to do a scan, start move the motor, get the encoded locations
> > from the SERVO, and take A/D readings as fast as I can. This solves the
> > speed
> > problem, but how would I keep track the location I was in when I took the
> > reading. Even I have encoded location returned from the SERVO, I still need
> > to figure out the interval distance between the encoded location and the
> > actual location
> > when I took the reading?
>
> There are some motion boards ($$$) that have hardware position capture
> and
> can latch a position in less than a usec. But if your system is slow
> you can use the interrupt from your pc to latch the positions and the
> data
> at the same time.
>
> Luis.
> [EMAIL PROTECTED]
> --- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> ----
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/~rtlinux/
application/ms-tnef