| ??? 12/03/00 05:17 Read: times |
#6911 - RE: Digital encoder |
John,
When the increment/decrement doesn't work, my guess is the pulse rate exceeds the rate at which the scan code is called in the program and the "syncing" between the last stae and currnet state is lost. If my assumption is true, it seems there are a couple alternatives available - (1) call the scan code more often, (2) use an interrupt line to detect the direction each time the A phase goes through an edge. If an interrupt line is available on the micro, I suggest you connect the A phase to it. When the interrupt occurs, look at the B phase. If the B phase is low, the encoder is being turned CW (since according to the Bourns spec the encoder outputs a 2-bit gray code, Channel A leads Channel B by 90ยบ electrically turning clockwise). Conversely, if the B phase is high, the encoder is being turned CCW. On each occurence of an interupt, increment or decrement a software counter to keep track of the position. I assume the power supply has digital control loops for voltage and current regulation, and that those loops are called on a periodic basis. If so, the encoder interrupt should be disabled while critical control loops are serviced. Good Luck, Bruce |
| Topic | Author | Date |
| Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| Wrong counts, Debouncing | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
| RE: Digital encoder | 01/01/70 00:00 | |
RE: Digital encoder | 01/01/70 00:00 |



