Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Anomalous Interaction
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Forum Index -> ZX-40
Author Message
liam.zbasic



Joined: 25 Mar 2008
Posts: 147
Location: Southern California (Blue)

Posted: 10 January 2012, 9:31 AM    Post subject: Anomalous Interaction Reply with quote

Some weird power interaction is happening between my ZX40n device, Sharp IR range sensors (GP2D12), and a motor driver. I ruled out my ZX program. When the IR sensors output 0.6 volts (~21 inch distance) or less, the following happens:

* PWM frequency to motor driver drops from 20khz to roughly 10khz, +/- 1khz.
* LED indicators connected to ZX40n flash on & off.
* Motor Driver LEDs also flash on & off.
* Power to motors oscillate at same frequency as flashing LEDs.
* IR sensor output voltage drops from 0.6V to approximately 0.5V. If the output is pulled from the ZX40n chip, the voltage returns to 0.6V.

Power supply is fully charged and I just swapped in a new ZX40n device that arrived today - no change. When the IR sensors output more than 0.7V (~17 inches), the system behaves perfectly. Has anyone encountered this?

Thank you.

Liam
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 675

Posted: 10 January 2012, 17:16 PM    Post subject: Reply with quote

Almost certainly the motors are the issue. They can create terrible noise in the electrical system. You can test to see if this is true by removing the power leads to the motors, while leaving everything else unchanged.

You should have a diode to ground on the power lead near the motors to prevent negative voltages inductively created on the power supply .

To add filtering near the ZX, you should have a big electrolytic capacitor and a (few) small ceramic caps. Also, you can improve the filtering a bit by adding a fairly low value resistor (e.g. 1-10 ohms) in the power lead before the filter caps. This will somewhat limit the current spikes to the caps, and improve their filtering. It will also cause a small voltage drop across the resistor. The ZX can probably tolerate a few 10's or 100's of mV drop pretty easily. You can calculate the series resistor value if you know the total current draw of the ZX. For example, if the ZX is going to draw up to 100mA peak, and you want no more than 100mV drop across the current limiter resistor, then the resistance should be (R=V/I) 0.100/0.100 = 1.0 ohm. You can also add a 5.x V zener (for a 5v power supply) between supply and ground. You probably should have a current limiter resistor if you plan on using the zener.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2514
Location: Portland, OR

Posted: 10 January 2012, 18:55 PM    Post subject: Reply with quote

spamiam wrote:
Also, you can improve the filtering a bit by adding a fairly low value resistor (e.g. 1-10 ohms) in the power lead before the filter caps.
Although a resistor is helpful, an inductor is generally better because its DC resistance is very low while its AC resistance (impedance) is higher with higher frequencies. Simply put, it blocks higher frequency AC current but passes DC current.
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 147
Location: Southern California (Blue)

Posted: 10 January 2012, 23:23 PM    Post subject: Reply with quote

I drove home from work to test the motor noise theory. Couldn't wait. The wife was confused. Anyway, sure enough, the anomalous flashing stopped when I disconnected the power to the motors.

I thought I mitigated all noise issues with low-ESR capacitors (1,000uF) at the ZX40n power source and at each IR range sensor (see thread below).

http://www.zbasic.net/forum/about1258.html

My new ground bot is a monster compared to the "gbot" in the thread above and features 21A motors from banebots (RS545). I soldered in their recommended filter capacitors.

I'll add the recommended diodes and inductors discussed here. I'm still confused about noise generated by the motors - at higher duty cycles, there is no issue. The ZX device and motors have separate power sources. The motor driver (VNH2SP30 from pololu.com) power does share the +5V source for the ZX device. Will a new +5V source for the driver solve the problem? How about shielding wires to the motors? To the IR sensors?

Thanks.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2514
Location: Portland, OR

Posted: 11 January 2012, 2:51 AM    Post subject: Reply with quote

liam.zbasic wrote:
The ZX device and motors have separate power sources.
In high current environments, you must be careful to connect the grounds of the two power sources at one and only one point. The high current motor leads need to be kept as far as possible from all digital signals to reduce inductive coupling. Further, it may be helpful to optically isolate the motor control circuitry from the other logic/control circuitry.
Back to top
mikep



Joined: 24 Sep 2005
Posts: 766
Location: Austin, TX

Posted: 11 January 2012, 4:23 AM    Post subject: Reply with quote

liam.zbasic wrote:
...21A motors...
Yep, definitely requires some kind of opto-isolation. You are asking for trouble without it.
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 147
Location: Southern California (Blue)

Posted: 11 January 2012, 8:21 AM    Post subject: Reply with quote

dkinzer wrote:
In high current environments, you must be careful to connect the grounds of the two power sources at one and only one point.

The motor driver module appears to connect the two power grounds. Link below shows Pololu schematic:
http://www.pololu.com/picture/view/0J411

dkinzer wrote:
Further, it may be helpful to optically isolate the motor control circuitry from the other logic/control circuitry.

Are you saying optically isolate the ZX-40n circuitry from the motor driver? I enclosed a block diagram of my project. Notice that the regulated 5V source powers the ZX-40n device, IR range sensors, and motor driver. Not sure where the optical isolator needs to be.



