| View previous topic :: View next topic |
| Author |
Message |
mikewardlow
Joined: 16 Mar 2006 Posts: 42
|
Posted: Mon Apr 03, 2006 7:41 pm Post subject: |
|
|
Why the worry about the resonator drift ,,, and not about the battery
voltage [other than check at startup] ......I would think that battery
voltage/current supply would affect how the servo reacts also... |
|
| Back to top |
|
 |
SOI Sentinel
Joined: 30 Mar 2006 Posts: 44
|
Posted: Mon Apr 03, 2006 8:10 pm Post subject: |
|
|
Somewhat true. Crystals are at worst 100 ppm (0.01%), resonators 0.5% normally, internal RC can be about 1%. I don't see much problem with 400KHz I2C communications, and being off 1% on timing for a servo loop isn't bad at all.
I'm not certain about Atmel hardware, but I know that some processors can use a secondary watch crystal to tune their primary RC oscillator. You usually have to sacrifice a timer, though. Might be a cheaper or smaller area option. |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Mon Apr 03, 2006 8:12 pm Post subject: |
|
|
After reviewing prices of the 20MHZ crystals available to me, I have decided that the drift is more than acceptable. A crystal oscillator costs about ?4 in the UK, the ceramic resonator is ?0.62.
Barry |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Mon Apr 03, 2006 8:20 pm Post subject: |
|
|
Mike is correct about the battery impacting servo performance much more than than oscillator drift. An advanced design will probably need to periodically check battery voltage and adjust motion related constants. It seems this is how the AI-701 servos work.
-Mike |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Fri Apr 07, 2006 8:58 am Post subject: |
|
|
A quick update since it's been a bit slow in the forums. Thursday I received my new manufactured PCBs and the parts from DigiKey. I assembed the top portion of two new OpenServos and I'll work on the bottom half either on Friday or Saturday.
Assembly with the new design was a little less difficult than the previous design, but the pieces are really so small that putting them together is never going to be easy. I was wondering if there is enough room on the PCB to switch to 805 SMT packages rather than 603 SMT packages for the capacitors and resistors. This would make things a little easier. Also, the resonator is pretty tough to solder because it's contacts are mostly on the bottom. I think I got it on right, but I haven't yet tested it.
I'll post a follow up when I have a fully working servo. I can't wait to try out the new MOSFETs. I'm assembling a cheap Futaba S3003 and I'll also put a board in a HiTec HS-475HB.
-Mike |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Sun Apr 09, 2006 3:58 am Post subject: |
|
|
Damn, after fulling assembling two new OpenServo 2.1 PCBs I discovered a flaw in the my PCB layout. I accidently switched to traces controlling the N MOSFETs to the P MOSFETs on the PCB. Of course, this resulted in shorting the MOSFETs and probably some other damage. I'll see if I can temporarily cut some traces and add some jumpers, but it looks a little bleak for this PCB.
Oh well, back to the drawing board. I'll post an update in a few days.
-Mike |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Sun Apr 09, 2006 8:10 am Post subject: |
|
|
I really screwed up the PCB design. It took cutting six traces and adding six jumpers to get a functional board. I've already got a new and hopefully correct PCB redesigned that I'll send out the be made once I get the issues below resolved.
I've started to test things out and the servo is really behaiving strangely for me. It will hold it's initial position for a while, but then will start going a bit crazy randomly seeking to new positions until it hits a physical limit. I can initiate the behavior by just moving the servo horn as well.
My first guess is that the new MOSFETs I'm using are injecting a LOT of noise into the MCU or the TWI interface causing the weird seeking I'm seeing. The jumpers I added to fix the circuitry problems are really hokey as well and could perhaps be a source of the problem. During one of the bad seeking episodes I was able to get a dump of the registers over the TWI interface and the data looked really messed up. This would indicate SRAM was somehow corrupted -- don't know if it's a symptom or a cause.
Clearly I've got at least a few days of debugging to get to the bottom of this. I'll post updates to the forum as I make progress on this.
-Mike |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Sun Apr 09, 2006 4:39 pm Post subject: |
|
|
Interesting...
I had similar problems to this initially.
Although I am not using the board you designed , I noticed there were some problems. I havn't tracked down the exact source yet, but changing the cap sorted that out for me.
Sounds like something related to the Aref side though.
You could try putting a larger electrolytic cap inplace of the smaller SMT one to see if the problem goes away, it did for me.
Barry |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Sun Apr 09, 2006 6:52 pm Post subject: |
|
|
Thanks Barry, I'll give the another cap a try. I assuming you are talking about 33uF capacitor.
Another thing I may suspect is my power source -- basically a 7 volt wall wart without a lot of current capacity. These new FETs may be drawing more current than the power supply can provide and there may be issues with that. I believe Andy ran into a similar problem in the past. I'll switch to a 7.2V nicad set that should deliver whatever the 3 amp FETs ask for.
This may be a slow process for me because I don't have a lot of time this week to debug the circuit. It drives me nuts when I have problems like this and I can't devote the time needed to properly fix them .
-Mike |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Sun Apr 09, 2006 7:35 pm Post subject: |
|
|
Yes, it's the 33uF i'm talking about. My scope showed the current spikes were saturating the voltage source, like the problem Andy had. If the motor is drawing enough current to saturate the PSU, there may be a solder bridge in the output phase. I had two resistors shorting, this caused my hours of problems until I found it.
Just out of curiousity... why did you have to cut traces on the design? Was the layout wrong?
Barry |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Sun Apr 09, 2006 9:50 pm Post subject: |
|
|
Regarding the PCB layout, I basically inverted the N and P channels. I guess I messed this up by not paying attention to the fact that pins are reversed when placed on the underside of the PCB. A big screw-up on my part that a little more diligence and checking could have saved me a big headache.
Regarding my current problems, I haven't yet changed things yet as I'm trying to use a scope and test code to understand the nature of the issue I'm facing. What I see right now is that the MCU functions properly as long as I'm not feeding too much power to the MOSFETs in terms of the PWM pulse width. Over a certain threshold and the MCU really starts acting in a bizarre manner and will eventualy reset itself. I even corrupted EEPROM on the MCU at one point. I assuming the MCU just starts executing random code on the Flash.
The strange things is I'm not seeing bad glitches and such on the scope. However, it is really hard to get at some of the pins and I'll need to do a bit more poking around.
Do you have any suggestions on where on the circuit I should be looking with the scope for indications of current spikes? Also, I'm assuming you were working with the IRF7309 MOSFETs when you noticed these problems.
-Mike |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Sun Apr 09, 2006 10:42 pm Post subject: |
|
|
Yes, I am using the IRF7309, although I am changing this to a cheaper component soon.
To read the current form the FETS I used a current shunt probe and read the draw of each Source gate.
one thing I havn't done is to check the EMF spikes from the motor. The diode in the FETS may be insufficient for protecting the component, although this is the least likely cause.
If it turns out these FETS have current spiking problems, a snubber circuit may be needed onboard to deal with this problem.
The only other thing that comes to mind is that the RdsOn for the Gate for the FET has a higher capacitance. This would mean that the current to drive them from the AVR is insufficient. I seem to remember some input from Andy on that, and also there was the example circuit posted elsewhere that would disprove this theory.
When you have fixed any board layout issues you have, I will build one and give you some feedback if the problem persists.
Barry |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Sun Apr 09, 2006 10:48 pm Post subject: |
|
|
| Also try checking the noise on the pre and post regulator phases. Check voltage and current levels being drawn from your PSU |
|
| Back to top |
|
 |
