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 

Newbie - problem with I2C connection?

 
Post new topic   Reply to topic    OpenServo.com Forum Index -> Hardware
View previous topic :: View next topic  
Author Message
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Thu Mar 11, 2010 5:48 am    Post subject: Newbie - problem with I2C connection? Reply with quote

I just hooked up my first ever OpenServo to I2C. It isn't working. Before I spend a lot of time chasing this down, I wonderif there is something obvious/dumb that I have overlooked?

I installed the OpenServo in a Hitec HS322HD. I'm using a USB-I2C bridge from Robot-Electronics (purchased from Trossen), using their generic I2C software. I've set the I2C address to 0x10. Their software reports no reply on the I2C. I can just about get my scope to see what is going on with the I2C - it sees the address being sent but no ack from the device.

The servo shows signs of life, in that it resists attempts to move it much harder when powered up than when powered down. So something is obviously alive.

I've checked the wiring and it is the same as in various pictures I have found.

Is there something obviously wrong here? In particular, is the default I2C address correct (0x10)? Do the OpenServos as shipped even have software on them (I thought they did, but maybe I'm wrong)?

Thanks...

John
Back to top
View user's profile Send private message
jharvey
co-admin


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

PostPosted: Thu Mar 11, 2010 8:33 am    Post subject: Reply with quote

How are you powering your servo? I see the USB-I2C device you noted can provide up to 70ma. If powered from that device, I suspect it's not going to cut it. You really need a solid supply or you'll brown out. I found a 9V battery worked for testing purposes, however 9V is a bit high, and 7.2V is preferred.

Oh also what version do you have, the OSV3, OSV2, other?
Back to top
View user's profile Send private message Visit poster's website
ginge
Site Admin


Joined: 14 Jan 2006
Posts: 1030
Location: Manchester, UK

PostPosted: Thu Mar 11, 2010 11:02 am    Post subject: Reply with quote

does the trossen device do the bit masking for you?

try at address 0x20
_________________
http://www.headfuzz.co.uk/
http://www.robotfuzz.co.uk/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Thu Mar 11, 2010 2:57 pm    Post subject: Reply with quote

I'm using a 3A bench power supply (set to 6V) to drive the power line, no problem there. The servo is consistently pulling about 35 mA.

I've tried addresses 0x10, 0x20 and 0x08 (and a bunch of others too). I can see the bits changing on the scope as I do this. But I never see anything except the address bits. It's the first time I've ever looked at I2C on a scope so I'm not 100% sure what I should be seeing. But for sure changing the address doesn't change what comes after it, i.e. the ACK bit. With the address set to 0x10, what I see on the scope (which is triggering on the rising edge of the first 1 in the address bit) looks like: 100001011111...

If I change the address to 0x08, this becomes 1000101111111.....

One thing which is curious is that there is always a zero at the end of the address. For example if I set the address to 7E, what I see is 111.1110.1.0. i.e. the 7E address, then a 0 bit, then a 1 bit (the read bit I guess). But like I said, I've never scoped an I2C signal before, so maybe this is normal.

I've verified that the clock and data are showing up inside the servo, i.e. they are making it through the connector.

The adapter seems actually to be made by a company called Devantech. I'd post a pointer to the spec but the forum won't let me.

I have just ordered the Openservo USB-I2C gizmo (OSIF) although I2C ought to be I2C and it shouldn't matter which adapter is used. But the software that comes with the Devantech one is pretty poor.

At this point one of the following must be true:

1. The Devantech adapter just plain doesn't work - gets the I2C protocol wrong. Doesn't seem very likely but possible I guess.

2. I have damaged my Openservo board while installing it - always possible of course. (I've ordered another one of those too).

3. There is something wrong in the Openservo setup.

All very frustrating...

John
Back to top
View user's profile Send private message
ginge
Site Admin


Joined: 14 Jan 2006
Posts: 1030
Location: Manchester, UK

PostPosted: Thu Mar 11, 2010 6:24 pm    Post subject: Reply with quote

HiiJohn,

The OpenServo regulator needs at least 1.2v above 5v to get a stable regulation. You could probably get away with 6v, but 7v+ should work better.

As for I2C, thanks for the order. It will be shipped immediately. You are correct that I2C is I2C. I have used a variety of host adapters to talk to the OpenServo, so it should work.

Best of luck!
_________________
http://www.headfuzz.co.uk/
http://www.robotfuzz.co.uk/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
jharvey
co-admin


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

PostPosted: Thu Mar 11, 2010 10:33 pm    Post subject: Reply with quote

Can you post your wave forms?
Back to top
View user's profile Send private message Visit poster's website
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Thu Mar 11, 2010 10:38 pm    Post subject: Reply with quote

I don't really see how, unfortunately. I suppose maybe I could make a time exposure of the scope. The problem is that the image is only there for ~100uS every 100mS.

However if you can put up with 0 means 0V, and 1 means a 1-2uS rising edge to 5V, lasting a further 4uS then falling quickly to 0V, then the binary numbers I gave before summarise it. If I set the address to 0x10, what I get (starting with the first rising edge of the data) is: 100001011111111111..
(i.e. a sustained HI level at the end). That's SDA. I can't convince my scope to show SDA and SCL at the same time, for some reason.

At this point, I'll try running it at a higher voltage tonight, and if that doesn't change anything, I'll way for my OSIF to show up and try it with that.

John
Back to top
View user's profile Send private message
jharvey
co-admin


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

PostPosted: Fri Mar 12, 2010 1:30 am    Post subject: Reply with quote

I'm not an I2C expert, but not being able to see both is a bit of a diag problem. The start and stop conditions hold SDA and SCL lines in specific states to do some hand shaking, this hand shaking can cause bits to get stretched and not fall on exact time increments.

http://en.wikipedia.org/wiki/I2C

Assuming it's running at 400khz, you would expect each bit to be about 2.5uS, that's 1/400khz. So it sounds like you are running at 400khz. However, if either device needs to slow the bus down, they can hold SCL to give more time to process a command. Or something like that.

I suspect the OSIF will get you into a more common platform, but also like ginge noted, it should work with any I2C device.
Back to top
View user's profile Send private message Visit poster's website
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Fri Mar 12, 2010 2:45 am    Post subject: Reply with quote

This stupid forum software won't let me post an image although I now have one. Grrr.

Changing the supply voltage to 7.2V made no difference.

John
Back to top
View user's profile Send private message
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Fri Mar 12, 2010 4:09 am    Post subject: Reply with quote

Well, I'm beginning to think the problem is the Devantech device. Now that I've persuaded my scope to show me what's going on, it looks as though it never, ever sets the low order address bit, no matter what you tell it! How it works with other devices, I have no idea.

Hopefully things will look up when I get my OSIF.

John
Back to top
View user's profile Send private message
jharvey
co-admin


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

PostPosted: Fri Mar 12, 2010 8:57 am    Post subject: Reply with quote

I post pictures by putting them on photobucket, then linking to them from here.
Back to top
View user's profile Send private message Visit poster's website
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Fri Mar 12, 2010 3:24 pm    Post subject: Reply with quote

Quite. It won't let me post a link. The picture is on Flickr but I can't link to it.
Back to top
View user's profile Send private message
ginge
Site Admin


Joined: 14 Jan 2006
Posts: 1030
Location: Manchester, UK

PostPosted: Fri Mar 12, 2010 6:17 pm    Post subject: Reply with quote

Post the link as raw text (not hyperlinked) and I will convert it to a real link for you
_________________
http://www.headfuzz.co.uk/
http://www.robotfuzz.co.uk/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Fri Mar 12, 2010 6:52 pm    Post subject: Reply with quote

It won't even let me post raw text that looks like a ur1. Even when I convert the punctuation to words it STILL seems to detect it and won't let me post it. (And I couldn't even post an example of what I meant. I suspect that anything with the word d@t in it gets caught. What a pain).

Anyway at this point either (a) the Devantech thing is terminally broken or (b) the OpenServo is broken. Either way the next step is to wait for the OSIF to show up. If that fixes it, great. If not, well maybe PWM isn't that bad after all.
Back to top
View user's profile Send private message
john493



Joined: 11 Mar 2010
Posts: 10
Location: California, USA

PostPosted: Mon Apr 05, 2010 4:10 am    Post subject: Reply with quote

Well, the good news (for me anyway) is that with the new OSIF module and the new OpenServo, everything seems to work, after the usual kinds of teething troubles.

The first OpenServo seems to be dead, or at least seriously unwell. It responds at address 0x7f (including after I removed it from the servo and replaced it with #2) and the OSIF s/w does not see it as a Servo. I tried to reflash it and OSIF says "no adapters or devices!".

A few questions...

1. Is there something else I can try to reflash servo #1?

2. Is there a guide anywhere to good PID values? Experimentally I found some values that seem to work, but some guidance would be welcome. (Specific guidance for Openservo I mean, I'm familiar with PID in general).

3. The indicated current (or power) output seems low. In my highly sophisticated test rig (power drill hanging from servo horn on a piece of wire) I was making about 3 kg-cm of torque (on a HS645MG rated at 7.7) and pulling about 0.2A, yet the current output is only 60. Is this what I should expect? One of my main interests in Openservo is to use it for "proprioception" to get feedback from my hexapod's legs, and I'd hoped for finer granularity than this would imply.

Thanks in advance...

John
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenServo.com Forum Index -> Hardware All times are GMT
Page 1 of 1

 
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