dorna
dorna copied to clipboard
Issues with IO pins
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?
@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.
@mfogelson Can you test other input ports? and see if you get similar result or not?
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)
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
@mfogelson Well, there are few questions so I try to answer them one by one:
-
In general, applying any voltage higher than 3.3V to ardunio, even for a short period of time, can cause problemand burnt the device. So, I am suspect that something is wrong with the arduino. One option is to try a brand new arduino and see if you get similar result or not. Here is a link I found on ebay: https://www.ebay.com/itm/DUE-R3-Development-Board-SAM3X8E-32bit-ARM-Microcontroller-USB-Cable-for-Arduino/122009926802?hash=item1c685bbc92:g:4osAAOSw~B1aN-94:sc:USPSFirstClass!91786!US!-1:rk:1:pf:0
-
The error you get calling the robot.position("joints") method is not related to arduino. It is actually on the python side (running on your computer). I think this error is related to the issue #4 . If you change the method (the way you did it there) that can cause problem, and the function returns [null, null, null, null, null]. So, I suggest to bring the _xyz_to_joint method to its original form and see if you still get the error or not. Please let me know if theses suggestions are working for you or not.
Best, Hossein
-
The 3.3V output was not working ever, but I will try and get a new to test this.
-
You are correct there was something in my changes to api.py that caused the robot.position() function to fail. THANK YOU
-
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?
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.
@mfogelson
Thanks for the scheme. Let me do few testing about this issue, I will get back on this as soon as possible.
I should note a few things about it.
- The 5V input is from an external power supply and not USB so I should have sufficient current
- The D11 pin on the Arduino Uno is set to OUTPUT and goes from 0-5V, which is why I have the voltage divider
- The input to the Due was arbitrary since I dont know the pins associated with P1-4 on Dorna
- The GNDs are all common
- The N-Channel mosfet I am using is 2N3904
@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:
- 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.
- The Laser +- are connected to Mosfet switch. Pin - of laser is grounded when laser is on. Otherwise it's disconnected.