Shop OBEX P1 Docs P2 Docs Learn Events
Mysterious Prop Problems?!?! Please Advise. — Parallax Forums

Mysterious Prop Problems?!?! Please Advise.

mhamen3mhamen3 Posts: 69
edited 2011-08-12 02:35 in Propeller 1
I have a problem...

My prop has mysteriously stopped working. I have a custom made circuit board that handles my prop. It was made to drive 14 servos, drive four motors, accept 6 digital inputs and a serial stream. Up until a few days ago it has worked fine. I had been doing testing on some programs and it has worked swimmingly for about three weeks. I had used it one day with no problems, disconnected all power sources, then when I came back to it the next day it wouldn't work. I had always been loading the program straight the the prop memory, even though I have eeprom on the board. When I load a program that I know for a fact had worked before, it no longer does.

The board has a direct connection to 7.4V for servo power, a 3.3V regulator and a 5V regulator for servos that don't accept 7.4V. All power supplies are verified to be working correctly. All traces on the board were verified for correct continuity. I have limited diagnostic tools (multimeter). All capacitors look fine, all power sources aren't strained to supply necessary amperage.

What I've tried so far:
Replaced 5Mhz crystal.
Replaced prop chip (DIP)
checked continuity
reinstalled prop tool on computer (computer recognizes and says programming is complete when executed)

I am at my wits end. I can't for the life of me figure out why this thing isn't working. Maybe it is my prop plug? I've even gone so far as to check for solar storms around the day it stopped working. Please, any help will be supremely appreciated.

