Shop OBEX P1 Docs P2 Docs Learn Events
Prop Unexpectedly Restarting — Parallax Forums

Prop Unexpectedly Restarting

John BoardJohn Board Posts: 371
edited 2012-03-16 01:20 in Propeller 1
G'day everyone,

Been working with the prop recently, and I have been having trouble with it restarting unexpectedly. I am using it to drive a motor driver, the wheel turns for a time (random amount of time) and then stops, I have determind it was becase of a prop restart. There is plenty energy for it, it is plugged into a wall socket, and the motor is running on a different power supply. I do know that it was a restart, however, I don't know why... Can anyone help me? I really need help.

Thanks in advance,

John

P.S. Each I/O pin is not having more than 40 ma drawn from it.
«1

Comments

  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 14:45
    Any way to draw the schematic and post? Are both power supplies connected gnd to gnd? How is the Prop connected to the motor driver?

    When it is restarting, is the USB cable connected between the Prop board and the PC or not. Does it restart with the USB cable disconnected from the Prop board?
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 14:56
    @Phil:

    The links you sent me weren't really applicable. However, the last 2 were interesting, because I just had the same sort of serial problem, I had figured it out previous though.

    @T Chap:

    Here is the driver I'm using:

    http://www.pololu.com/catalog/product/713

    I've connected pretty much as per the link. I loaded a "motor forwards" program to the EEPROM, and then loaded a "motor backwards" program in the RAM. The motor turns backwards for a time (random amount) and then stops, then it waits for about 1 second (Prop boot up time) then it starts turning backwards, that is why I say it is restarting. I have no idea why it is restarting.

    I have connected all the pins as per the link, however, I have left out the following pins because I do not need to hook them up as I am not using a second motor:

    BIN1
    BIN2
    PWMB
    BO1
    BO2

    I have noticed that if I "Hard wire" up the pins:

    AIN1: 5V
    AIN2: GND
    STBY: 5V

    And only control the PWMA pin via the prop, everything is fine, however, when I connect the pins AIN1, AIN2, and STBY, the prop turns the motor for a bit, then restarts.

    I hope this is enough information and thanks for your help,

    -John
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 15:00
    Are all of the grounds of the power supplies tied together?
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 15:12
    No, I'm using 2 different power sources. One is mains power, and the other one is a 6v torch battery (Large squareish sorta thing).
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 15:16
    Can you try it with connecting all the grounds together? Is the motor driver board powered off the batt or the same power as the Prop? See what happens with all GNDs tied.
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 15:19
    The prop is powed from the mains, and the VMOT (Motor driver power) is the battery.

    *While connecting the grounds together, bracing self for large "BANG" and smoke rising from my circutry*
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 15:20
    Looked promising....

    Close, but no cigar. The motor did what it always did, turn for a bit, then stop, here is my code:
    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    
    
    PUB Start
    
    
    DIRA[4..7]~~
    
    
    OUTA[4..7] := %1011
    
    
    'repeat
    
    
    repeat
      !OUTA[4]
      waitcnt(clkfreq/500+cnt)
    

    Thanks,

    -John
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 15:24
    What are the pinouts from the Prop to the driver? Code doesn't help without more info. For a single direction, why are you toggling a pin? Why not just set the pin states and go into a repeat to lock the code up.
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 15:30
    Mainly because I want to be able to control the motor's speed. P4 is PWMA, P5 is AIN1, P6 is AIN2, P7 is STBY.
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 15:35
    By toggling pin 4 you are sending a relatively slow 50% duty cycle, if the driver will accept that slow PWM rate, the motor is running at 50% power. Which could also be dumping some RF onto the Prop system causing a reset. Try an experiment and just leave the pin 4 high ( which is effectively a 100% duty cycle. See what happens. Basically your same code with nothing after the repeat.

    The module does not specify a PWM minimum freq, only max of 100k. For speed control you would be better to use an object like PWMASM, set the duty and rate. For example 20k and 0-100 duty for testing.
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 15:58
    Tried that, not working
    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    
    
    PUB Start
    
    
    DIRA[4..7]~~
    
    
    OUTA[4..7] := %1011
    
    
    
    
    repeat
      waitcnt(clkfreq/500+cnt)
    

    -John
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 16:37
    When it is restarting, is the USB cable connected between the Prop board and the PC or not. Does it restart with the USB cable disconnected from the Prop board?
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 16:41
    Makes no difference if it is connected or not.
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 16:47
    Sorry my ideas did not avail. My only guess is noise on the Prop board. If you can take a photo of the setup maybe someone can see something.

    I assume that you have tested some code with an LED( flash on bootup) or some other means to verify that the Prop will function with code other than trying to drive the motor.
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 16:51
    Done a simple serial stuff, like continually send "Test.." to the computer, worked fine. Remeber, it works when only PWMA is plugged in, however, when the other pins are plugged in too, it doesn't work
  • T ChapT Chap Posts: 4,223
    edited 2012-03-10 17:01
    OK, just more guessing that may put you on the right track.

    1. Go back and confirm all connections, verify the inputs to the driver
    2. Insert a 220 - 470 ohm resistor between the Prop lines and the driver. If you are connecting a Prop pin to GND accidentally, it may be that shorting out the Prop(high) pin to GND is pulling the Prop power low enough to brown out the Prop. A series resistor may verify this.
    3. Disconnect the motor but leave the driver on and connected. See what happens
    4. Take a hammer to both boards and see how many separate parts you can create from the 2.
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 17:02
    Thanks for your help,

    I'll try these things, and let you know how I fair.

    -John
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 18:03
    Love option 4...

    Had pain with the motor drivers for about a month... not only these motor drivers...
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 18:05
    Going to (By proccess of elimination) connect each pin, from PWMA to STBY and see at which pin starts to muck everything up. At the moment I have AIN1 - STBY "Hard wired".
  • Jim FouchJim Fouch Posts: 395
    edited 2012-03-10 18:16
    Is this running off a Propeller chip directly? If so is your reset tied properly? I don't know how many times I have worked with different uController and forgot to tie the Reset Line so it would not ramdomly reset.
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 18:21
    @Jim: It is the Gadget Gangster board, so I don't deal with the reset pin at all.

    Well, wouldn't you know, option 4 worked...

    Not, it was actually the STBY pin, as I said, I worked the way through all the pins (From PWMA to AIN2) and worked fine... when I got to STBY I started getting problems. As the STBY pin isn't an integral part of the driver, and I can leave it out, I'm fine with leaving it un-hooked.

    Thanks for all your help, and I hope to see everyone around!

    -John

    P.S. In a few months I'll post a few pics of my robot in the "Projects section"
  • John BoardJohn Board Posts: 371
    edited 2012-03-10 19:58
    Correction. Problem has not been solved
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-11 10:24
    John,

    Just to be sure, the two different power supplies do share the same ground right?

    The motor controller's 5V is coming of the GG board? I'd suggest adding a couple of caps to the GG power lines both 5V and 3.3V. I generally use 1000uF but might be good to include some smaller (0.1uF) caps too. The controller board might pull a relatively high current from from the 5V rail causing the a drop in voltage on both the 5V and 3.3V lines.
  • T ChapT Chap Posts: 4,223
    edited 2012-03-11 10:29
    Also, attach a meter or scope to the Prop 3v3 input. Run the motor and watch the voltage.

    Based on your simple code, for the Prop to reset, it can only be one of several possibilities:

    1. 3v3 is dropping below a point and the Prop resets when it goes back up
    2. The reset pin is getting noise on it causing a reset. I suppose that the noise could affect the FTDI USB interface, which may trip the Reset pin. In all kinds of noisy situations, I do not think I have ever seen this.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-03-11 16:28
    Hi T Chap;
    Also, attach a meter or scope to the Prop 3v3 input. Run the motor and watch the voltage.
    1. 3v3 is dropping below a point and the Prop resets when it goes back up

    I had this same problem a couple of weeks ago.
    I was working on some stepper motor programs and was getting resets.
    At first I thought it was caused by "Static Discharge" in the vicinity.
    I'm using a plug board with lots of wire length. Static discharge resets, to me, were annoying but understandable.
    But this didn't make sense as this happened even when I didn't move.

    Anyway, I had been noticing a small LED on the 5V power buss, (before the 3.3V regulator), was flickering as the steppers would move.
    Bingo, this might be the problem. Then I moved the LED to the 3.3V buss. That flickered also. I was on to something.

    The tiny 5V cell phone switching wall wart I was using was rated at 180mA. This should have been plenty for the small steppers I was using.

    I got out the scope. There it was. The small wall wart didn't like the 60mA current pulses. The 5V would drop down a couple of volts which caused the 3.3V to drop and once in a while the prop would reset.

    The fix was to use a slightly smaller cell phone wall wort that was rated at 500mA. Problem solved.

    Anyway, Even something as simple as a small LED (plus resister) across the power buss can find problems.
    I was surprise at how narrow the dropout pulses could and yet be seen with the tiny flickers of light.

    Duane J
  • T ChapT Chap Posts: 4,223
    edited 2012-03-11 17:39
    Hi Duane. Good points. I had made two assumptions:

    1. He has a power supply that was provided with the board that should have been adequate
    2. He said he has tested the board with other programs and it does not crash.
    3. The board he has already has some LED indicators for power.

    But for sure that is a good point that if he has a low power wall wart then by the time he turns on a few pins, that could be pulling the rail down. If the drop is really fast then the LED may not show it, but a flicker on a meter might show enough to detect that the rail is getting hit. Anyways, at least it is more for him to look at. Good call.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-03-12 05:03
    He is driving a motor though.

    Spikes. from the motor can easily cause these problems.
    Possibly larger filter caps could help. And a small, say 20nF cap or so, on the reset pin to 3.3V rail would help.

    Duane J
  • John BoardJohn Board Posts: 371
    edited 2012-03-12 18:30
    Righto, so, here is the power arrangement:

    GG Prop Board is powered by a 550ma wall socket adapter.
    The motor driver is getting supplied from a large 6v torch battery.

    Originally I had both motors and prop on the mains power (wall socket), but I too had the light flickering on the main power bus. So I seperated the power supplies, that did the trick. Would have loved to hook up a scope to it, but I don't currently possess one. Do have a multi-meter though, can try with that, I think I did before and no bizare readings.

    Thanks for your help,

    john
  • John BoardJohn Board Posts: 371
    edited 2012-03-12 18:53
    The problem appears to be solved. The motors are turning in both directions, and the chip isn't restarting. I don't know what caused the problem, and why it is fixed now, but if it is fixed, then I'm not complaning :P

    Thanks for all your help and your time,

    -John
Sign In or Register to comment.