Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with IO pins #5

Open
mfogelson opened this issue Jan 18, 2019 · 10 comments
Open

Issues with IO pins #5

mfogelson opened this issue Jan 18, 2019 · 10 comments

Comments

@mfogelson
Copy link

I have an Arduino uno with a force sensor that when triggered turns a digital output pin on my board low. Since Arduino uno goes from 5V output I put the output through a voltage divider to match the 3.3V digital input pin on the control box. The gnd from the control box and my Arduino are connected so that there is a common gnd that can be referenced.

When the digital output pin from my Arduino goes low the voltage difference between gnd and input goes to 1.4V. My thoughts is that this is due to the pull resistor set on the input pins, but not 100% sure about this.

Any thoughts?

@smhty
Copy link
Collaborator

smhty commented Jan 19, 2019

@mfogelson
We just saw a similar question on the forum. For some reason I am not getting notification when people asking question on the forum. Sorry, for the delay.

I assume that the question here and the one on the forum are related.
My partner left an answer there for you. Here is his response:
https://www.dorna.ai/forum/setting-up-dorna/3-3v-output-not-working

It might be the front connector issue. The 3.3 V is coming directly from Arduino 3.3 output. As long as the sensors and motors are working, the Arduino is producing about 3.3 V. You might want to unplug the connector and measure the voltage again.

Let us know if this solves the issue, or you still have problem.

@smhty
Copy link
Collaborator

smhty commented Jan 19, 2019

@mfogelson
Can you test other input ports? and see if you get similar result or not?

@mfogelson
Copy link
Author

So I am getting something very strange happening.

Situation 1: No usb connected to Dorna only powering through wall outlet
Result: No voltage differential from gnd to any of the pins including 3.3V output, GND pin on main to Laser + ~12V output, GND pin on main to servo + pin ~6V output

Situation 2: Only usb connected and no power through wall outlet
Result: Pins 1-4 have ~3.3V (min 3.24, max 3.6) output, Pins 5-8 ~0V (24mV), 3.3V output pin ~0 (+- 5mV), GND pin on main to Laser + ~0V output, GND pin on main to servo + pin ~0V output

Situation 3: usb connected and power from wall outlet
Result: Pins 1-4 have ~3.3V but value dropped slightly (min 2.76, max 3.25), Pins 5-8 ~0V same as before, 3.3V output pin ~0 (-24mV).

Connectivity test:
GND pin on main and - on servo = connected
GND pin on main and - on laser = disconnected
GND pin on main and 3.3V output = disconnected (which was to be expected or everything wouldn't work)

Notes:
Tested with connector on and off and got the same results

Thoughts:

  • The wall outlet power is distributed only to motors, servo and laser
  • USB only powers the arduino
  • The GNDs to the wall and Arduino are not shorted together? Causing reference voltage issues when I use the IO pins
  • There is some other vin source that is causing interference
  • The 3.3V pin is not connected to the actual 3.3V output (I opened the box and see that there is an custom board going from the due and maybe one of the traces isn't working right...not sure about this without taking off that board which I was afraid to do)

@mfogelson
Copy link
Author

SERIOUS ISSUE:

  • After doing all of this testing the robot does not seem to be working properly anymore.
    -- I am able to connect fine through robot.connect()
    -- But I am now unable to read robot.position("joints") returns '[null, null, null, null, null]' and robot.position("xyz") returns '[0, 0, 0, 0, 0]'
    -- When I attempt robot.home("j0") the joints do not move and the program hangs.

I have tried restarting and power cycling many times and re-uploaded the firmware, but am receiving the same issues

@smhty
Copy link
Collaborator

smhty commented Jan 22, 2019

@mfogelson
Well, there are few questions so I try to answer them one by one:

Best,
Hossein

@mfogelson
Copy link
Author

  1. The 3.3V output was not working ever, but I will try and get a new to test this.

  2. You are correct there was something in my changes to api.py that caused the robot.position() function to fail. THANK YOU

  3. I am still confused about the IO pins and hope you can clarify some questions.

  • The Input pins are P1-P4 and are pulled high by an internal pull up resistor to 3.3V?

  • Can we change this so that the input pins are pulled low by the internal pull down?

  • The message of robot.io() for "inN" is not based on if they are HIGH or LOW, but if the logic of diNmo is being met?

  • The output pins are P5-P8 and can also be used as inputs using the doNmo?

  • Why is the default that the output is set to on and the doNmo is set to active high thus making P5-P8 Low? This was confusing for me what takes priority and what the point of doNmo is?

  • Also the set_io() function changes the config so that when you turn on the robot again it will remain the same?

  • Have you done an example with the IO pins to trigger the arm to pause or halt that you could show me?

@mfogelson
Copy link
Author

mfogelson commented Jan 26, 2019

circuit_schem.pdf

Here is the schematic that I think should work to trigger the input pins from an arduino uno, unfortunately it is still not working any thoughts. (Note: All GNDs are the same)

Even with the external power source to allow for more current I still cannot pull the input pins LOW, thus not being able to trigger them.

@smhty
Copy link
Collaborator

smhty commented Jan 27, 2019

@mfogelson

Thanks for the scheme.
Let me do few testing about this issue, I will get back on this as soon as possible.

@mfogelson
Copy link
Author

I should note a few things about it.

  1. The 5V input is from an external power supply and not USB so I should have sufficient current
  2. The D11 pin on the Arduino Uno is set to OUTPUT and goes from 0-5V, which is why I have the voltage divider
  3. The input to the Due was arbitrary since I dont know the pins associated with P1-4 on Dorna
  4. The GNDs are all common
  5. The N-Channel mosfet I am using is 2N3904

@sadeghtamu
Copy link

@mfogelson

  • All digital input pins on Arduino Due are pulled up by some internal resistors. For P1 and P2 we use additional R/C circuit to remove noise for noisy inputs. The way you can reverse the effect of the pullup resiststors is by changing the input mode (Active high or low).
  • P5-P8 can also be used as input if needed. Let me know and I can send the relevant commands for G2Core.
  • We have not any specific reason for choosing pins mode default other than G2Core defaults.
  • set_io() changes will not persist if you disconnect and connect back USB.
  • You can use the following code as an example. It will wait for in1 (P1) to go to GND for the move to start:
    {"command": "wait_for_input", "prm": {"in1": 0}} {"command": "move", "prm": {"path": "joint", "movement": 0, "speed": 5000.0, "j0": 50.0, "j1": 0.0, "j2": 0.0, "j3": 0.0, "j4": 0.0}}
  • Few more points:
  1. All I/O pins (P1-P8) are directly connected to I/O pins on Arduino and no external regulators is used for their 3.3V supply. So they will work as long as controller box is connected to the USB.
  2. The Laser +- are connected to Mosfet switch. Pin - of laser is grounded when laser is on. Otherwise it's disconnected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants