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

Prop Unexpectedly Restarting

2»

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-03-12 19:26
    John,

    Before you consider it completely solved, there is one more thing you should do, if you haven't already: bypass the motor leads at the motor. This consists of three 0.1uF ceramic caps: one soldered across the motor terminals, and one each from each terminal to the motor housing.

    -Phil
  • John BoardJohn Board Posts: 371
    edited 2012-03-12 22:07
    Guess what... Its not working...

    The code that I had entered for some unknown reason had eliminated, however, since the square waves were so short, there was no torque and speed on the motors.

    I can't get any caps, and I don't have any, I live 4 hours from an electronics store. Are there any other solutions to this problem. I'll just review the senario again:

    Both the Microcontroller and the Motor drivers have different power sources.
    The propeller doesn't restart with very short wave lengths, however does with long wave lengths.
    It isn't a serial problem, as my code is simply On/Off stuff.
    The Main power bus on the micro doesn't drop when I start the drivers

    Hope you can help,

    John
  • T ChapT Chap Posts: 4,223
    edited 2012-03-12 22:16
    What is a long wavelength versus a short one? Can you post your code to show what you mean? A photo of the whole setup may benefit.
  • John BoardJohn Board Posts: 371
    edited 2012-03-12 22:30
    Long wave is infinite
    Short wave is (sorry for the format) waitcnt(clkfreq/200000+cnt)

    DSC_0089.jpg


    Sorry about the quality of the next one, it *should* be good enough though. I will try and get another photo in a minute.

    DSC_0086.jpg
    DSC_0087.jpg


    And this is one of my other robots still getting built, its just a "for fun" photo ;)

    DSC_0083.jpg


    -John
    1024 x 681 - 85K
    1024 x 681 - 60K
    1024 x 681 - 63K
    1024 x 681 - 69K
  • John BoardJohn Board Posts: 371
    edited 2012-03-12 22:43
    Here is the "good" picture. I've tried to label the wires as best as possible.

    Be warned that not all of the wires in this photo are connected to the motor driver circutry, I hope you can extract all the information you need from my messy wiring :/

    DSC_0091.jpg


    -John

    EDIT: Here is my code (Sorry about its messiness):
    CON 
      _clkmode = xtal1 + pll16x 
      _xinfreq = 5_000_000
    
    
    VAR
    
    
      Long stack[40]
    
    
      Long SpeedL
      Long SpeedR
      
    Obj
    
    
    TAOS: "JawsTAOSUtil"
    Ser: "JawsSerial"
    COL: "JawsColor"
    LCD: "JawsLCD"
    
    
    PUB Start | colo
    
    
    InitMTR
    'Ser.start(31,30,0,9600)
    LCD.start(15)
    LCD.BacklightOn
    
    
    LCD.str(String("Red: "))
    LCD.CR
    LCD.str(String("Green: "))
    LCD.CR
    LCD.str(String("Blue: "))
    LCD.CR
    LCD.Str(String("Color: "))
    
    
    OUTA[9..11] := 1
    
    
    
    
    repeat
      taos.tick(4)
    
    
      'LCD.Line1(10)
      'LCD.dec(taos.getRed(4),3)
    
    
      'LCD.Line2(10)
      'LCD.dec(taos.getGreen(4),3)
    
    
      'LCD.Line3(10)
      'LCD.dec(taos.getBlue(4),3)
    
    
      'LCD.Line4(10)
      'colo := col.getColor(taos.getRed(4), taos.getGreen(4), taos.getBlue(3))
      
    
    
      'if colo ==1
      '  LCD.dec(colo,3)
      '  Forward
      'else
      '  LCD.Line4(10)
      '  Lcd.Str(string("   "))
      repeat 500
        Forward
        waitcnt(clkfreq/200000+cnt)
    '  waitcnt(clkfreq/200000+cnt)
      
      'Ser.dec(COL.getColor(Taos.getRed(4), Taos.getGreen(4), Taos.getBlue(4)))
      'waitcnt(clkfreq/4+cnt)
    
    
      
    
    
      
      
      'Forward
      'waitcnt(clkfreq/200000+cnt)
      
      
    '  waitcnt(clkfreq/5000+cnt)
    
    
      
    PUB InitMTR
    
    
      DIRA[9..11]~~
      OUTA[9..11]~
      DIRA[25..27]~~
      OUTA[25..27]~
    
    
    PUB LeftF
    
    
      OUTA[9..11] := 1
      OUTA[9..11] := 1           
    
    
    PUB LeftB
    
    
      OUTA[9..11] := 0
      OUTA[9..11] := 0           
    
    
    PUB RightF
    
    
      OUTA[25..27] := 1 
      OUTA[25..27] := 0
    
    
    PUB RightB
    
    
      OUTA[25..27] := 1 
      OUTA[25..27] := 0
    
    
    PUB Forward
      OUTA[9..11] := 1
      OUTA[25..27] := 1
      OUTA[9..11] := 1
      OUTA[25..27] := 0
    
    
    PUB Backward
      OUTA[9..11] := 0
      OUTA[25..27] := 1
      OUTA[9..11] := 0
      OUTA[25..27] := 0  
    
    1024 x 681 - 122K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-13 02:43
    John Board wrote: »
    Long wave is infinite
    Short wave is (sorry for the format) waitcnt(clkfreq/200000+cnt)

    John the shortest waitcnt amount is around 800. Your waitcnt of 400 (@80MHz). is too short (it will end up waiting about 54 seconds for the clock to roll over).

    I'm glad Phil suggested the caps on the motor. I had wondered about that yesterday. Motors can be noisy (electronically) things.

    You're going to need to get some basic parts like caps and resistor. SparkFun sells some resistor packs and I know they sell 0.1uF caps.
  • LeonLeon Posts: 7,620
    edited 2012-03-13 03:34
    TVSs, such as AVX TransGuards, can be helpful, as well. Put one across the 3.3V supply to the Propeller.
  • T ChapT Chap Posts: 4,223
    edited 2012-03-13 07:29
    It looks like you are tying the - motor lead(at the blue terminal block) to the GND of the Prop power rails. If the motor reverses, then doesn't the motor driver reverse the polarity to the motor leads( blue terminal block)? In that case you would in effect be slamming a +V output from the driver to the Prop GND. Likewise, if the low side of the motor driver is controlling the speed via PWM, then by attaching the low side of the motor to GND, you are causing the low side of the motor to sit at GND versus getting chopped by PWM, thus it is not easy to control the speed.

    The Prop GND should be connected to the battery - (vmot-), not the motor leads.

    Never have the motor driver outputs tied to voltage rails unless you are specifically trying to induce the smoke out of some components.
  • pedwardpedward Posts: 1,642
    edited 2012-03-13 18:10
    I note that you don't have ground connected to the MOT-, but it's on the adjacent pin, which means you'll see noise coupled into your power plane on the GG board. Remove the 2 green jumpers from the board on both breadboards.
  • John BoardJohn Board Posts: 371
    edited 2012-03-13 21:10
    T Chap wrote: »
    It looks like you are tying the - motor lead(at the blue terminal block) to the GND of the Prop power rails. If the motor reverses, then doesn't the motor driver reverse the polarity to the motor leads( blue terminal block)? In that case you would in effect be slamming a +V output from the driver to the Prop GND. Likewise, if the low side of the motor driver is controlling the speed via PWM, then by attaching the low side of the motor to GND, you are causing the low side of the motor to sit at GND versus getting chopped by PWM, thus it is not easy to control the speed.

    The Prop GND should be connected to the battery - (vmot-), not the motor leads.

    Never have the motor driver outputs tied to voltage rails unless you are specifically trying to induce the smoke out of some components.

    As I said, not all wires are actually part of the motor driver circutry, although it may look like those wires from the prop power bus goes to the motors, they don't actually.

    As I said before, I would love to be able to pop out to the store to get a few resistors, and caps, but unfortunatly that store (Jaycar) is 4 hours away... That is the closest one, I live in the middle of outback Australia.

    My ventures are now taking me down the path of trying to get this motor driver working on BOE with the BS2px. If I can get it working on this board, then I will have maybe a better understanding of the prop problems, having said that, I still really wanna get it working with the Prop, so don't stop there with the help, thanks again for everyone's time and effort in helping me,

    -John
  • John BoardJohn Board Posts: 371
    edited 2012-03-13 21:13
    Duane Degn wrote: »
    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.

    I think I check the power bus with the multimeter, there was no voltage drop, I can check again however.
  • John BoardJohn Board Posts: 371
    edited 2012-03-13 21:14
    pedward wrote: »
    I note that you don't have ground connected to the MOT-, but it's on the adjacent pin, which means you'll see noise coupled into your power plane on the GG board. Remove the 2 green jumpers from the board on both breadboards.

    Alas, the picture is decieving, the wire is actually connected to the MOT-
  • T ChapT Chap Posts: 4,223
    edited 2012-03-13 22:34
    John, you should disconnect unused wires that are connected to the power rails. I see that you have several jumpers from the Prop main 5v and Gnd that run to the rows next to the motor driver terminal block. Bread boards are like antenna stuck on your rails, especially that close together. Also, it is possible that the current consumption from the motor driver is pulling down the Prop supply, as you show the 5v from the Prop board powering the motor driver. I would look around for a larger power supply(1amp at least) and test it. Considering everyone is sort of still guessing at what is really connected, I think you should either clear the breadboard of unused parts and wires and make it very obvious in a photo what is going on, or thoroughly document the entire circuit on paper and post it.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-14 07:06
    John Board wrote: »
    As I said before, I would love to be able to pop out to the store to get a few resistors, and caps, but unfortunatly that store (Jaycar) is 4 hours away... That is the closest one, I live in the middle of outback Australia.

    You can get mail order right? It's been years since I've purchased a capacitor or a resistor in a brick and mortar store. The price difference between the two usually makes the shipping worth it.

    Heck, PM my your address and I'll send you some caps as an early wedding present.

    I'm placing an order to SparkFun today for some for L298N chips and some schottky diodes. I'll send you a L298N (with diodes) so you can try it out.
    John Board wrote: »
    I think I check the power bus with the multimeter, there was no voltage drop, I can check again however.

    I'm not sure, but I think many, if not most voltage, drops wouldn't be noticeable on a meter or a LED. You'd need a oscilloscope to catch it. I've had this happen so many times, I just start adding caps without breaking out the o'scope.
  • John BoardJohn Board Posts: 371
    edited 2012-03-14 17:32
    Duane Degn wrote: »
    You can get mail order right? It's been years since I've purchased a capacitor or a resistor in a brick and mortar store. The price difference between the two usually makes the shipping worth it.

    Heck, PM my your address and I'll send you some caps as an early wedding present.

    I'm placing an order to SparkFun today for some for L298N chips and some schottky diodes. I'll send you a L298N (with diodes) so you can try it out.



    I'm not sure, but I think many, if not most voltage, drops wouldn't be noticeable on a meter or a LED. You'd need a oscilloscope to catch it. I've had this happen so many times, I just start adding caps without breaking out the o'scope.

    Thanks for your offer, but remember, I live in Australia. Also my parents don't like the idea and they've told me not to accept presents from "strangers" :/
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-14 22:15
    Duane Degn wrote: »
    I'll send you some caps as an early wedding present.

    John, You're not the one getting married (I'm sure you're relieved). It's olesk. He also had trouble I thought caps would help. Sorry about the mix up.
  • John BoardJohn Board Posts: 371
    edited 2012-03-16 01:20
    *WHEW*

    Update! I am getting a doctor in electronics to review my situation. He extended the kind offer at RoboCup last year in Rockhampton. If he can't solve it with scopes, a mound of components, and a computer, nobody can :tongue:.

    Thanks again for all your help and time,

    -John
Sign In or Register to comment.