meanbot_block_diagram.png
 Description:

Download
 Filename:  meanbot_block_diagram.png
 Filesize:  425.91 KB
 Downloaded:  138 Time(s)

Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2514
Location: Portland, OR

Posted: 11 January 2012, 15:51 PM    Post subject: Reply with quote

liam.zbasic wrote:
Are you saying optically isolate the ZX-40n circuitry from the motor driver?
Yes. The link below shows a simple example of PWM optically coupled to a motor driver.
http://hades.mech.northwestern.edu/index.php/Using_Opto-Isolators_to_Prevent_Interference

If you search using "optoisolator" and "motor" you'll get several interesting hits including the wikipedia page on opto-isolators in general.
http://en.wikipedia.org/wiki/Opto-isolator
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 147
Location: Southern California (Blue)

Posted: 11 January 2012, 18:25 PM    Post subject: Reply with quote

Yes, I learned about the isolators in the "smiley's micro" articles in Nuts-and-Volts. I figured my $59.95 motor driver provided enough isolation.

Is it adequate to isolate the ZX-40n PWM signals, or do I also need to isolate the logic channels (2 per motor) that control motor direction?

I'm a bit concerned about my 20khz PWM frequency and the ability of the opto-isolator to respond. We'll see what the specs say.

Thank you.
Back to top
mikep



Joined: 24 Sep 2005
Posts: 766
Location: Austin, TX

Posted: 12 January 2012, 2:23 AM    Post subject: Reply with quote

liam.zbasic wrote:
Are you saying optically isolate the ZX-40n circuitry from the motor driver?

Is it adequate to isolate the ZX-40n PWM signals, or do I also need to isolate the logic channels (2 per motor) that control motor direction?
ALL signals to and from the motor controller should be isolated. Here are some schematics from a project I did some time ago: http://home.roadrunner.com/~perks/micros/Projects/Motor_Controller/Motor_Controller.htm#_Toc111813262 . You might want to read the whole writeup when you have some time.[/quote]
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 675

Posted: 12 January 2012, 15:32 PM    Post subject: Reply with quote

liam.zbasic wrote:
Yes, I learned about the isolators in the "smiley's micro" articles in Nuts-and-Volts. I figured my $59.95 motor driver provided enough isolation.

Is it adequate to isolate the ZX-40n PWM signals, or do I also need to isolate the logic channels (2 per motor) that control motor direction?

I'm a bit concerned about my 20khz PWM frequency and the ability of the opto-isolator to respond. We'll see what the specs say.

Thank you.


It is best to isolate all connections between the ZX and the motor controller/motors. So, you should probably isolate the logic signals too.

Then there is the issue of power and ground. This could be solved by having a separate power supply for the ZX so it does not get power spikes and brown out from the motors. You always have to be careful of ground loops too.

-Tony
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 147
Location: Southern California (Blue)

Posted: 12 January 2012, 19:48 PM    Post subject: Reply with quote

So I'm completely optoisolating the ZX device from the motor driver and each will have separate power supplies. The grounding for each should remain separate, correct? And I suppose the power to the optoisolator for the phototransistors should originate from the motor driver power.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2514
Location: Portland, OR

Posted: 12 January 2012, 21:05 PM    Post subject: Reply with quote

liam.zbasic wrote:
The grounding for each should remain separate, correct?
Yes. The [i]only[/] connection between the two sides is photons - that's the advantage of opto-isolation.
liam.zbasic wrote:
And I suppose the power to the optoisolator for the phototransistors should originate from the motor driver power.
Indeed. Each side provides the power for its part of the LED/photo transistor pair.
Back to top
DocJC



Joined: 16 Mar 2006
Posts: 84
Location: Cleveland, OH

Posted: 13 January 2012, 2:29 AM    Post subject: Reply with quote

It seems that everyone is assuming that it is noise coupled back tothe uC that is causing the problem, but without a scope this is difficult to determine with certainty.

Just for the record it would be nice to know what the Brown Out Detector Fuse is set to.

Your system is oscillating at 10kHz. If the motors draw too much current for your power supply to provide the voltage will drop, whcih could trip the brown out detector, reset the uC, re-measure the IR sensor, re-turn on the motors, once again drawing too much current...

JC
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 675

Posted: 13 January 2012, 2:56 AM    Post subject: Reply with quote

DocJC wrote:
It seems that everyone is assuming that it is noise coupled back tothe uC that is causing the problem, but without a scope this is difficult to determine with certainty.

Just for the record it would be nice to know what the Brown Out Detector Fuse is set to.

Your system is oscillating at 10kHz. If the motors draw too much current for your power supply to provide the voltage will drop, whcih could trip the brown out detector, reset the uC, re-measure the IR sensor, re-turn on the motors, once again drawing too much current...

JC


It crossed my mind that the motors were causing brown-out, but I thought that it was unlikely that the ZX would reboot at 10KHz....

-Tony
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-40 Time synchro. with the server - Timezone/DST with your computer
Goto page 1, 2  Next
Page 1 of 2

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group