View previous topic :: View next topic |
Author |
Message |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
freeze dspic brushless drive |
Posted: Sun Oct 23, 2016 5:39 pm |
|
|
hi
I'm using 4 dspic33fj256gp506 to control 4 brushless motor in one pcb(when i use 4 esc in separated pcb im not problem and it work very well in heavy load until 20 amp)..each unit have separated supply with 1117 3.3 volt and 10 uf cap for supply and 470 nf for vdd vss of each micro...when i start the one of the motor other 3 dspic go to freeze and i should off and on main supply..
I mentioned this point that i test with internal 7.37 mhz osc but again freeze.
I believe the problem happens when the motor is starting up, though I can't detect any noise on the PIC's regulated supply line with my 'scope.
Does anyone have any ideas on what is causing the freeze, and more importantly what I should do to fix it?
My source is blinking a led.
freq 50 mhz
tnx |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Sun Oct 23, 2016 10:05 pm |
|
|
How many layers on your PCB? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19366
|
|
Posted: Mon Oct 24, 2016 12:46 am |
|
|
What is being used to trap overshoot?.
Unless your scope is very fast, and is syncronised to catch a spike and hold it, it is very easy for noise from edges to be invisible. It looks as if a lot of power stuff, may actually run 'past' the PIC's. Newguy's question is important. How the power gets from the incoming connection to the motor feeds?. What path's the current can take, and what lines this can induce voltages in.....
The PIC may well be able to give you some diagnostics. You can modify the code, to record the reset cause, or add trapping for things like power fail, and then see 'why' the chips are doing what they do.
One thing I'm very suspicious of. Are the four connectors on the centre of the edges of the board, for ICD/programming?. What pull-ups are you using on the MCLR lines?. Do you have a jumper for this connection?. Does it have any capacitor?.
Have a look at this thread:
<http://www.microchip.com/forums/m724234.aspx>
In particular the third entry down, from 'Oblig'. Then read the Microchip advisories on ICD connections. The simple 'pull up resistor' on MCLR, is _not_ even remotely suitable in environments with significant electrical noise. If these are ICD connections, it even appears as if two of these may route directly 'across' power rails to the motors. Ugh.... |
|
![](templates/subSilver/images/spacer.gif) |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
|
Posted: Mon Oct 24, 2016 1:49 am |
|
|
newguy wrote: | How many layers on your PCB? |
2 layer..The first layer for dsp chip and second layer for the mosfet
![](http://s8.picofile.com/file/8272025592/llll.png) |
|
![](templates/subSilver/images/spacer.gif) |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
|
Posted: Mon Oct 24, 2016 2:18 am |
|
|
Ttelmah wrote: |
One thing I'm very suspicious of. Are the four connectors on the centre of the edges of the board, for ICD/programming?. What pull-ups are you using on the MCLR lines?. Do you have a jumper for this connection?. Does it have any capacitor?.
|
mini usb connector?yes..for icd prog...for mclr pin i use 2.2 k...i use via from mclr pin to usb connector..yes..470 nf
Ttelmah wrote: | In particular the third entry down, from 'Oblig'. Then read the Microchip advisories on ICD connections. The simple 'pull up resistor' on MCLR, is _not_ even remotely suitable in environments with significant electrical noise. If these are ICD connections, it even appears as if two of these may route directly 'across' power rails to the motors. Ugh.... |
yes..thats right...but 4 dsp in the same condition, the first micro work very well and other micro freeze..i design one schematic and copy past it...That's why I say 4 pic in same condition...i have no problem in single pcb for each driver with this design
thank a alot |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19366
|
|
Posted: Mon Oct 24, 2016 3:00 am |
|
|
Think about it.
You don't have four micros in 'the same condition'. The other three are _idle_. Their drives are off, with no load connections actually being enabled to the motors. Very different potentially.
Generally I'd be worried about the currents inducing voltages in the tracks on the top of the board. This is where a ground plane on an internal layer can help. I'd try monitoring the MCLR line (though there is often a problem that scope leads can affect signals massively...). My suspicion is that you are getting spikes on the MCLR line sufficient to take the PICs out of their 'normal running' state. |
|
![](templates/subSilver/images/spacer.gif) |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
|
Posted: Mon Oct 24, 2016 4:21 am |
|
|
Ttelmah wrote: | Think about it.
You don't have four micros in 'the same condition'. The other three are _idle_. Their drives are off, with no load connections actually being enabled to the motors. Very different potentially.
Generally I'd be worried about the currents inducing voltages in the tracks on the top of the board. This is where a ground plane on an internal layer can help. I'd try monitoring the MCLR line (though there is often a problem that scope leads can affect signals massively...). My suspicion is that you are getting spikes on the MCLR line sufficient to take the PICs out of their 'normal running' state. |
tnx for fast reply...i cut the mclr ,pgc and pgd track from front of micro and the usb icd connector Out of reach but again freez...
Ttelmah wrote: | Generally I'd be worried about the currents inducing voltages in the tracks on the top of the board. . |
thats right but why the first pic no freeze or reset and motor rotating 10000 rpm?
One another point..i design flight board with dsp micro that work with 80mhz clock speed..this board supplied from esc pcb but it work properly..
I am confused ![Shocked](images/smiles/icon_eek.gif) |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Mon Oct 24, 2016 5:24 am |
|
|
Since I don't use that PIC I can't comment on code but I used to design/build PCB in one of my 'day jobs' so...
Looking at the pictures I see a lot of design 'concerns', like overall layout, trace width, tracks too close to mtg circles, etc. Since you're drawing a LOT of power (high level currents), you need to have proper PCB layout, something generally not taught at school. All high power PCB should either have 2oz CU or 3 layers, a proper ground plane, LOTS of bypass caps,wide power tracks, etc.
Overall, I would have kept the 4 PCB design. Well really 8, a 'motherboard' with the logic and a 'daughterboard', the actual MOSFETS. One...you said it worked, Two..far easier to make..Three..EASY to replace a single faulty channel Four..simpler wiring, layout, etc.
I used this method for over 2 decades with my remote energy control systems. It allows a common 'logic' board to have upgraded 'power' boards simply by replacing them.
Jay |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Mon Oct 24, 2016 6:25 am |
|
|
You've taught yourself an important lesson regarding PCB layout; specifically what not to do in future.
- What you're doing pretty much requires a 4 layer board: signal, gnd, Vcc, signal.
- As has been pointed out by someone else: you either need heavy copper layers with the trace widths you now have or wider traces with a standard 1oz copper process.
- Don't ever route power or motor traces anywhere even remotely close to processors or ICD lines. This includes on the opposite side of the same board.
- Capacitors are your friends. If you find yourself asking "surely these are too many capacitors for this design?", you're probably approaching a safe minimum.
- A cheap AM radio is a very effective troubleshooting tool when it comes to EMI. Tune the radio to no channel (just static) and listen for changes when you turn on your circuit. The more EMI, the louder your radio. Your goal is a quiet circuit. Remember that EMI cuts both ways: A loud circuit is often a "super listener" and is thus also susceptible to nearby EMI. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19366
|
|
Posted: Mon Oct 24, 2016 7:22 am |
|
|
The other thing I disliked, was the square corners on the main power rails. Funnily lots of the low power signals have nice diagonals, but 90 degree corners on rails carrying high power, with fast switching, is a lovely way of radiating RF....
In fact low speed signals (90% of standard signals), couldn't care at all about sharp corners, but anything 'fast' (few MHz plus), or anything carry high power switching which can have switching transients, you get reflections, and radiation. Also a huge amount of the physical trace width is not actually going to be carrying any current in several places on the board.... |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Mon Oct 24, 2016 7:44 am |
|
|
That's because he routed his signal lines but when it came to power he used a fill instead. At least he recognized that he needed more copper to handle the current, but he missed the mark regarding EMI.
When it comes to EMI/radiation, think of the traces as troughs of water. You want "smooth plumbing" - you want the flow to be orderly (laminar) - smooth transitions, smooth direction changes. At high frequencies, you're not so much routing current as you are guiding waves. If you have two eavestroughs connecting at a right angle, as the water flows from one to the other, it becomes very likely that some will slop over the side at the transition. In the EMI world, that transition will radiate.
...And I didn't even touch on the ground loop issue. |
|
![](templates/subSilver/images/spacer.gif) |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
|
Posted: Mon Oct 24, 2016 8:25 am |
|
|
tnx for reply my friends..I totally agree with your comments but Many things has me confusing..
1.from 4 pic in pcb always one micro work very well..why?..if EMI noise Involved 3 pic and Causes freeze them why the first pic work properly without any problem?this is my question..
2.this is my old single esc pcb...it work very well ..my quadrotor fly with it and no problem....When I see these things i am confused that The problem is in my design or elsewhere? ...I'm sure that my source is no problem and work
i support the power track with 3 mm copper wire
In the past month i design 3 pcb but i dont know What is wrong
tnx alot |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Mon Oct 24, 2016 9:02 am |
|
|
Have you tried running just one of the other 3 processors as well? Does that make a difference in the other 3 (idle) processors and their behaviour?
It's entirely possible that the processor that's running the motor is also resetting but you're not seeing the reset. Change your startup code to flash an LED (or all LEDs connected to the processor) in a distinct fashion. Every project I write flashes all LEDs on for 200ms then off for 200ms before the main while() loop of the program is allowed to start. If you have such a powerup pattern before the heartbeat is allowed to start, processor resets are easy to spot (in the absence of a serial port or some other communication port to each processor). |
|
![](templates/subSilver/images/spacer.gif) |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
|
Posted: Mon Oct 24, 2016 9:54 am |
|
|
newguy wrote: | Have you tried running just one of the other 3 processors as well? Does that make a difference in the other 3 (idle) processors and their behaviour?
It's entirely possible that the processor that's running the motor is also resetting but you're not seeing the reset. Change your startup code to flash an LED (or all LEDs connected to the processor) in a distinct fashion. Every project I write flashes all LEDs on for 200ms then off for 200ms before the main while() loop of the program is allowed to start. If you have such a powerup pattern before the heartbeat is allowed to start, processor resets are easy to spot (in the absence of a serial port or some other communication port to each processor). |
Looks good...I'll check and answer |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Mon Oct 24, 2016 11:22 am |
|
|
EMI can be very,very frustrating. On the new PCB, you have a LOT more 'wires' or traces and that allows for MORE EMI. As to which PIC freezes and which runs, it's anyone's guess. The smaller board, is well, smaller and the layout different so less potential problem with EMI. On one system I had 'crosstalk' on the data channel(preInternet..)that only showed up between 2 and 3 AM on Sundays. THAT turned out to be a bank transferring data on their phone line which was next to mine...
Also external wiring plays an important role. EVERY wire is an antenna. Given the right frequency, it can send the EMI to the PIC. Good RF practice dictates that EVERY I/O connection of the PCB be properly terminated to reduce any unwanted signal from getting to the PIC( and support chips).This can include caps, chokes, resistors,ferrite beads..whatever it takes to get the board 'quiet'.
In my early life as a tech, I designed 32 channel,16bit PMT acquistion interfaces that were mounted IN ARL optical emmission spectrometers. Think of them as 25KV several hundreds of ma RF EMI generators! Proper design allowed for 1mv resolution,which back in 77 was GREAT !
Jay |
|
![](templates/subSilver/images/spacer.gif) |
|