Solved

Finding direction of rotation

Posted on 2011-03-08
7
2,295 Views
Last Modified: 2012-05-11
There is a disk on a turn table. Half of it is black, and the other half is white. It is rotating in constant speed, but it's rotating fast so that you can't see whether it's going clockwise or counterclockwise. You also have a set of stationary sensors you can install anywhere which can tell whether the color of a spot has changed from black to white, or vice versa. What is the minimum number of sensors needed to find out which way the disk is rotating? What is the best, average, worst time to figure out the direction? If you use more sensors, can you improve the best, average, worst time? How can you accomplish that? If you are given only one sensor, how can you find out the direction, assuming you can change one constraint of the problem?
0
Comment
Question by:surajguptha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 35072981
Popular interview question this year
Try this
0
 
LVL 21

Author Comment

by:surajguptha
ID: 35073242
If the sensor could just find if something has changed from white to black or black to white and there are two of them, how can you determine the direction of flow? I still don't get it. The sensor would just say white-black or black white. I can't seem to write a computer program that takes these values and makes a decision even if I know the speed of the turn table. I am feeling dumb, Can you kindly break it down for me?
0
 
LVL 32

Accepted Solution

by:
phoffric earned 168 total points
ID: 35073509
    OK to assume that the black covers 1/2 semi-circle and white the other half?
     OK to assume that no matter how fast the RPM is, the sensor is able to send a signal when there is a change in color?
     If so...

>> You also have a set of stationary sensors you can install anywhere which can tell whether the color of a spot has changed from black to white, or vice versa.

    The sensors don't even have to be able to tell whether black turned to white, or vice versa. It just needs to send a signal indicating that a color transition occurred.

    Two sensors very close to each other near the rim of the turn table should suffice. Facing the turntable at level position, you can call them L and R for left and right. When a color state change is detected, then a signal is sent to the computer which has two channels, one for L and one for R. So the computer reads 0 or 1; 0 means no state change detected; 1 means a state change has occurred.

Consider the sequence.
L R
0 0  // no state change for either sensor
0 1  // the right one has seen a transition
1 0  // the left one a short distance away has seen a transition
0 0  // the transition has past both

This sequence means that the dividing line between the two colors went from right to left, which mean clock-wise.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 62

Assisted Solution

by:☠ MASQ ☠
☠ MASQ ☠ earned 166 total points
ID: 35073545
If the disk is half black and half white you have a single line running along the diameter which represents the change in state (if you like on or off) when viewed by the sensor.

Grab two sensors and place them at equal distances from the center of the disk so they measure the same point on that line.  Place them a short distance apart, maybe 15 degrees.  Then record the time between them being triggered by a change of state.

Does this allow you to determine the direction of spin?
0
 
LVL 16

Assisted Solution

by:HooKooDooKu
HooKooDooKu earned 166 total points
ID: 35073680
With some assuptions, the two sensors can be used to determine the direction of by tracking the timing of when the sensors detect the white to black and black to white transition.

Now a few of the assuptions:
1. The two sensors can not be directly opposite each other, and you know their relative locations.
2. You get to either query the sensors and they tell you the current color under them, or the sensors are linked to your computer in an interupt pattern such that each time a sensor changes, an event is triggered in your program.
3. The speed of the sensors and your computer are MUCH faster than the disk (i.e. if you are having to pole the sensors, you can pole the sensors MANY times in one disk revolution.

Now all you need to do is build a time history of the change to determine the pattern of the black-to-white and white-to-black transitions and determine at any given moment where each sensor is in the pattern and what their current value is.

For example, lets say that we can sample the disk 12 times per revolution and the disk is painted with the left side black and the right side white (i.e. in one revolution there is only one transition from black to white and one from white to black).  Lets also say the sensors are 90 degrees appart.

With this setup, we can reprsent the history of what the sensors sees like this: "BBBBBBWWWWWWBBBBBBWWWWWW".  Basically, the first 6 samples saw black, the next 6 samples saw white, etc.

Now just look at the side by side history of the two sensors.

If Sensor 1 is at the 12 o'clock position and sensor 2 is at the 3 o'clock position, and the history pattern of the two sensors looks like this:
Sensor 1 "BBBBBBWWWWWWBBBBBBWWWWWW"
Sensor2 "BBBWWWWWWBBBBBBWWWWWWBBB"
You can see that the transition from black to white happens in sensor 2 before it happens in sensor 1, so the disk must be spinning counter clock wise.
we don't have a star-burst pattern of alternating black and
2. The sensors are either is is a dynamic system (i.e. the disk is spinning, the sensors
If the black/white pattern is different that the spacing of the sensors (i.e. if the left side is black and the right side isthe two sensors are NOT directly opposite each other, and the spacing of the black/white pattern is differe , and you are somehow getting data in something of real time (i.e. either as the sensors are constantly sending data
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36275164
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Nadia
Suppose you use Uber application as a rider and you request a ride to go from one place to another. Your driver just arrived at the parking lot of your place. The only thing you know about the ride is the license plate number. How do you find your U…
Prime numbers are natural numbers greater than 1 that have only two divisors (the number itself and 1). By “divisible” we mean dividend % divisor = 0 (% indicates MODULAR. It gives the reminder of a division operation). We’ll follow multiple approac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question