andylippitt Site Admin
Joined: 02 Jan 2006 Posts: 155 Location: Denver, CO
|
Posted: Mon Apr 10, 2006 1:11 am Post subject: |
|
|
The problems I had were related to supply power. I was only supplying 5V and the regulator chewed up most of that. The results were dissimilar from your described behavior. The chip would reset, it would start the bootloader then come back to life. The bootloader timeout was unmistakable.
The only other trouble I had that does sound slightly like this was that I had done something extremely dumb. Due to some unrelated issue I was trying to debug, I had put a resistor/LED combo on one of the I2C lines (I don't recall which). This left the line floating around 2.5V and REALLY bizarre things happened to the servo. Some not unlike what you're describing.
If you haven't yet done it, set those unused pins to outputs. I know that unused pins left floating on a PIC can create this sort of havoc. |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Mon Apr 10, 2006 3:42 am Post subject: |
|
|
Andy, thanks for the reminder regarding the unused pins. I'll take care of that and see if it makes a difference.
When using a scope I can see voltage drops in sync with the PWM signals on the H-Bridge voltage, but nothing very spectacular. The 5 volts on the regulated side looks almost rock steady. I'm using one of the Futaba S3003 motors right now which isn't very powerful.
I'm coming to the conclusing that there is something about these FETs that is giving me grief, but I just don't know what it is yet. I too thought about the AVR being insufficient to drive the gates. I hope that isn't the case as it would call for a redesign.
I'll keep poking and start to replace some of the caps as suggested before.
Mike |
|
| Back to top |
|
 |
|