Help with POV disk drive clock math

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I am trying to build a POV clock out of an old hard drive. If you have not see one of these things, tjhe way it works is there are several slots that contain LEDs (in my case 8 slots).

A disk with numbers carved into it rotates when the hard drive spins. The MCU senses a home sensor and lights the LED in the appropriate slot just at the right time to display the required number in that potion.

The math to calculate when to display a column of LEDs in a conventional LED clock is fairly easy.

To makes things simple let us assume that one rotation of the "clock" takes 360ms. Since there are 360 degrees in a circle each degree takes 1ms. So to display the column at 10 degrees a timer simply needs to be started for 10ms (some people just use a delay) to display the LEDs in that postion.

An overly simplified explanation but hopefully you get the idea.

I am trying to figure out how to make the POV timing work in my case. A drawing of the "slots" and the disk show below (they may not be in scale). The arrow on the slot drawing shows where the Hall sensor is located. The arrow on the disk is where the magnet is located.

The disk moves is a clockwise position. The center of the first slot is about 110 deg from the sensor.


What I am thinking is that I need to measure the location for the numbers in the opposite direction. So the number zero would be at about 345 degrees from the magnet

Getting back to our 1ms per degree example, I am thinking I would simply add 110 to 345 for a total of 445 ms to display 0 in the first position. So it would display on the next rotation. I think I would have to set the timer every other sensor interrupt.

Anyone see any flaws in this plan?

upload_2018-10-30_13-26-20.png





upload_2018-10-30_13-25-16.png
 

nsaspook

Joined Aug 27, 2009
16,321
I wouldn't think of the problem in terms of degrees of rotation. This is a timing problem at its root not one of angular position, that's the result of proper timing. You need a precise zero reference point and at least a 16-bit counter (near max counts for one rotation) to keep track of time between rotation timing marks. You can use the controller module(s) hardware to generate interrupts at counter values, comparisons (count and compare registers) between values, etc ... to keep track of symbol location (on the disk) and slot position for strobes once the symbol in X position math translates that to a counter time value to be added to a list of rotational strobe times.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I wouldn't think of the problem in terms of degrees of rotation. This is a timing problem at its root not one of angular position, that's the result of proper timing. You need a precise zero reference point and at least a 16-bit counter (near max counts for one rotation) to keep track of time between rotation timing marks. You can use the controller module(s) hardware to generate interrupts at counter values, comparisons (count and compare registers) between values, etc ... to keep track of symbol location (on the disk) and slot position for strobes once the symbol in X position math translates that to a counter time value to be added to a list of rotational strobe times.

Yes I realize the issue is a timing problem But I need a way to calculate the timing. That has to come from when the disk hits home and the positionof the numbers on the disk and the postion of the "slots". Certainly I could use trail and error for a given RPM but I would like to develop a formula in the event that RPM changes.
 

nsaspook

Joined Aug 27, 2009
16,321
Yes I realize the issue is a timing problem But I need a way to calculate the timing. That has to come from when the disk hits home and the positionof the numbers on the disk and the postion of the "slots". Certainly I could use trail and error for a given RPM but I would like to develop a formula in the event that RPM changes.
Sure, I was just saying you don't need to calculate angles on the fly. All the information needed can be obtained from the RPM rotational count timer total between home flag pulses and fractional ratios of the total count for disk numbers and slot positions. A properly designed scan converter formula should generate a scan list of strobe time(s) per clock digit(s) per rotation(s) that will execute, modify the list with changing clock time and repeat execution.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Sure, I was just saying you don't need to calculate angles on the fly. All the information needed can be obtained from the RPM rotational count timer total between home flag pulses and fractional ratios of the total count for disk numbers and slot positions. A properly designed scan converter formula should generate a scan list of strobe time(s) per clock digit(s) per rotation(s) that will execute, modify the list with changing clock time and repeat execution.

OK but how do I do all of that? I know I don't need to calculate angles on the fly but don't I need to be aware of the position of everything to be able to calculate timing?

I wish I could find the article but I found an article that described how o do the timing in terms of degrees just like I described.

I can find tons of articles on how to build a POV clock but non detail the way the timing is done (other than the one I found).
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Isn't that the one I told you about last time you brought this up? The one you didn't want to use?

I do not recall . Not sure why I would say that. Unless I did not see this particular page. What I don't want is a whole project handed to me. I like to figure that out. What i do want is basic theroy of operation on timing. Tht page appears to do that but from the sound of it, it might be wrong. Not sure how else it could be done. :confused:
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I am wondering if multiple magnets will help? I can have two Hall Sensors one for north pole one for south. One home magnet. One magnet for each character. The home magnet interrupt would trip and then the character magnet interrupt would start counting to get to the proper character. Then it would be a simple matter of timing to get it to the right place.

I could get really crazy and have a sensor on each character slot. I need to noodle on that one.
 

BobaMosfet

Joined Jul 1, 2009
2,211
One of the things about solving any problem as an engineer, is identifying the limits first. The limits determine everything else. In this case, your fundamental limit is the RPM of the disc. Because that determines how quickly you must be able to read and or measure anything else in relationship to time. If you're going to use a hard-drive motor and turn at disc at it's natural 7200rpm frequency, you're only going to have 8.3ms per revolution- too little time to do much depending on how you do it, or what you use.

Your hall sensor is your zero point.

Don't work in degrees, work in ticks. A 'tick' being on increment of your interrupt. Using your hall sensor, you should be able to determine how many ticks exist between each pass of the hall sensor. Divide that by digit positions equadistant around the circumference of your disc 'dial', and then you know how many ticks from zero it takes to get to each position of a digit.

Once it's up and spinning, you can monitor RPM, tick-count, and then all you have to do is reset your 'counter' to zero when you see the hall sensor, and let it be incremented automatically by your interrupt. Compare that value with the value needed to be at the 'start' position for whatever character you want to display, and voila... once you're there, due your thing.

Just one idea.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
One of the things about solving any problem as an engineer, is identifying the limits first. The limits determine everything else. In this case, your fundamental limit is the RPM of the disc. Because that determines how quickly you must be able to read and or measure anything else in relationship to time. If you're going to use a hard-drive motor and turn at disc at it's natural 7200rpm frequency, you're only going to have 8.3ms per revolution- too little time to do much depending on how you do it, or what you use.

Your hall sensor is your zero point.

Don't work in degrees, work in ticks. A 'tick' being on increment of your interrupt. Using your hall sensor, you should be able to determine how many ticks exist between each pass of the hall sensor. Divide that by digit positions equadistant around the circumference of your disc 'dial', and then you know how many ticks from zero it takes to get to each position of a digit.

.
Don't think in degrees but think in degrees then? That is exactly what "positions equadistant around the circumference" are.
 

nsaspook

Joined Aug 27, 2009
16,321
Don't think in degrees but think in degrees then? That is exactly what "positions equadistant around the circumference" are.
Degrees as a means to the problem solution is useful for the physical layout of the system design. If all sections are symmetrical and will mirror image once you know the single section timing finding the needed slot position and disk position in time per RPM is only a factor of addition and subtraction of time units.
 
Top