Comments

  • mhamen3mhamen3 Posts: 69
    edited 2011-08-09 20:28
    Here is the program I've tried loading.
    CON
    _clkmode = xtal1 + pll16x 
    _xinfreq = 5_000_000 
    ServoCh1 = 1 'Select DEMO servo 
    ServoCh2 = 2
    ServoCh3 = 0
    ServoCenter1 = 1500
    ServoCenter2 = 1500
    ServoCenter3 = 1500
    
    OBJ
    SERVO : "Servo32v7.spin"
    MOTOR : "SetMotor.spin"
    TRIG : "SL32_INTEngine.spin"
    
    VAR
    
    long Angle, Angle2, Angle3
    long PosA
    long PosB
    long PosC
    
    PUB Servo32_DEMO | temp
    
     SERVO.start
     SERVO.ramp
     SERVO.set(ServoCh1,ServoCenter1)
     SERVO.set(ServoCh2,ServoCenter2)
     SERVO.set(ServoCh3,ServoCenter3)
     Angle := 1                                         'Set initial condition (necessary?)
     Angle2 := 120
     Angle3 := 1
     
     repeat
       PosA := TRIG.sin(Angle,300)+ServoCenter1         'Scales sweep of 1400 by sin value and adds it to servo minimum
       PosB := TRIG.sin(Angle2,300)+ServoCenter2
       PosC := TRIG.sin(Angle3,300)+ServoCenter3
       SERVO.set(ServoCh1, PosA) 
       SERVO.set(ServoCh2, PosB)
       SERVO.set(ServoCh3, PosC)
       waitcnt(500_000 + cnt)                          'waits about 1/60th of a sec to allow movement
       Angle := Angle + 1
       Angle2 := Angle2 + 1
       Angle3 := Angle3 + 2                        'adds 1 degree for next iteration
       IF Angle==359
         Angle := 1
       IF Angle2==359
         Angle2 := 1
       IF Angle3==359
         Angle3 := 1                                             'Reset
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-09 20:31
    Just a quick suggestion but don't you think that it would be rather hard for us to help seeing that we don't have any real information on your custom circuit? Guesses we can make. Real help? Not likely.

    Schematics, photos, etc are necessary.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-09 20:33
    Please post a schematic for your board and, if possible, a PCB layout image, showing the top and bottom layers superimposed. Also, a close-up photo will be helpful.

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-09 20:37
    Two things: when you post code, check out this:


    attachment.php?attachmentid=78421&d=1297987572


    Also, by "not working" do you mean the Prop chip has no function at all (= dead), or that it is not providing the proper behavior in driving all of your servos, etc.?
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-08-09 21:00
    Guesses...

    1. Do any pins have voltages exceeding the 3.3 V on them at the prop? With everything attached as you would be running to see if anything is just killing the new prop chip when replaced?
    2. Reset and BOE at the appropriate level to run?
    3. Does your meter have freq counter mode? pins 28/29 S/B 5.00Mhz or so for 5mhz crystal. (using Amprobe 37XR-a)
    4. If you have an unused pin, try the blinky led thing to see if any program works. With as much else as possible disconnected.
    5. Replace eeprom

    Just a couple ideas,

    Frank
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-09 21:57
    You said your program was downloading. If this is so, then at least the download is running and therefore, to some extent, so is the prop and the propplug.

    You can try the FullDuplexSerial object to send data back to the pc (use PST). This will verify a few things... the prop is still working and so is the PLL. The propplug is also working. Then you should at least try the flashing led on as many pins as you are able.
  • kwinnkwinn Posts: 8,697
    edited 2011-08-09 22:26
    As Cluso99 says start simple and work up from there. Download a simple program to ram that blinks one or more leds. If that works download the same program to eeprom, and work your way up from there.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-09 23:02
    Hmm.. that is an awful lot of motors and such. Could it be that you had a voltage spike (transient) zap your EEPROM and render it forgetful?

    One of the more common problems with micro-controller circuits is that examples usually omit the much needed protective circuitry for the sake of making schematics easier to read. When you start adding a lot of motors, you have many inductors that can cause flyback voltage spikes. An oscilloscope is really needed to observe and fix the problem - if that is what is going on.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-08-09 23:10
    When you start adding a lot of motors, you have many inductors that can cause flyback voltage spikes. An oscilloscope is really needed to observe and fix the problem - if that is what is going on.

    Or simply assume that spikes will always be part of the design and build in a backswing diode and RC snubber. Though unless these inductors are direct connect or the spike so hard as to take out the driver circuits, it should not kill the prop chip. Consider opto-couplers as well.

    Frank
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-09 23:30
    mhamen3 wrote: »
    I have a problem...

    My prop has mysteriously stopped working. I have a custom made circuit board that handles my prop. It was made to drive 14 servos, drive four motors, accept 6 digital inputs and a serial stream.
    <snip>

    I have limited diagnostic tools (multimeter).
    <snip>

    When I first read the post it was these two items that worried me the most and stopped me from taking any guesses. I've seen threads mushroom from speculation and guesses with not necessarily any further input from the OP. Will this one be any different?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-10 00:03
    Well, one can either try to help or one can just say help is impossible. The nature of EEPROMs is that they by their very nature are susceptible to transient spikes - since they are programmable.

    Personally, I was worried that this aspect was being overlooked. Since the Propeller internally has NO EEPROM, it may not suffer any lasting damage while the EEPROM does belly up.

    Snubbing noise right at the motor is a wise procedure and doesn't require one to redo the original board. Often a small capacitor with a high voltage rating across the + and - of the motor terminals is all that is required. Backswing diodes may work, but only if motor polarity is NOT reversed.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-10 00:46
    Of course, the whole problem might be reduced to a low battery.

    The primary point is that 'if the code was working well", the problem is somewhere in the hardware.

    Quite often, new users forget that the battery needs to be recharged or replaced and suddenly blame other things. A crystal failure is highly unlikely. And Parallax has made the Propeller rather rugged as hobbyist tend to heavily abuse microprocessors before they know how to not do so.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-10 00:49
    Well, one can either try to help or one can just say help is impossible. The nature of EEPROMs is that they by their very nature are susceptible to transient spikes - since they are programmable.

    Personally, I was worried that this aspect was being overlooked. Since the Propeller internally has NO EEPROM, it may not suffer any lasting damage while the EEPROM does belly up.

    Snubbing noise right at the motor is a wise procedure and doesn't require one to redo the original board. Often a small capacitor with a high voltage rating across the + and - of the motor terminals is all that is required. Backswing diodes may work, but only if motor polarity is NOT reversed.

    Sorry Loopy, I wasn't looking at any one reply really but just musing in general when these threads come up. I've seen threads with many pages of helpful advice from everybody racking their brains trying to come up with the correct answer to the wrong question. Oftentimes you don't hear back from the OP or eventually you get a rather terse post that says "don't worry, I've solved it" without any further information......grrrrhhh.

    BTW, I have never had problems with serial EEPROMS, but power electronics such as motors etc where you have higher voltages and currents requires some knowledge before doing your own custom board as grounds and supply can bite if you don't know what you are doing.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-10 04:07
    EEPROM failure seems to be a problem with older stepper motor drivers. Occasionally, we get people asking how to rebuild their EEPROMs for such or how to reprogram PICs. So, I assumed that context is likely.

    There certainly is a "good Samaritan" dilemma is offering help to Noobs that don't reply back - or just offering advice in general. I try to stick to what I think is real advice rather as it might help other newcomers that have problems.

    In order to keep threads readable, I try to stay quiet if someone who is a good authority is already contributing. It would be nice if we had one Forum dedicated to Troubleshooting.

    Something tells me that this is really a dead battery and that the OP might be too embarrassed to reply.
  • mhamen3mhamen3 Posts: 69
    edited 2011-08-10 06:55
    Sorry I didn't respond sooner. I didn't expect such quick and numerous replies and sleep and work tend to get in the way.

    The batteries are fully charged. I have a separate battery for the servos and the prop.

    I'm not sure about a voltage spike as I've only had three servos connected to it up to this point. Also, I do have 1k resistors on each pin to help curb any back voltage.

    I replaced the eeprom and that didn't solve it.

    Checked the voltages at the prop power inputs, they still read 3.3V.

    When I get home from work I'll try loading the flashy led prog and go through the pins.
  • RaymanRayman Posts: 14,876
    edited 2011-08-10 18:04
    fullduplexserial can be a real help debugging things like this...

    Start it up on pins 30&31 and talk over the Prop Plug to the Parallax Serial Terminal like this:

    ser.start(31,30,0,9600) 'Start up serial comms. Use Parallax Serial Terminal to see status...


    Add lines in you code to send stuff over the link, so you can see where the code is at like this:

    repeat 5
    ser.str(String("Hello",13))
    waitcnt(cnt+clkfreq/2)

    if it won't work at all, even with a simple, small test program, then you have a bad Prop chip or a bad crystal connector, or bad power.

    Actually, power is probably OK if it will let you program it...

    BTW: you should also make sure you have big, like 10uF, caps close to the Prop. Also, all the Props GND and Vdd pins need to be connected.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-10 23:38
    Before you get too deep into diagnostic procedures, you might just tests supply voltages of the unpopulated board. Remove the Propeller and the EEPROM and test for low voltages. Try this with the motors and without the motors.

    You may have picked up a bit of metal that is bridging a connection somewhere. It could even be shutting the crystal without any indication of voltage drop.

    So, if you cannot load programs and cannot blink an LED, this might be the best route to go. After construction is finished, clean the bench and keep the workspace clean to avoid these kinds of problems in the future.

    When all else fails, I take the board to the bathroom and give it a good scrub with a discarded toothbrush and a bit of liquid dish soap. That occasionally solves problems that remain unseen.
  • mhamen3mhamen3 Posts: 69
    edited 2011-08-11 16:27
    So the board works fine. Tested with the blinky led prog and it was fine. However, for some reason I still can't get the board to drive my servos anymore. They aren't starved for power, all objects are loaded and all things are connected correctly. I'm using the program posted above. Anyone see any problems with it?
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-11 16:35
    mhamen3 wrote: »
    ... I'm using the program posted above. Anyone see any problems with it?

    Did that program work okay previously? Did you make any changes to it before your board stopped working properly? I would not suspect the software is a problem if it proved itself earlier. A schematic might help at this point.
  • mhamen3mhamen3 Posts: 69
    edited 2011-08-11 16:54
    SOLVED!!

    It seems that the servo32V7 object was corrupt. I redownloaded it and now everything works fine. THANKS FOR THE HELP GUYS!!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-08-12 02:35
    Happy to see it is resolved.

    I see in another recent thread that someone purchased 48 servos and found only 7 were working on a Propeller. The problem went away by adding a 1K resistor to the right place. It seems that the load wasn't right for the servo inputs.
Sign In or Register to comment.