Author Topic: What are possible ways I can track the orientation of an object?  (Read 6928 times)

0 Members and 1 Guest are viewing this topic.

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
What are possible ways I can track the orientation of an object?
« on: November 12, 2017, 10:19:22 pm »
Here's a photo that shows what I'm talking about:


I want to track the orientation of the device shown relative to a reference plane. The orientation is the angle "alpha" shown above. I don't think I can use a rotary encoder since there is no central shaft/axis that the device can revolve around. In fact, the movement of the device might not even be a perfect circle.

Can someone please advise what kind of component I would need? Can accelerometer , tilt sensor, or gyroscope work? What is the easiest way to implement this?

Thanks
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: What are possible ways I can track the orientation of an object?
« Reply #1 on: November 13, 2017, 12:48:21 am »
Need more information. If there is no fixed central point, then there are infinitely many solutions, unless device actually has a reasonably big plane.
Alex
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: What are possible ways I can track the orientation of an object?
« Reply #2 on: November 13, 2017, 12:52:21 am »
1) Laser and linear CCD array and algorithm to convert geometry into real position.
2) Magnetic field sensing.
2) Optical encoder.

Google "angular position sensing", lots of hits.

Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: What are possible ways I can track the orientation of an object?
« Reply #3 on: November 13, 2017, 12:53:13 am »
It would be helpful to know the scale of things as well.
Alex
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #4 on: November 13, 2017, 06:56:04 pm »
Thanks for the help so far.

Do you guys think this might work?
https://www.adafruit.com/product/1120

It's a accelerometer + magnetometer(compass). If I have a compass, then I would have a global direction. I can input the direction at the reference plane and take the difference to get a direction relative to the reference plane can't I?

The accelerometer would also be helpful because if I understand correctly, it know what position is "down" toward the ground, so I can even keep track of any tilt relative to the ground plane too.

Is the above true?
thanks
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: What are possible ways I can track the orientation of an object?
« Reply #5 on: November 13, 2017, 06:58:44 pm »
You have not provided enough information. Are we talking about mm scale, or meters? What accuracy do you need? Accelerometers and magnetometers accumulate errors, so you would need to calibrate the system from time to time.
Alex
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: What are possible ways I can track the orientation of an object?
« Reply #6 on: November 13, 2017, 07:06:05 pm »
What is the requirement for accuracy? 
What is the requirement for detection/reporting speed?

What is the nature of your "reference"? 
Is it fixed (at some azimuth relative to magnetic N/S?) 
Is is unpredictable?  (Stationary but of unknown reference?) 
Is it moving?
Is there provision for "calibration"?

What are detector conditions?
Size?  Mass?  Power?  Interface?
Does it have access to the planetary magnetic field? (Or is it inside a magnetically shielded enclosure?)

As @ataradov said, there are dozens of details missing that are necessary to suggest something practical.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12297
  • Country: au
Re: What are possible ways I can track the orientation of an object?
« Reply #7 on: November 13, 2017, 11:55:30 pm »
To the OP:
At the moment, your question is similar to "I need a ground transport solution."  For us to say whether one idea is better suited than another, we need more information.  Without it we could suggest a wheelbarrow, a bicycle, a car or a B-double.  If you wanted to transport another person, then all of these could achieve that - but some are less optimal as compared to others.

Since there are often more ways than one of doing something - and you are asking for guidance - we will need a better understanding of what you want to achieve ... with some detail.

As stated above, more information is required for a helpful answer.
« Last Edit: November 13, 2017, 11:58:56 pm by Brumby »
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5224
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #8 on: November 14, 2017, 12:34:27 am »
In the absence of detail about the problem here are some other ideas which have been used in the past to solve similar problems.

1.  Light point on ends of device, tracked by camera
2.  Ultrasound or IR distance measuring unit on device, measuring distance to reference
3.  IMU on device
4.  Laser reflected from mirror on device to linear array detector
5.  Capacitance sensors on ends of device.

Things which will affect technology selection and detail design include range of motion, accuracy required, size and cost allocation.

