dorna-robotics / dorna

Dorna Robotics API
https://www.dorna.ai
MIT License
39 stars 25 forks source link

Issues with IO pins #5

Open mfogelson opened 5 years ago

mfogelson commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

mfogelson commented 5 years ago

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:

mfogelson commented 5 years ago

SERIOUS ISSUE:

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

smhty commented 5 years ago

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

Best, Hossein

mfogelson commented 5 years ago

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.

mfogelson commented 5 years ago

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 commented 5 years ago

@mfogelson

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

mfogelson commented 5 years ago

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 commented 5 years ago

@mfogelson

  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.