OpenServo.com Forum Index OpenServo.com
Discussion of the OpenServo project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenServo Application Write Fails for a big position change
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OpenServo.com Forum Index -> Software
View previous topic :: View next topic  
Author Message
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Mon Jun 21, 2010 6:46 am    Post subject: OpenServo Application Write Fails for a big position change Reply with quote

Hey all.

I have been working for the past couple of days trying to calibrate some TowerPro MG995 and MG 996 Motors for use in a robotic arm. While testing one of the motors using the OSIF and the OpenServo Test Application, I am able to set the P+D (I am assuming I is obsolete based on previous forums read), but then when I command it to go to a position that is far from its current one, the write fails. However, if I change the position by less than 100, the write succeeds and the motor shifts slightly. This behavior is new, as last week, I was able to set large position changes.

In addition, when I try to "Save Register", it says that the save register wrote ok, but then when I disconnect the motor, plug it in again and run a "Scan Bus", it pulls up previous P+D values that I thought I had over written.

Any help would be much appreciated!

- Will
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jharvey
co-admin


Joined: 15 Mar 2009
Posts: 350
Location: Maine USA

PostPosted: Mon Jun 21, 2010 9:37 am    Post subject: Reply with quote

What are you using for a power supply? My first thought is that the supply is going soggy.
Back to top
View user's profile Send private message Visit poster's website
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Mon Jun 21, 2010 9:42 am    Post subject: Reply with quote

Yes, I thought that too but I'm pretty sure it's working fine. It's a relatively new bench supply that I keep at 7.2ish volts.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jharvey
co-admin


Joined: 15 Mar 2009
Posts: 350
Location: Maine USA

PostPosted: Mon Jun 21, 2010 9:45 am    Post subject: Reply with quote

And your wire connections? A .1 ohm connection can cause havoc. How did you feel your crimps were when you crimped it? Sounds like this connector also worked with other OSV3's, so that would point a finger less at the connector.

Last edited by jharvey on Mon Jun 21, 2010 10:03 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Mon Jun 21, 2010 9:51 am    Post subject: Reply with quote

Unfortunately for our diagnosis, I remember doing a pretty good job with the crimping. And the connections all look pretty clean now... Confused
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jharvey
co-admin


Joined: 15 Mar 2009
Posts: 350
Location: Maine USA

PostPosted: Mon Jun 21, 2010 10:00 am    Post subject: Reply with quote

Now that I know who you are, I'm a bit puzzled. They where programmed with 200 if I recall correctly. Are these still using the OE firmware? When you say far, do you mean less than one rotation away, or do you mean 3 turns away?

I'm heading out the door shortly to head out for work. I'll disappear for several hours when that happens.
Back to top
View user's profile Send private message Visit poster's website
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Mon Jun 21, 2010 10:06 am    Post subject: Reply with quote

Less than one rotation, and apart from the one where the firmware upgrade apparently went sour, I have not upgraded the firmware for fear of harming the others. So the one in question here has the firmware, that you put on it (JL Products?, Maine).

Yes, I have been unable to rotate it once around. It shifts in from anywhere from roughly 10-80 degrees. I have tried just about every position too.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jharvey
co-admin


Joined: 15 Mar 2009
Posts: 350
Location: Maine USA

PostPosted: Mon Jun 21, 2010 10:19 am    Post subject: Reply with quote

Yup, I'm the fellow that did these up for you folks. The J in JL is for Jared the L is for Laura, my wife.

I guess an early on question should include, have you gotten any of them to work as expected out of the box? Are you using the Perl scripts I sent along, or the GUI?

I'm now not questioning the connections, power supply and such as much. When the power supply is in question, the biggest risk is that ceramic cap on soldered across the motor drive fets. It's fairly rugged, but if you push on it when putting the board back into the case it can short out. So be careful there, and press the other end.

I can't use the GUI in my case, so I only tested them with the Perl scripts. I'm not sure if the GUI is using the same registers or not, I believe it does not have the new registers that were needed for OE, so I don't think the GUI can fully work. I believe it should be able to set/read the PID (PD) values and such, but it might not be good for that, I'm not exactly sure.
Back to top
View user's profile Send private message Visit poster's website
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Mon Jun 21, 2010 10:42 am    Post subject: Reply with quote

Ok, That would make a lot of sense. I was given a box of them and was told to basically get them to work, calibrate them and ultimately prep them for substitution into our in house robotic arm.

Yes, I have looked at the scripts, but they didn't notice the motors right away so without much information about the devices, I just downloaded the OpenServo application and began playing with that. I was able to set the P/D values with the application, but around the same time that the position setting troubles began, I started having problems with saving the P/D values. The application would let me set them, and the motors would realize them, but I would then shut the system down and turn it back on and it would revert back to older P/D values that should have been overwritten. I will now put more effort into the Python (You said perl but I think you meant python) scripts.

The errors I get now are such:
Code:


Traceback (most recent call last):
  File "C:\Documents and Settings\Administrador\Escritorio\Software\os-python\osbl-test.py", line 36, in <module>
    slave = int(sys.argv[1], 0x10)
IndexError: list index out of range



I get that error for all the scripts I try to run. Obviously while the file path and name change, the last 2 lines stay the same. I am more of a C++/Java programmer and I am not that familiar with Python but I will try and look into the error.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Mon Jun 21, 2010 12:19 pm    Post subject: Reply with quote

And no, I have not gotten any of them to work fully yet. They all will not rotate around fully, but some of them do respond to larger differences in position than 100. It would make sense that they have different registers because the generic comm section does not work as well.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jharvey
co-admin


Joined: 15 Mar 2009
Posts: 350
Location: Maine USA

PostPosted: Mon Jun 21, 2010 7:17 pm    Post subject: Reply with quote

Looks like a posix enviroment issue. I don't think it properly resolved sys.argv. Or perhaps you didn't call the script like this.

os-move.py 10

The sys.argv will be 10 in the script. Do you have lsusb installed?
Back to top
View user's profile Send private message Visit poster's website
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Tue Jun 22, 2010 8:24 am    Post subject: Reply with quote

Yes, I tried it that way and oddly it didn't work. I'm pretty sure I have all the necessary libraries installed and I have tried them on both linux and windows, and the compiler errors are similar. I have a feeling its something with my drivers and how the python calls to a usbport, but I can't quite put my finger on it.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Tue Jun 22, 2010 9:36 am    Post subject: Reply with quote

All of the errors point back to the osif.py file. It seems that it will either recognize just the adapter, but no motors or it won't recognize either.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jharvey
co-admin


Joined: 15 Mar 2009
Posts: 350
Location: Maine USA

PostPosted: Tue Jun 22, 2010 9:43 am    Post subject: Reply with quote

What do you get with ./os-scan.py?
Back to top
View user's profile Send private message Visit poster's website
wpotter



Joined: 18 Jun 2010
Posts: 50
Location: Valencia, Spain

PostPosted: Tue Jun 22, 2010 9:58 am    Post subject: Reply with quote

The same thing, the device or resource is busy.

Code:

usb.USBError: could not claim interface 0: Device or resource busy


So it recognizes that the OSIF is plugged in, it just won't read/write to it.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    OpenServo.com Forum Index -> Software All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group