For example a really good IMU solution might be the large suitcase, cost hundreds of thousand dollars and provide minutes of arc resolution over many hours.   A cheaper IMU solution might be the size of a computer mouse, cost under a $1000, and provide degree type accuracy over a few minutes.  Any IMU solution will allow lots of geometry variation.  Other solutions may not allow geometry variation but will be cheaper and more accurate.
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #9 on: November 14, 2017, 08:59:46 am »
Thanks for trying to help. Sorry I didn't give enough info, I guess I didn't realize it's this complex. Maybe this scenario will help:

Imagine the device as a smartphone, with similar size/shape.

All it does is tell the angle (orientation) of its screen to a person's chest (reference plane).  Initially, the player will align the screen of this "smartphone" with his/her chest by pressing the screen against the chest, and clicking a button. Now the "smartphone" will know the what the reference plane is. To play the game, the player moves the "smartphone" around with his/her arm as if he/she is trying to take a selfie. (note, the screen is always facing the player, but can be at different orientation). The device should display the orientation (angle) at all times. The accuracy requirement is low, give or take 3-5 degrees is fine. A lag of 0.5 to 1 sec is okay too, so speed requirement is low too.

Of course, the device is not a smartphone, but i just used smartphone as an example to better illustrate the example as far as size, range requirement goes. Any method that can enable the above game would satisfy my need.

Thanks
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: What are possible ways I can track the orientation of an object?
« Reply #10 on: November 14, 2017, 05:19:43 pm »
If the duration of measurement before the next calibration is reasonably small (minutes) and movement is not too sudden, then you can use accel/magnetometer. But you will need to track both sides and to the math if person is moving.
Alex
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5224
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #11 on: November 15, 2017, 04:32:01 am »
Small SSOP size rate sensors and/or magnetometer should do this job pretty well.  They are cheap as well as compact.  Bias drifts need to be re-zeroed periodically (as in the period held against the chest to establish reference).  Many times accuracy can be improved by modelling the arm and joints and using this information to constrain the results from the rate sensors.

It is very challenging to estimate angles by integrating accelerations.  The requirements on scale and offset errors are extreme.
 

Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #12 on: November 15, 2017, 05:45:30 am »
A 3D accelerometer would give you the attitude at any time in X, Y, Z.
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5224
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #13 on: November 15, 2017, 07:03:48 pm »
A 3D accelerometer would give you the attitude at any time in X, Y, Z.

Yeah, sorry, my comment was really about rates.

A 3D accelerometer cannot resolve attitudes with rotational symmetry about the local vertical.  Most of the time a magnetometer can deal with that.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: What are possible ways I can track the orientation of an object?
« Reply #14 on: November 15, 2017, 09:18:55 pm »
A 3D accelerometer would give you the attitude at any time in X, Y, Z.

Yeah, sorry, my comment was really about rates.

A 3D accelerometer cannot resolve attitudes with rotational symmetry about the local vertical.  Most of the time a magnetometer can deal with that.

Magnetometer with only an accelerometer is usable only if the device moves very very slowly, otherwise the noise will make the data quickly useless. Also the magnetometers are slow devices - a typical accelerometer or gyroscope updates 1000x per second or more, a magnetometer typically only about 10-15x second.

If you want to go in this direction, then a better solution is a complete MARG - an accelerometer, gyroscope and magnetometer. The way it works is that you mostly rely on the gyro data which are nice low latency and with low noise and then "occasionally" (relatively speaking - still could be 100x a second!) correct for the gyro drift. Accelerometer gives the gravity vector, magnetometer corrected using the accelerometer for tilt gives you the magnetic north direction.

Now the math can be complex and building this out of three separate sensors is a pain - they need to have their axes perfectly aligned or you will have all sorts of weird and wonderful problems.

However, these days thanks to the smartphones one can buy something like the Invensense MPU-9250 integrated solution giving directly the orientation as a quaternion (or Euler angles, but those suck for all sorts of reasons). Another popular integrated device is the Bosch BNO 055 unit which also can do all the work for you.

The way the OP would use this would be to either build two of the sensors and have one fixed to the reference point. Then calculate the "difference" between the two orientations (there is some quaternion math for it). One sensor wouldn't be enough because the IMU is "absolute" and measures relative to the Earth (magnetic North & gravity directions). And this may change over time, e.g. by introducing metal near the apparatus. So it would have to be either calibrated quite often or just use two sensors.

I have built this kind of device using the MPU-9250 and an STM32F103 micro, it works like a charm. However, it is not a beginner project - the MPU-9250 can be fiddly and freeze if you send it bad data and soldering it is impossible without reflow oven or hot air - 0.4mm pin pitch QFN with 24 pins and some 3x3mm size ... if you don't mind larger size, there are some breakout boards for them though.

Also, if you don't have the knowledge/time to spend on this, you can actually buy a ready-to-go sensor - e.g. the InterSense InertiaCube:
http://www.intersense.com/pages/18/234

However, be prepared for the sticker shock. Moreover, the device doesn't do anything more than the MARG solution above.
« Last Edit: November 15, 2017, 09:32:04 pm by janoc »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: What are possible ways I can track the orientation of an object?
« Reply #15 on: November 15, 2017, 09:51:29 pm »
Rotating laser beam and sensor (like Larson Scanner).
But the user would have to wear a neck-tie made of retro-reflectors.

An accuracy of 3~5 degrees almost puts this into the stratospheric budget of government/military/industrial projects.

You would be better off using a camera with "face-sense" technology.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: What are possible ways I can track the orientation of an object?
« Reply #16 on: November 16, 2017, 09:27:47 am »
For example a really good IMU solution might be the large suitcase, cost hundreds of thousand dollars and provide minutes of arc resolution over many hours.   A cheaper IMU solution might be the size of a computer mouse, cost under a $1000, and provide degree type accuracy over a few minutes.  Any IMU solution will allow lots of geometry variation.  Other solutions may not allow geometry variation but will be cheaper and more accurate.

A very good MEMS IMU can be had for ~$20 in parts today, using one-off prices. Maybe not good enough to guide an ICBM on target but certainly good enough for e.g. human motion capture/animation or stabilizing a flying drone.

Those $1k prices were current maybe a decade ago, before the cheap MEMS sensors became widely available.
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #17 on: November 16, 2017, 09:57:07 pm »
A 3D accelerometer would give you the attitude at any time in X, Y, Z.

Yeah, sorry, my comment was really about rates.

A 3D accelerometer cannot resolve attitudes with rotational symmetry about the local vertical.  Most of the time a magnetometer can deal with that.

Magnetometer with only an accelerometer is usable only if the device moves very very slowly, otherwise the noise will make the data quickly useless. Also the magnetometers are slow devices - a typical accelerometer or gyroscope updates 1000x per second or more, a magnetometer typically only about 10-15x second.

If you want to go in this direction, then a better solution is a complete MARG - an accelerometer, gyroscope and magnetometer. The way it works is that you mostly rely on the gyro data which are nice low latency and with low noise and then "occasionally" (relatively speaking - still could be 100x a second!) correct for the gyro drift. Accelerometer gives the gravity vector, magnetometer corrected using the accelerometer for tilt gives you the magnetic north direction.

Now the math can be complex and building this out of three separate sensors is a pain - they need to have their axes perfectly aligned or you will have all sorts of weird and wonderful problems.

However, these days thanks to the smartphones one can buy something like the Invensense MPU-9250 integrated solution giving directly the orientation as a quaternion (or Euler angles, but those suck for all sorts of reasons). Another popular integrated device is the Bosch BNO 055 unit which also can do all the work for you.

The way the OP would use this would be to either build two of the sensors and have one fixed to the reference point. Then calculate the "difference" between the two orientations (there is some quaternion math for it). One sensor wouldn't be enough because the IMU is "absolute" and measures relative to the Earth (magnetic North & gravity directions). And this may change over time, e.g. by introducing metal near the apparatus. So it would have to be either calibrated quite often or just use two sensors.

