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 instability

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



Joined: 22 Sep 2009
Posts: 7

PostPosted: Tue Sep 22, 2009 5:34 am    Post subject: Openservo instability Reply with quote

Recently I got two sparkfun openservo boards, I hooked it up to a pot and a 6v motor (with caps) and controlled it by I2C, and not saving settings to EEPROM.
But I'm getting the following weird symptoms which seem rather odd:

* openservo restarting itself
* openservo locking up (output pwm is still active, but the controller is unresponsive). when it locks up, powering the openservo off and on does not stop it from moving the motor (and destroying itself).

I have added additional 10uF capacitor on 5V rail and 330uF capacitor on 7.5v input rail, and also 0.1uF and 1uF caps on the motor but that didn't help

Hope someone experienced can point me in the right direction.
Back to top
View user's profile Send private message
jharvey
co-admin


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

PostPosted: Tue Sep 22, 2009 10:12 am    Post subject: Reply with quote

I'm assuming you're using the OSIF for your I2C interface. Is that correct? If so are you using the Linux or windows version of the software? 6V is really close to the min voltage. A soggy supply can cause a lot of issues, like a brown out reset. Can you bump that up to say 7V? I've had good luck with a 9V battery, it may shorten the life of the motor, but in my case, I'm not all that concerned. I believe the PWM prevents the 9V from making it to the motor any how, so I'm likely not harming the motor, but I haven't checked that yet. Also where did you install the cap? I recommend doing it on the board. I had one on the motor, and through vibration it shorted, causing similar problems to what you noted. I haven't had any problems with the onese I installed on the board.

[edit] looks like you are running a 7.5V rail. Is that correct?
Back to top
View user's profile Send private message Visit poster's website
kbb



Joined: 01 Jun 2007
Posts: 180

PostPosted: Tue Sep 22, 2009 10:39 pm    Post subject: Re: Openservo instability Reply with quote

yongkimleng wrote:
I hooked it up to a pot and a 6v motor

A lot depends on your motor, have you got any details on it? What was the donor servo, or is it a DIY servo?

yongkimleng wrote:

* openservo restarting itself

i) As Jared suggests, your power supply may be insufficient. For testing purposes (including test loads) I use a 7.5V 5A switched mode PSU. If I want many servos running at the same time under load I use a freshly charged 7.2V “racepak”.

ii) I suspect the OpenServo boards will probably start to drop out starting around 6.2V.

iii) There was a firmware update that might be needed for lower impedance motors, I am not sure how much the sparkfun boards, being V2, would benefit from the change or what firmware version (if any) they may be shipping them with.

yongkimleng wrote:

* openservo locking up (output pwm is still active, but the controller is unresponsive). when it locks up, powering the openservo off and on does not stop it from moving the motor (and destroying itself).

As well as the shorts Jared mentioned, check that there isn't a problem with the connections for the pot, including dry joints. It is also possible they are the wrong way around - which tends not to cause a problem until you set a seek position or the servo is physically moved out of the deadband on whatever seek position it is holding.

To be on the safe side, you could disconnect the motor, power up and chat to the controller over I2C and see what the PID parameters are. If they are non-zero (write them down), set them to zero and save. You could manually move the servo and check that the pot measurements look reasonable and change in an appropriate way whilst the motor is not connected.

Remove the power and reconnect the motor, and then power it back up. If the motor still moves on power up, there is probably a short or some other problem. If it doesn't write a small value to the P parameter (for example: 50) and turn on PWM. If the motor moves in the wrong direction, the pot connection is wrong or reversed. Poor PID values can sometimes cause wacky behaviour. Be ready to switch the power off if there is unexpected behaviour.

Kevin.
Back to top
View user's profile Send private message
yongkimleng



Joined: 22 Sep 2009
Posts: 7

PostPosted: Mon Sep 28, 2009 6:12 pm    Post subject: Reply with quote

Hi,

Thanks everyone for your replies!

@jharvey:

1. Yes I was running it with a 7.5V 18A capable supply, but the motor is only rated to stall at 850mA @ 6v. I just changed to a 9V 2A supply, but no difference. I have limited the PWM in software so that the pwm output never rises past 6Vrms

2. Hmm installing one on the board? I currently have a 1uF on the motor but I'll try that recommendation! I have confirmed that the one on the motor does not short due to vibration as it is mounted very securely and output is only 3rpm, so.. not much vibration there.

3. I'm using a PCEngines Alix board which wires to the openservo. Disabled the ATmega168's internal pullups on SDA SCL but had my own external pullups for 3.3v signalling. I have confirmed it was not a signalling problem as I ran I2C read/write commands continually over 24h without fail, narrowing the problem down to the situation where it happens only when the motor moves.

@kbb:

I'm actually using an accelerometer instead of a pot, feeding the openservo analog output of the accelerometer, an MMA7260Q (I've a linear 3.3v reg to power the accelerometer. Of course, output voltage does not swing 0 to 5v but its okay).
The motor is a geared slow 3rpm, 6v motor. No specs, just got it from my local hardware shop. Very silent and strong but tends to bend my external mounts out of shape when the openservo locks up Laughing

1. As above, the power supply seems adequate enough...
2. Yup, they drop at about 6.2v, but the mega168 seems to operate even down to 3.3v or lower...
3. What kind of firmware updates? I'm using the latest -dev branch, double checked with the original stable openservo but symptoms were similar.
4. Not using a pot, but verified that input signals are correct
5. Done I2C reliability checks, narrowed down problem to occur only when motor makes movements.

