Narrowboater
Active member
My project is to move the head of a metal-working mill using a stepper motor controlled by a T3.6, using the mill's built-in DRO to know where the head has got to. (This is not the usual way of doing it.)
The DRO display provides power to the Scale which reports the movement by changing the high/low level of 3 output lines A, B, Z, (which I will denote as uppercase for going high and lowercase for going low).
These lines go back to the DRO display which counts them and displays the changing position.
I have intercepted these lines and feed them into the T3.6 as well.
The lines are long, of the order of 2 metres.
Each line goes into a pair of Teensy pins, to one of which I have attached a RISING ISR and the other a FALLING ISR. The "rising" pin of each pair is set as INPUT_PULLUP and the other, the "falling" pin as INPUT. They go in via a SN74AHCT125 to convert the DRO 5V to 3V3 for the T3.6 and have a 0.1 microfarad capacitor across the 125 supply.
I need to catch both as each constitutes a movement (5 microns).
The normal pattern of responses is ABabABabABab… etc or BAbaBAbaBAba… depending on the direction of movement.
My problem is that occasionally (after a lot of good events) I get eg BAaba where I have got two consecutive "falling" interrupts without an intervening "rising" interrupt on a single line. The pattern suggests that one of these (the first, immediately after the line rising) is spurious rather than a "rising" interrupt being lost. This happens on any of the 3 lines.
I have not seen consecutive "rising" events but cannot rule out that they may occur.
I am a retired programmer with only a basic knowledge of electronics.
I would appreciate answers to the following questions:
1. Is my pairing of input pins legal?
2. Can poor signal quality result in consecutive falling interrupts without an intervening rising interrupt?
3. Is the INPUT_PULLUP/INPUT setting affecting the problem?
4. Is there anything else unsatisfactory about what I have described?
I am asking if there any elephants here, before submitting huge quantities of code!
The DRO display provides power to the Scale which reports the movement by changing the high/low level of 3 output lines A, B, Z, (which I will denote as uppercase for going high and lowercase for going low).
These lines go back to the DRO display which counts them and displays the changing position.
I have intercepted these lines and feed them into the T3.6 as well.
The lines are long, of the order of 2 metres.
Each line goes into a pair of Teensy pins, to one of which I have attached a RISING ISR and the other a FALLING ISR. The "rising" pin of each pair is set as INPUT_PULLUP and the other, the "falling" pin as INPUT. They go in via a SN74AHCT125 to convert the DRO 5V to 3V3 for the T3.6 and have a 0.1 microfarad capacitor across the 125 supply.
I need to catch both as each constitutes a movement (5 microns).
The normal pattern of responses is ABabABabABab… etc or BAbaBAbaBAba… depending on the direction of movement.
My problem is that occasionally (after a lot of good events) I get eg BAaba where I have got two consecutive "falling" interrupts without an intervening "rising" interrupt on a single line. The pattern suggests that one of these (the first, immediately after the line rising) is spurious rather than a "rising" interrupt being lost. This happens on any of the 3 lines.
I have not seen consecutive "rising" events but cannot rule out that they may occur.
I am a retired programmer with only a basic knowledge of electronics.
I would appreciate answers to the following questions:
1. Is my pairing of input pins legal?
2. Can poor signal quality result in consecutive falling interrupts without an intervening rising interrupt?
3. Is the INPUT_PULLUP/INPUT setting affecting the problem?
4. Is there anything else unsatisfactory about what I have described?
I am asking if there any elephants here, before submitting huge quantities of code!