I have built this kind of device using the MPU-9250 and an STM32F103 micro, it works like a charm. However, it is not a beginner project - the MPU-9250 can be fiddly and freeze if you send it bad data and soldering it is impossible without reflow oven or hot air - 0.4mm pin pitch QFN with 24 pins and some 3x3mm size ... if you don't mind larger size, there are some breakout boards for them though.

Also, if you don't have the knowledge/time to spend on this, you can actually buy a ready-to-go sensor - e.g. the InterSense InertiaCube:
http://www.intersense.com/pages/18/234

However, be prepared for the sticker shock. Moreover, the device doesn't do anything more than the MARG solution above.


Thanks for the help, and to all others who have contributed.

I'm going to digest this a little and do some more research in the next couple of days. But the gist I'm getting is that this is no beginning project.

I wonder if using the following assumption would make the project easier (ie, only a magnetometer is needed):

1. The user doesn't move, so the reference plane (chest) is fixed.
2. Every time the user "play" the game, he/she always orient himself such that he is facing North. This way, a global reference can be used.

I wonder if the accuracy requirement is relaxed to +- 10 degrees and speed is not critical (a few seconds for calculation), a magnetometer by itself is sufficient?
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: What are possible ways I can track the orientation of an object?
« Reply #18 on: November 17, 2017, 03:02:00 pm »
Thanks for the help, and to all others who have contributed.

I'm going to digest this a little and do some more research in the next couple of days. But the gist I'm getting is that this is no beginning project.


It would help a lot if you could describe what are you exactly attempting to accomplish. Depending on that there could be other solutions too.

I wonder if using the following assumption would make the project easier (ie, only a magnetometer is needed):

1. The user doesn't move, so the reference plane (chest) is fixed.
2. Every time the user "play" the game, he/she always orient himself such that he is facing North. This way, a global reference can be used.

I wonder if the accuracy requirement is relaxed to +- 10 degrees and speed is not critical (a few seconds for calculation), a magnetometer by itself is sufficient?

Hum and how is the player going to know which way is "North"? Are you going to give them a compass? Also, keep in mind that magnetometer quite sucks for whenever it is tilted even few degrees (roll/pitch). What you will get out of it is an x,y,z vector (not bearing in degrees - you need to calculate that) specifying the direction to the local magnetic North, affected by whatever magnetic noise you may have - metal nearby, magnets, loudspeakers, motors, etc. It is not the best sensor alone.

If you only need a relative measurement, gyro is actually better. You only need to make sure you have some way to "reset" it every once in a while (every few seconds) because after a few turns it will accumulate drift. Depending on what exactly you are doing it could be achieved e.g. by a light sensor getting triggered when the user turns into a known orientation.

BTW, this is something you can easily implement e.g. using a Wiimote. The Motion+ accessory (the newer Wiimotes have it built-in) is a gyro and you can use the "sensor bar" and the infrared camera on the Wiimote to reset the drift. Of course, this works best when the user is facing in the "forward" direction most of the time.
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #19 on: November 18, 2017, 08:39:01 pm »
Thanks for the help guys. Upon digesting everything I've read, I feel using gyro/accelerometers is a bit complicated for now. It is probably not suitable for a beginner. I thought about ways to simplify the problem. Rather than tracking the device orientation in free space, I decided to add a constraint. There can be a path that the device has to move along, and if I know the shape of the path and its location along the path, I can derive the rough orientation.

Let me rephrase the problem:

Let's say I'm trying to design a toy involving some small toy cars on a path. The path starts at a starting point A, and I want to know the distance the car is from point A. If the path is straight, I can use something like a proximity sensor, but the path can be S shaped and there might be obstacles that block lasers or other optical methods.

The path is shaped such that as the car increase the path distance from starting point A, the 3D Euclidean distance from A increases also. If I can track either, I'm okay.

