Shop OBEX P1 Docs P2 Docs Learn Events
RC Decay — Parallax Forums

RC Decay

Earl FosterEarl Foster Posts: 185
edited 2009-11-24 03:56 in Propeller 1
I have been troubleshooting an RC Decay problem I experiencing without success. I designed a servo controller board that will allow me to adjust 3 servos normal and active positions using a standard RC Decay circuit and code. It works perfect on my breadboard each and every time. However, on my PCB I get spikes and the servos shake constantly while trying to calibrate them so I don't know if they are positioned correctly. The servos work smoothly during operation so I have ruled out power supply issues.

Since it works on the breadboard I have to assume it has something to do with my pcb layout. I have reviewed my schematic and pcb layout many times and everything seems to be in order. I also tried connecting the RC Decay circuit on the breadboard to an unused pin on the pcb with the same jerky results.

I am looking for ideas of what could be the problem and possible next steps in troubleshooting.

Thanks
-earl

Per standard help protocol I have uploaded everything (Code, schematic, pcb layout, printout of normal and jerky decay). I use ExpressPCB/SCH if anybody wants to look over them.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET

"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2009-11-03 06:54
    if you want all forum members beeing able to help you easily provide PNG-graphics or jpg-graphics of ciruit and pcb-layout
    if you have an oscilloscope it would be useful to add screenshots of the scope how the spikes look like

    best regards

    Stefan
  • Earl FosterEarl Foster Posts: 185
    edited 2009-11-03 11:30
    I started to do but I figured if somebody wanted to review the pcb they would need the pcb file to see the layers. JPG uploaded in addition to other files. thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
    422 x 258 - 99K
    1320 x 770 - 320K
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-11-03 14:34
    Sorry, your pcb has basic design flaws. You MUST connect both sets of power pins on the prop and you must use decoupling caps. See the recent pcb thread for links to lots of discussions - it has been placed on the wiki. That will be your first problem to solve.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Earl FosterEarl Foster Posts: 185
    edited 2009-11-03 18:01
    I can easily install a cap and connect the other VDD.· Interestingly enough I had never heard that before but it has been a long time since I last visited·the forum.· Will try that tonight.·thx

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • Earl FosterEarl Foster Posts: 185
    edited 2009-11-04 02:06
    Incorporated the circuit changes with no change in results. The RC decay is still jerky on the pcb but not on the breadboard.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • BradCBradC Posts: 2,601
    edited 2009-11-04 02:36
    I'm a little unsure as you your precise component placement on the PCB, but it *looks* like you have a pretty light VSS line circling the board. I wonder if your servo currents are causing noise on the VSS line. It'll be a self feeding loop. Your servo moves and changes the RC value, your RC value changes so you move the servo; lather; rinse; repeat.

    Your RC value is _absolutely_ dependent on a clean, stable earth. I'm not sure that is what you are giving it. What is your track size?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • kwinnkwinn Posts: 8,697
    edited 2009-11-04 04:17
    It could also be that the extra capacitance of a breadboard that prevents the problem showing up there.
  • Earl FosterEarl Foster Posts: 185
    edited 2009-11-04 04:37
    The width of the grounds are 0.20 and measure 0 ohms. Everything is measuring what it should. Oh well bite the bullet and redesign. Thanks for the ideas.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • BradCBradC Posts: 2,601
    edited 2009-11-04 04:45
    Earl Foster said...
    The width of the grounds are 0.20 and measure 0 ohms. Everything is measuring what it should. Oh well bite the bullet and redesign. Thanks for the ideas.

    Umm.. what is 0.20 ?

    You won't measure a problem with your multi-meter. You won't see a problem until you have a nice current flowing, when you will start to see some voltage drop in the lines.

    Grab some nice fat wire and tack *individual* earths in a star from your regulator to the Prop (both earth pins), the gnd of the RC circuit and the GND's of your servos. Leave all the existing tracks connected. I'll wager it won't solve the problem, but I'll sure bet that the amplitude of the variation is reduced significantly. It might also help to put some good, low impedance caps directly across the power pins of the servos.

    If that helps at all, then it points to the layout as being the problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • potatoheadpotatohead Posts: 10,261
    edited 2009-11-04 04:48
    20/1000 Inch maybe?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • BradCBradC Posts: 2,601
    edited 2009-11-04 04:54
    potatohead said...
    20/1000 Inch maybe?

    .2 of a mm ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • potatoheadpotatohead Posts: 10,261
    edited 2009-11-04 05:03
    That's really, really small!

    From the scale of the image, it's inches.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • whickerwhicker Posts: 749
    edited 2009-11-04 21:07
    Is it just me, or is there a + intersection right at propeller chip pin #2?

    That's actually tying it to pin #12, and pin #8 of the eeprom? (3.3V?)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-11-05 00:01
    Not sure if it has been mentioned, but I can't see some bigger supply caps at the regulators. Even battery powered equipment needs the caps. There are no hard and fast rules, but generally you need some big caps and small caps. Some might disagree with the values I use, but I got some job lots of caps and put them all in. At the input to the first regulator something like 470uF 16V electrolytic. You can leave the 0.33uF there as well if you like. Then after the 7805 I tend to put a 10uF to 22uF tantalum. And a 0.1uF. And after the 3V3 reg I also use a 10uF to 22uF tantalum. Then I put 0.1uf bypass caps physically next to every chip on the board between their power supply pins. Possibly it is overkill having a 0.1uF next to the prop and also next to the eeprom, but the caps are cheap.

    Also I presume the batteries are >7V when almost flat, ie at least 7 cells? Or is it powered by a wall wart?

    With shaking servos I'd be very suspicious of a non stable power supply.

    For years I persisted with trying to debug mysterious faults like this. Then I went and bought a $110 CRO. It makes things so much easier. You can see the RC waveform on a screen. You can put it on a power supply and quickly click through all the timebase settings to look for waveforms at different frequences (eg 60Hz and megahertz instabilities). And you can look at the waveform going into the servos and see if it is a clean square wave. Can you get access to a CRO?

    Post Edit - I was looking at the circuit again and wondering why you even need a 5V regulator as everything is powered by 3V. Then I noticed the 5V is actually powering the servos. That is going to get very difficult. Even 22uF on the 5V supply isn't going to be nearly enough. You might need to run the 3V reg directly off the battery rather than via the 5V reg. And you might want to have the earth wires from the servos going to the 5V reg and then straight to the battery -ve. Ditto the earth from the board, so the earths are a 'star' that comes from the battery. Even then you might not get it stable enough. I've pulled to bits many radio controlled cars etc and many use seperate supplies, eg a 9V battery to do the electronics, and 4 nicads to do the servos. With the prop running at 3V you could do things a bit differently, eg use 4 small nicads and a low(ish) dropout 3V reg. And power the servos directly off 4 AA nicads without even needing to regulate that supply.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build

    Post Edited (Dr_Acula) : 11/5/2009 12:14:46 AM GMT
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2009-11-05 00:59
    I know it may be a bit late for this (seeing as you already have your PCB made up). But I have a bit of a fondness for using ADCs for inputs like this. Getting the current pot position would be a simple matter of getting the ADC's value: 50% of the max value is middle, and as you move the pot, the value swings between 0% and 100%. They are fairly cheep ($2.20 for an eight channel from my supplier), and you could put pots on all eight channels. You could then add a capacitor to reduce any jitter received from your PCB design, or just smooth the changes in the input.

    As to solving your currently problem, other than some PCB design problems, and the lack of power planes, I think you might just need more capacitors as others have stated. When in doubt decouple the ICs, and for power (on either side of the regulators) err on the side of larger capacitors (electrolytic: generally larger capacity means less ESR), and smaller ceramic caps as high frequency low pass filters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't make strings the bane of the Propeller, bend them to your will!
  • Earl FosterEarl Foster Posts: 185
    edited 2009-11-24 03:56
    It took an O-Scope to isolate the problem which turned out to be the 2.2uf output capacitor. Instead of just slapping in a large capacitor in the circuit and be done with it I decided to run a few experiments to see where the 3.3v output was stable even to provide a consistant RC decay constant. In this instance it was 10 uf.

    I attached a before and after comparision of the rc decay.

    Thanks for the suggestions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
    988 x 607 - 107K
Sign In or Register to comment.