Shop OBEX P1 Docs P2 Docs Learn Events
Model Railroad Engine Controller (PropActivityBoardWX, DualMC33926, Smoke, 18vDCC, WebPageControl,) - Page 3 — Parallax Forums

Model Railroad Engine Controller (PropActivityBoardWX, DualMC33926, Smoke, 18vDCC, WebPageControl,)

1356

Comments

  • YanomaniYanomani Posts: 1,524
    edited 2020-09-12 20:26
    At Pololu's Dual MC33926 Motor Driver Carrier, all connections to Prop pins seems to have a 1k Ohm resistor in series, so, very unlikely those were the culprits.

    Now, in the event of any failure at GND connections, it'll heavily depends on how the whole project wiring harnesses where connected/routed.

    If there were even a tinny minimal chance for large currrents to find their way THRU sensible parts (including, eventually, discharging paths for the many paralleled filter/decoupling capacitors, during the failure event), then something at the circuit could be burned, not limited to the Propeller chip itself.

    Consider yourself to be a lucky man, if all that needs to be replaced would be limited to the Prop.
  • How are the power lines on the motor controller connected to the power source?

  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 20:39
    Duane Degn wrote: »
    If you post photos of your wiring, maybe someone here will be able to identify the problem.
    You need to make sure the ground connection in your motor circuit is appropriately placed.

    My motor ground was directly connected to the ground of the full wave rectifier, for the motor board to ground through the prop chip through the barrel connector and logic and then through my 1amp fuse to ground would have been more resistance than the direct ground connection it had.

    https://forums.parallax.com/discussion/download/131510/FullyWiredTender.jpg

    https://forums.parallax.com/discussion/download/131529/5A-2200uf.jpg

    One thing I DID NOT connect was the ground for the logic, because the ground on the motor side and the logic on that pcb are tied.
    (but i noticed the datasheet for the MC33926 shows Dgnd and Agnd, so perhaps that polu board made a mistake in connecting those grounds?

    I still don't see why that fried the prop chip, since the ground is clearly connected in my images.
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 20:51
    Its hard to tell what is going where in those images, but the RED and BLACK wires are the motor power and ground.
    The connect directly to the + and - of the full wave rectifier, which is the large chip on the breadboard.

    My schematic is exactly how it was connected.

    https://forums.parallax.com/discussion/download/131876/Railroad-Engine-Controller.pdf

    https://forums.parallax.com/discussion/download/131877/RailroadEngineController.jpg

    Sorry my images are not easier to see the wiring, its hard to do that when its all shoved into a small space.

    The 1amp fuse FOR THE GROUND ONLY in that schematic was the one that was fried, the positive 1amp fuse did nothing.
    This tells me something went through that 1amp fuse ground either to the prop or from the prop.

    One thing that the schematic shows that I didn't do was connect the logic ground to the activity board ground, since the motor ground is the same ground.

    There are diodes between the activity board and the power supply, so that would have prevented reverse current.

    Mabee something caused my logic activity board 1amp fuse to go, which then went through the prop chip(frying it) to the motor board to ground through the logic pins of the motor board?
    I do not use motor board pullups, I control all pins using the prop.

    The motor board says the logic supply isn't needed if you don't need the pullups, (which i didn't) but I connected the logic (vdd) to a prop pin anyway (pullups wouldn't draw much current at all)
    But I suppose I shouldn't connect that to a pin.
    I can try again by leaving vdd disconnected, along with the logic ground. Or mabee i should connect both, perhaps they DO have more purpose and function than just a pullup, but I don't see how the ground connection would matter, its the same as motor ground, technically that is a ground loop? I wanted to keep the activity board power separate from the motor board as much as possible, clearly that did not work.
  • YanomaniYanomani Posts: 1,524
    edited 2020-09-12 21:00
    Please note the way FGND and GND are connected, at Pololu's circuit.

    Pololu_FGND_to_GND_sch_01.jpg

    And now, at the board, GND (logic) is at leftmost bottom, and FGND is at right CENTER.

    Pololu_FGND_to_GND_pict_01.jpg
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 21:06
    Yanomani wrote: »
    Please note the way FGND and GND are connected, at Pololu's circuit.

    Pololu_FGND_to_GND_sch_01.jpg

    Nope, they lie.

    Inspect the bottom of the pcb.
    Its a direct connection.
    You can see it if you have good eyes or a microscope/inspection cam/station, my cam can't do macrovision very well.
    I circled it with a thin red line in the attached image.

    Did the layout person make a mistake?
    You can also ohm it out. less than 1mv resistance, a diode would show more. vdrop.

    You can also see the trace go to the left around to the JUMPER that says GND, that jumper ground is tied to motor gnd, you can see that also.
    1920 x 1080 - 488K
  • YanomaniYanomani Posts: 1,524
    edited 2020-09-12 21:07
    From a product perspective, there should be NO direct connections, at the board level, between FGND and GND(logic), OR, there was no reason to put Q1SO8 there.

    PS: my eyes are not that good anyway, BUT I can notice the track at bottom layer, PROMINENTLY connecting FGND and GND. :lol:
  • Yanomani wrote: »
    From a product perspective, there should be NO direct connections, at the board level, between FGND and GND(logic), OR, there was no reason to put Q1SO8 there.

    I totally agree. Someone screwed up?
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 21:12
    Im going to look up Q1 so8 datasheet and test the pins.

    I can't find the chip.

    7R504 pl 841 are the marking that i can tell.
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 21:37
    LOL, this schematic is completely wrong, the zener diode is attached to the capacitors,, and logic ground but also to the motor side ground.

    Pololu_FGND_to_GND_sch_01.jpg


    LOVELY.
  • YanomaniYanomani Posts: 1,524
    edited 2020-09-12 21:48
    Pololu product page describes it as a "reverse protection MOSFET", whatever could it mean, given actual schemactic x layout context.

    https://pololu.com/product/1213

    P.S. Gene Wilder was absolutelly right, again! :lol:
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 21:59
    To make it like the schematic, two traces would need to be cut, and one jumper wire would need to be soldered to the very top GND on the jumper pin to logic ground (one of the other jumper ground pins)

    I will NOT be doing this, actually I would like parallax to look at this, and decide what should be done.

    Yanomani wrote: »
    Pololu product page describes it as a "reverse protection MOSFET", whatever could it mean, given actual schemactic x layout context.

    https://pololu.com/product/1213

    P.S. Gene Wilder was absolutelly right, again! :lol:


    This means POLOLU owes me a NEW PROPELLER ACTIVITY WX BOARD.

    Eagerly looks at mailbox. (dies of old age)


    .... this world.....

    Heres the corrected SKEEEMATIC (correct spelling for this specific SKEEMATIC.)
    c3da41f12afa1940661a203a5657df.jpg
    ... ^ ponder that one for a second.... or more...




    ....
  • YanomaniYanomani Posts: 1,524
    edited 2020-09-12 22:00
    I believe I've got it!

    The schemactic is not showing all connections (not telling the whole history).

    The circuit, as implemented at the PCB makes sense: if Vin and FGND are REVERSED, them Q1 will conduct, thus, expected to be able to BLOW away any Vin (or FGND)-interveining FUSE, thus avoiding blowing the MC33926.

    What would happen to the rest of the circuit, is completelly T.B.D.
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 22:08
    LOL, why not have some fun.
    Pololu_FGND_to_GND_sch_02.jpg




    ....




    Now I don't know if I should continue with this project.


    ...
    372 x 256 - 28K
  • :lol:

    you can't scrap that diode; it's BUNDLED!
  • Yanomani wrote: »
    :lol:

    you can't scrap that diode; it's BUNDLED!

    "trust me guys, Q1 is the part we need" (looks at stock room, sees an abundance of Q1 parts)
  • Clock Loop wrote: »
    Now I don't know if I should continue with this project.


    Please, go ahead! I know, is YOUR money anyway, but it's also AWESOME!
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-12 22:38
    Yanomani wrote: »
    Please, go ahead! I know, is YOUR money anyway, but it's also AWESOME!

    Funny thing is, the prop chip fried when I had powered the whole circuit on for the 20th+ (or more) time, and I didn't even issue any commands, or any motor movements.

    Its like the large capacitors filled, then somehow the fuse for the ground of the propeller activity board blew, and then I heard this loud squealing noise coming from the propeller activity board.
    (the prop chip was crying as it died? lol)
    Mind you, I didn't even have the motor wire connected, or the axle switch wire, or the front headlight, or the smoker wire,
    (I had already disconnected the wires to the engine from the tender before I even powered it)

    The MC33926 datasheet says this:
    https://www.nxp.com/docs/en/data-sheet/MC33926.pdf
    POWER GROUND AND ANALOG GROUND (PGND AND AGND)
    The power and analog ground pins should be connected together with a very low-impedance connection.
    


    And
    The low current analog signal ground must be connected to PGND via low-impedance path(<<10 mΩ, 0 Hz to 20 kHz). 
    Exposed copperpad is also the main heatsinking path for the device.
    

    Ya can't get any lower impedance than a direct copper trace?
    I wonder, did they mean THAT LOW?



    Apparently a 100k ohm resistor would have been fine.?
    But many of the datasheets "example schematics" show AGND and DGND tied together.
  • At the datasheet, the unique hint about the value of current flowing thru AGND could, perhaps, be derived from "IPWR(STANDBY)" (Data sheet: technical data Rev. 16 — 19 February 2020, page 6), wich states 20mA, max, but the gate drivers are fed from a "charge pump", used to improve their switching speeds, thus, current flowing thru AGND would raise, during normal operation.

    Without carefull measurements, I'll not risk assuming nothing about its operational levels (AGND current flow)...
  • I notice your super caps are on the 3.3V line. This seems odd to me. I'd think you'd want the power to the PAB protected with the super caps. This would of course require a higher voltage cap. When power is lost on the higher voltage lines, won't the 3.3V cap back feed the regulators? I've often heard this was a bad idea.
  • YanomaniYanomani Posts: 1,524
    edited 2020-09-13 04:34
    Another insight: there's a quarter of cannibal indian blood flowing inside my veins, so, as my great grandmother used to say: let's have it, in parts... :smile:

    - according to the wiring diagram, D1 (1N4007) is connected in series, between the general GND, that comes from one of the rails (thru U2 bridge), and Activity Board's GND;

    IMHO, that connection (thru D1) would totally defeat the intended "lower as possible" ohmic resistance between AGND and PGND, asked by MC33296's datasheet.

    This also affects the supercap: its GND is also a diode drop ABOVE Activity Board's GND.

    Please, correct me if I'm wrong...

    P.S.: D2 (1N4007) is enough, to protect C1 from being discharged by Motor, in case of any bad connection events.
  • Duane Degn wrote: »
    I notice your super caps are on the 3.3V line. This seems odd to me. I'd think you'd want the power to the PAB protected with the super caps. This would of course require a higher voltage cap. When power is lost on the higher voltage lines, won't the 3.3V cap back feed the regulators? I've often heard this was a bad idea.

    Perhaps, If I wanted supercaps on the input side of the power (barrel plug) I would need to stack them, and I don't think I have enough to stack that high, Its too bad i cannot put some reverse diodes somewhere after the PAB regulator.
    I could possibly put a regulator before the PAB barrel plug to lower the voltage and then use supercaps...

    So you think the super caps killed the 1amp ground fuse and then fed current through the motor board control pins (as the new ground) killing the prop? (the high pitched squeeling being caused by the reverse fed regulator circuit on the PAB?)

    Yanomani wrote: »
    IMHO, that connection (thru D1) would totally defeat the intended "lower as possible" ohmic resistance between AGND and PGND, asked by MC33296's datasheet.

    This also affects the supercap: its GND is also a diode drop ABOVE Activity Board's GND.

    The supercap is attached to the PAB's ground directly, and its 3.3v

    And the AGND and PGND are the same (at least on the motor board) so you must mean the motor board ground and the PAB ground.
    Also the diodes on my schematic are 1n4001's not 1n4007's. (are you talking about the diodes on the schematic I made, also?)

    I think you are saying that due to the ground diode, this makes the ground between the motor board and the PAB different, and may present higher/lower voltage than 3.3v in relation to the PAB ground?

    So then basically, I set myself up by using fuses and diodes on the ground side of things? When the fuse went, it opened the ground which then floats to the sky?

  • When inductive loads get de-energized, even momentarily, flyback voltages would develop, as high as they could reach. Series resistance (wires included) between the motor coil(s) and freewheeling diodes should be ruled out.
  • YanomaniYanomani Posts: 1,524
    edited 2020-09-13 05:57
    Clock Loop wrote: »
    The supercap is attached to the PAB's ground directly, and its 3.3v

    My bad, perhaps I'm looking at the wrong place, but I'm still seeing D1 (1n4001; my bad too) in series, between PAB GND and the supercap GND.
    Clock Loop wrote: »
    And the AGND and PGND are the same (at least on the motor board) so you must mean the motor board ground and the PAB ground.

    Yep...

    Clock Loop wrote: »
    I think you are saying that due to the ground diode, this makes the ground between the motor board and the PAB different, and may present higher/lower voltage than 3.3v in relation to the PAB ground?]/quote]

    Yep...
    Clock Loop wrote: »
    So then basically, I set myself up by using fuses and diodes on the ground side of things? When the fuse went, it opened the ground which then floats to the sky?

    Partially answered at my former post..

    And also, due to torque transfer and the fact that the Locomotive has rear-drive, any differential vertical movements MUST not be transfered to the Tender, or the pressure of its axles against the tracks would vary, either during acceleration or deceleration, causing a decrease of contact from the pickups standpoint. Current transfer would suffer, to say a little: The rear pickup, during acceleration, and the front one, during decceleration.

    In time: if the locomotive had front-drive, the reverse effects would occur, but current transfer would suffer, anyway. Stupid (me/myself)! Must be the hour (3:00 am, here).

    Eyes hurt, brain wanders.... :lol:
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-13 06:19
    Yanomani wrote: »
    And also, due to torque transfer and the fact that the Locomotive has rear-drive, any differential vertical movements MUST not be transfered to the Tender, or the pressure of its axles against the tracks would vary, either during acceleration or deceleration, causing a decrease of contact from the pickups standpoint. Current transfer would suffer, to say a little: The rear pickup, during acceleration, and the front one, during decceleration.

    In time: if the locomotive had front-drive, the reverse effects would occur, but current transfer would suffer, anyway. Stupid (me/myself)! Must be the hour (3:00 am, here).

    Eyes hurt, brain wanders.... :lol:

    There is only one motor, in the locomotive.
    The pickups are only in the tender.

    But I see where you are going here, I suspected I shouldn't use GROUND SIDE fuses or diodes for these exact reasons,
    my goal was to protect high voltage and high current draining through the ground, but i guess one can only do so much before you end up making things worse.

    I will redo the schematic and put it all back together and try again, without the ground side "attempts" at protection.

    I will also try to move the supercap to the supply side of the PAB barrel connector.
    (but then it feeds the 5v line also, which feeds the smoker, this will drain the supercaps bad.)
    I may have to omit the supercaps and try to use another very large regular cap there,
    since the supercaps have a very low lifetime if they are regularly exercised.

    I was only trying to keep the LOGIC (the prop chip and the wifi chip) powered during bad power moments, ....
    Its likely I just can't use the PAB anymore to accomplish my needs.

    I do wonder if my TVS diodes would have protected me in this situation, I suppose, but only if there were many of them at various locations to short any high voltage rises...
    It chaps my rear that I purchased 25 tvs diodes that were the wrong size (i purchased tssop like parts, so small that they are literally the size of a spec of ground pepper, useless)
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-13 07:26
    (I have removed the ground side diode, fuses, to prevent ground floating)
    I also removed the VDD connection on the motor board since I don't use the pullups.
    https://forums.parallax.com/discussion/download/131926/Railroad-Engine-Controller.pdf

    Click link to get image bigger (3meg image)
    https://forums.parallax.com/discussion/download/131925/Railroad-Engine-Controller.jpg
    bdf9f6dd3cc1d171c8b15b6a3a91ec.jpg


    Wish me luck! (remember i have no skill and am unemployable, its all luck ;) )
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-13 10:17
    Everything is working again, and I got the smoker working, and fixed the LED code in spin,
    (since I launch the communications in a new cog I needed to move the DIRA commands.


    The LGB 5v smoker is really cool, it "PUFFS" due to the way they designed it, really neat!
    (thanks to that parallax RELAY!)

    The motor board still works, actually everything works so far (i haven't tested the A2D for the motor feedback yet tho)
    I added spin code to deal with reversing the engine, and added a switch in the html for reverse.
    As usual, html and css and spin code is attached with zip.

    What REALLY chaps me in spin code is the ability to do this:
    BAD
    If dira[Headlight] := 1
    

    Why would someone want to SET a variable or pin in an IF statements evaluator?
    One would think that should give a compile error. (that one took 1/2 hour of my time, lol)
    GOOD
    If dira[Headlight] == 1
    

    1551 x 1080 - 406K
    1250 x 849 - 115K
  • Wuerfel_21Wuerfel_21 Posts: 5,011
    edited 2020-09-13 14:30
    Clock Loop wrote: »
    Why would someone want to SET a variable or pin in an IF statements evaluator?
    One would think that should give a compile error. (that one took 1/2 hour of my time, lol)
    I actually use that all the time. It makes sense if what you're setting the variable to isn't a constant
    if x := getX
      doStuff(x) ' only called if getX returned non-zero
    
    With PropTool, this will actually generate faster code than assigning x on it's own line...
    ' quite a bit slower
    x := getX
    if x
      doStuff(x)
    
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-13 15:41
    Wuerfel_21 wrote: »
    I actually use that all the time. It makes sense if what you're setting the variable to isn't a constant

    Thats funny, I knew someone would find a use for it, lol.

    Well for me its just darn confusing, heh.

    I find efficient code just ends up confusing me, and in some cases isn't even that beneficial.

    I intentionally code inefficiently, so i can read it and actually remember what its doing.

    To each their own, and I understand some code needs to be efficient, its timing is exact and must be so.
    Thats definitely not my thing, im all about super inefficient code that is easily read. hehe

    Speaking of inefficient code, I had some bugs in my html code I posted earlier so attached is the fixed code.
    If you set the speed to 100 on the throttle it would set the speed to 10 in the engine, lol, so that is fixed.

    I also added an EMERGENCY STOP option, because cats don't obey railroad crossing signals. MEOW!

    I also fixed the PWM code so the engine now does speed up as the throttle is increased, to max speed at 100.
    Before, the code sped up to 50 and then started to slow down at faster throttles.

    I tested the engine with 4 cars, which was a heavy load for the engine that has no rubber on its wheels, the wheel slip was chewing the tracks...
    I need to get some rubber wheel covers.

    The conduction of the tender wheels is pretty good at speeds faster than crawling, and super slow speeds it gets into non-conductive parts of the track and drops out, I will need to skip over the very slow speeds.
    Speeds 0-25 don't do anything for my voltage and motor so I will need to either start the throttle at 35 or divide the 100 range over 35-100.

    I think coding to get the current feedback from the motor board using the PAB's A2D chip is now the next step.
  • Clock Loop wrote: »
    Why would someone want to SET a variable or pin in an IF statements evaluator?
    One would think that should give a compile error. (that one took 1/2 hour of my time, lol)
    C compilers will generate a warning when there is an assignment operator instead of a conditional in an IF statement. In C compilers, the warning can be disabled by putting parentheses around the expression.

Sign In or Register to comment.