Since my last post I have made some developments on the problem:
1. The motor moving on powerup was due to a line in the -dev code branch which sets enable pwm by default. I had commented this out.
2. Powering off and on the board did NOT reset the openservo! Apparently the openservo is still detectable over i2c for a short period of time (few minutes), guess there was residual power in my caps (330uF on the 9v input line, 10uF after the regulator)... even if the voltage drops to 1.8v. (either the mega168 running on 1.8v, or on the residual power leaking over the i2c lines).
The resistor on the reset line doesn't seem to be doing its job.
3. To recover from 'hung' conditions on its own, I enabled the WDT.
4. Tried with 1k resistor across motor outputs, no difference
5. Tried with schottky diode in reverse across 5v rail on board in an attempt to snub spikes, no difference
6. Realised that the 10uF cap on the 5v rail on the board does improve reliability, but does not solve the problem completely.


My TODOs (in order of things to try):
- add 0.1uF caps across motor outputs on the board
- will set brownout on mega168 to make sure it does shut off after voltage drops past a certain level
- add 1nF caps across 5v rail on the board (noticed that there was no 1nF ceramic across the mega168, only two 0.1uF)
Back to top
View user's profile Send private message
jharvey
co-admin


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

PostPosted: Mon Sep 28, 2009 9:16 pm    Post subject: Reply with quote

The -dev branch has some known bugs. A couple weeks ago, an update was posted that solved some issues with the eeprom storage. There is also a known problem with the -dev PID. My experience with the stable branch is that it is stable. I might suggest using the normal branch. The only stability issues I've had with the stable branch have been related to power supply issues.
Back to top
View user's profile Send private message Visit poster's website
kbb



Joined: 01 Jun 2007
Posts: 180

PostPosted: Mon Sep 28, 2009 11:24 pm    Post subject: Reply with quote

yongkimleng wrote:

2. Yup, they drop at about 6.2v, but the mega168 seems to operate even down to 3.3v or lower...

True, the mega168 will operate at lower voltages. But the standard OpenServo board design has a 5V regulator, so things become unstable below about 6.2V (all of mine tend to be "gone" at around 6V).

yongkimleng wrote:

I'm actually using an accelerometer instead of a pot, feeding the openservo analog output of the accelerometer, an MMA7260Q...
4. Not using a pot, but verified that input signals are correct


Ah, this could be complicated! Can you elaborate on why you are using an accelerometer and how the motor affects it? It is hard to be specific without more details. I am wondering if you have the correct solution for your project.

Basic recap of a normal servo configuration: the output from the pot indicates the “position” of the servo, which is directly controlled by the motor via a gear chain. The servo electronics, in this case OpenServo, works to move the servo to a set position and maintain it by reading the analogue signal from the pot and then driving the motor to correct any errors in the pot measured position when compared to the set position. This works well because of the fixed relationship between what the motor does and position of the pot. For example: if the pot has been turned too far in one direction, relative to the set position, then the motor has to be reversed to correct it.

Your accelerometer setup would have to simulate similar behaviour as the pot on whichever of x, y and z you have connected to the OpenServo’s “pot port”. But, if the motor cannot always be driven in such a way that it will correct the output from the accelerometer in a suitable way, then things are not going to work at all or the system will be inherently unstable.

Of course you (probably) have the option of modifying the OpenServo software to work with what you are doing.
Back to top
View user's profile Send private message
yongkimleng



Joined: 22 Sep 2009
Posts: 7

PostPosted: Tue Sep 29, 2009 5:52 am    Post subject: Reply with quote

I'm using the accelerometer to give openservo the current 'tilt' angle with respect to gravity.

What bugs were found with -dev ? Fortunately I was not using EEPROM storage (yet) but I'll check out the recent changes soon. All settings are loaded at run-time by my host processor (except the address, which is preset by default)

I just put a 0.1uF cap on the board across the motor output pads, its much more stable now but it still resets every minute or two (it currently makes 1 movement per second).

Will try adding 1nF cap across 5v rail (and maybe across the output pads too).

The current instability is not with the feedback system but with the mega168 resetting (or being 'hung') every now and then.
Back to top
View user's profile Send private message
jharvey
co-admin


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

PostPosted: Tue Sep 29, 2009 9:31 am    Post subject: Reply with quote

Latest -dev update that I know about was posted here.

http://www.openservo.com/Forums/viewtopic.php?t=952

It now sounds like your instabilities are due to the -dev branch. I believe the abrupt change issue is a brown out / reseting issue.

Also about the vibration, I didn't really mean actual shaking. My servo cases are plastic and when I torque on the motor some, I can see the case actually deform slightly. This bending of the case causes things to rub inside and short, if not protected well. This is why I put the cap on the board.
Back to top
View user's profile Send private message Visit poster's website
yongkimleng



Joined: 22 Sep 2009
Posts: 7

PostPosted: Tue Sep 29, 2009 10:49 am    Post subject: Reply with quote

@jharvey

Thanks for your reply, but I'm using the openservo v2 / v2-dev not the v3. Funny thing is that instability exists even in v2 (non-dev).

Too bad I don't have an oscilloscope.

EDIT: Amazing, I increased the PWM divider from 16 (default) to 32... and it seems to be much more stable now. There wasn't any self-reset during the last 15 minutes. Will let it continue running its motion test until tomorrow.
Back to top
View user's profile Send private message
yongkimleng



Joined: 22 Sep 2009
Posts: 7

PostPosted: Tue Sep 29, 2009 8:20 pm    Post subject: Reply with quote

I can't believe it.. it has never been stable until now... been running test sequence without restarting / hanging!
Back to top
View user's profile Send private message
yongkimleng



Joined: 22 Sep 2009
Posts: 7

PostPosted: Thu Oct 01, 2009 10:06 am    Post subject: Reply with quote

This is weird, replicating the circuit setup on a second set of motor + openservo gave me instability problems again.
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