Hi
Maybe it's a dumb question, but I've spent 2 evenings trying to solve it. After some manipulations with "smooth mpg" programs IO0 pin has 3.3v on it, though It's configured as Input, both in INIT program and via command in console. At IO screen it has the checkbox 'state' checked, as shown in attached screenshot. Before messing with MPG (by the way I could'nt configure it properly) IO0 was an input for Z home sensor and worked well. I've tried 'SetBitDirection', "SetBit, 'ClearBit', even "ClearBitBuf' - still no luck.... And last but not least - now IO0 and IO1 work in pair - for example if I check the box 'output' for IO0 it gets checked for IO1 automatically. What could be the problem?
Voltage on Input
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Voltage on Input
Hi AlexD85,
That is probably normal. KFLOP inputs have very high impedance (meg-ohms) so an input not connected to anything can float to any voltage. Also there can be some small parasitic capacitance between traces on the board or wires in your cable that may cause one signal to change if an adjacent signal changes if the first signal is floating and undriven. An input should only be considered meaningful if it is connected to something that drives the pin high or low.
To test the inputs connect them through something like a 1K ohm resistor to either GND or +3.3V. The measured input voltage using a voltmeter should measure within several tenths of a volt to what it is connected to and the Digital IO Screen should change appropriately. Driving both inputs at the same time, to all 4 possible states, should work correctly.
HTH
That is probably normal. KFLOP inputs have very high impedance (meg-ohms) so an input not connected to anything can float to any voltage. Also there can be some small parasitic capacitance between traces on the board or wires in your cable that may cause one signal to change if an adjacent signal changes if the first signal is floating and undriven. An input should only be considered meaningful if it is connected to something that drives the pin high or low.
To test the inputs connect them through something like a 1K ohm resistor to either GND or +3.3V. The measured input voltage using a voltmeter should measure within several tenths of a volt to what it is connected to and the Digital IO Screen should change appropriately. Driving both inputs at the same time, to all 4 possible states, should work correctly.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Voltage on Input
Hi Tom
Thanks for your reply. The problem is that this input IS connected via optocoupler board to Z Home proximity sensor (NPN), and when I try home Z, Kfop sees 'high' on input and zeroes the axis right in the place. Another strange behaviour is when I check the box 'output' on DigitalIO screen for IO0, checkboxes 'state' is deactivated both for IO0 and IO1, is it normal?
Thanks for your reply. The problem is that this input IS connected via optocoupler board to Z Home proximity sensor (NPN), and when I try home Z, Kfop sees 'high' on input and zeroes the axis right in the place. Another strange behaviour is when I check the box 'output' on DigitalIO screen for IO0, checkboxes 'state' is deactivated both for IO0 and IO1, is it normal?
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Voltage on Input
Hi AlexD85,
Well a normal open-collector type of NPN output will only drive the pin low and not high. When not being driven low it may float to any level and report any state. But that problem would result in the state being low when it should be high not what you describe. Although it also depends on how you have the sensor wired. Please check the KFLOP inputs for correct operation with the test I described in my previous email. That will help isolate whether the KFLOP inputs have a problem or if the way you are driving them is a problem.Thanks for your reply. The problem is that this input IS connected via optocoupler board to Z Home proximity sensor (NPN), and when I try home Z, Kfop sees 'high' on input and zeroes the axis right in the place.
As I tried to describe this may be normal if the inputs are not being driven properly high and low.Another strange behaviour is when I check the box 'output' on DigitalIO screen for IO0, checkboxes 'state' is deactivated both for IO0 and IO1, is it normal?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 21
- Joined: Tue Nov 20, 2018 5:39 pm
- Location: Sharonville, Ohio
Re: Voltage on Input
Tom,
I used your advice above;
To test the inputs connect them through something like a 1K ohm resistor to either GND or +3.3V. The measured input voltage using a voltmeter should measure within several tenths of a volt to what it is connected to and the Digital IO Screen should change appropriately.
to test the inputs (JP4 IO16-25, pins 5-7, 10-16) on my KFLOP, using pin 3 from same, to supply 3.3V via a 1KOhm resistor, to each IO pin, one at a time. I used pin 8 or 9 for my multimeter's ground.
The KFLOP was rebooted, no C code was launched, and all IO were verified as a set to Input (unchecked boxes under Output) in the Digital I/O | KFLOP dialog box, prior to beginning the test. Unfortunately, the voltage on each pin did not read +3.3V, rather each read close to zero (0.38V), and the State box remained unchecked.
Once the 3.3V was disconnected, I checked each IO's Output box, and measured the voltage present at each, in both states (high and low). That seemed to work as expected;
- When State was unchecked, all were essentially zero (~5mV),
- When checked, IO16-23 were 3.0V, and IO24&25 were 3.3V.
Did I perform the test correctly? If so, are my results normal?
I presume that the voltage drop across my 1KOhm resistor (in series with the built-in 150 Ohm) resulted in the ~0.4V at the pin, but I hesitate to connect an IO pin directly to pin 3, due to the expected 22 mA (>16 mA limit I've read about).
I used your advice above;
To test the inputs connect them through something like a 1K ohm resistor to either GND or +3.3V. The measured input voltage using a voltmeter should measure within several tenths of a volt to what it is connected to and the Digital IO Screen should change appropriately.
to test the inputs (JP4 IO16-25, pins 5-7, 10-16) on my KFLOP, using pin 3 from same, to supply 3.3V via a 1KOhm resistor, to each IO pin, one at a time. I used pin 8 or 9 for my multimeter's ground.
The KFLOP was rebooted, no C code was launched, and all IO were verified as a set to Input (unchecked boxes under Output) in the Digital I/O | KFLOP dialog box, prior to beginning the test. Unfortunately, the voltage on each pin did not read +3.3V, rather each read close to zero (0.38V), and the State box remained unchecked.
Once the 3.3V was disconnected, I checked each IO's Output box, and measured the voltage present at each, in both states (high and low). That seemed to work as expected;
- When State was unchecked, all were essentially zero (~5mV),
- When checked, IO16-23 were 3.0V, and IO24&25 were 3.3V.
Did I perform the test correctly? If so, are my results normal?
I presume that the voltage drop across my 1KOhm resistor (in series with the built-in 150 Ohm) resulted in the ~0.4V at the pin, but I hesitate to connect an IO pin directly to pin 3, due to the expected 22 mA (>16 mA limit I've read about).
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Voltage on Input
Hi HowHardCanItBe,
Yes that all sounds correct. The 1K Ohm pull up should have worked on JP4 pins 15 and 16 which do not have 150 Ohm pull down resistors and not on the others that do have 150 Ohm pull downs.
You are also correct that shorting pins with pull down resistors directly to 3.3V does exceed the pull down resistor's power rating of 63mw.
Power = 3.3^2 / 150 = 73mw
This would probably only be a problem if all 8 inputs were shorted to 3.3V as they share a common resistor array rated for 500mw and also if the ambient temperature was high.
You might add a 47 Ohm series resistor for each input. That should reduce the current to:
3.3 / (150+47) = 16.7ma
Power dissipation would then be:
0.0167^2 x 150 = 42mw
Input Voltage should be:
3.3 x (150/(150+47)) = 2.5V
An alternate solution would be to add a single diode from from the 3.3V to create a supply voltage of ~ 3.3 - 0.6 = 2.7V. This could then be safely shorted to any or all the inputs. To drive 16 inputs the diode should be rated for 0.3A.
HTH
Yes that all sounds correct. The 1K Ohm pull up should have worked on JP4 pins 15 and 16 which do not have 150 Ohm pull down resistors and not on the others that do have 150 Ohm pull downs.
You are also correct that shorting pins with pull down resistors directly to 3.3V does exceed the pull down resistor's power rating of 63mw.
Power = 3.3^2 / 150 = 73mw
This would probably only be a problem if all 8 inputs were shorted to 3.3V as they share a common resistor array rated for 500mw and also if the ambient temperature was high.
You might add a 47 Ohm series resistor for each input. That should reduce the current to:
3.3 / (150+47) = 16.7ma
Power dissipation would then be:
0.0167^2 x 150 = 42mw
Input Voltage should be:
3.3 x (150/(150+47)) = 2.5V
An alternate solution would be to add a single diode from from the 3.3V to create a supply voltage of ~ 3.3 - 0.6 = 2.7V. This could then be safely shorted to any or all the inputs. To drive 16 inputs the diode should be rated for 0.3A.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.