Solved

Finding direction of rotation

Posted on 2011-03-08
7
2,099 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
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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 100

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

The greatest common divisor (gcd) of two positive integers is their largest common divisor. Let's consider two numbers 12 and 20. The divisors of 12 are 1, 2, 3, 4, 6, 12 The divisors of 20 are 1, 2, 4, 5, 10 20 The highest number among the c…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now