I don't want to use a string with an rotary encoder because the user might want to pick up the car. Having a string attached to the car is awkward. I also don't want to have the car count some kind of "steps" as it traverse the path because the user might pick up the car and place it some where else on the path. Even when this happens, I want to be able to track its new location along the path (or the Euclidean distance to the starting point).

Having the car recognizing some pattern on the track is too technically demanding for me now. I'm thinking about an approach that uses magnets. Please tell me if this might work: If I place magnets of different strength along the path at fixed intervals (say, every 2cm), then if the car can track the magnet strength (and/or directions) using a magnetometer, it should know its rough location. This also do away with strings/wires and is much cleaner.

I'm don't have high requirements for positional accuracy (the car only needs to know which interval it is in) nor speed of response. (ie, I don't need to track the location as the car is moving at a high speed, only when it is stopped).
Thanks
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #20 on: November 18, 2017, 08:58:18 pm »
Depending on your final application, using an actual inexpensive smartphone might be the easiest route for a beginner. No hardware, only software, readily available dev tools and sample code, etc.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11234
  • Country: us
    • Personal site
Re: What are possible ways I can track the orientation of an object?
« Reply #21 on: November 18, 2017, 09:02:25 pm »
Does the car need to know its position, or you need to know position of the car?

In any case, I'd look at RFID technology. Almost like your magnet proposal, but you can actually transfer data, so the whole thing will be more robust.

And if you need to know position of the car, but the car itself does not care, then a lot of coils in the track, and a magnet on the car will do the trick.
Alex
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5224
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #22 on: November 19, 2017, 03:49:43 am »
A very simple solution for this application is to turn the track into a long linear potentiometer.  Depending on your accuracy requirements you might choose to segment the track with discrete resistors, or use resistance wire.  Accuracy will also determine how many counts the ohmeter needs and whether you have to worry about things like contact resistance and temperature.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: What are possible ways I can track the orientation of an object?
« Reply #23 on: November 19, 2017, 01:23:37 pm »

Having the car recognizing some pattern on the track is too technically demanding for me now. I'm thinking about an approach that uses magnets. Please tell me if this might work: If I place magnets of different strength along the path at fixed intervals (say, every 2cm), then if the car can track the magnet strength (and/or directions) using a magnetometer, it should know its rough location. This also do away with strings/wires and is much cleaner.

I'm don't have high requirements for positional accuracy (the car only needs to know which interval it is in) nor speed of response. (ie, I don't need to track the location as the car is moving at a high speed, only when it is stopped).
Thanks

Don't use magnetometers - they are way too sensitive and you will have all sorts of problems with noise and what not. If you want to put magnets on the track, then a simple coil on the car to pick up the magnetic field will do you a much better job.

Another good alternative could be the RFID mentioned by someone above. Either put the tag on the car and pick up coils along the track or you can have the coil on the car - each has advantages and disadvantages.

Heck, you could even print and stick barcodes to the track and read them as the vehicle is passing over it.

Or, if  you only need a very simple position tracking, put a reed relay in the strategic places of the track that will be triggered by a magnet on the passing car. Or a simple photo interrupter setup (LED + phototransistor). It doesn't get much simpler than that.

It is a pity that you didn't describe this part about a car on a track right away - it could have saved you the entire discussion about IMUs and lasers and what not. Tracking orientation is a very different problem from tracking a position of a moving object along a track, the latter being simpler.
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
Re: What are possible ways I can track the orientation of an object?
« Reply #24 on: November 19, 2017, 08:33:52 pm »
A very simple solution for this application is to turn the track into a long linear potentiometer.  Depending on your accuracy requirements you might choose to segment the track with discrete resistors, or use resistance wire.  Accuracy will also determine how many counts the ohmeter needs and whether you have to worry about things like contact resistance and temperature.

Thanks everyone, but I believe this is probably the simplest solution for my need.  I believe for this solution, the car is essentially an ohmmeter, it can get the resistance of the track at different points and translate it into location directly.

Does anyone see any flaws with this?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf