See the two pictures below - I have tried to simplify things a few times - 
but nothing seems to change the high error rate, although it might have 
decreased a bit - a few times it has been ~50% (That was when I was trying 
to run my Power HD MG1235 servo on a 7.2V UBEC)


The Xbee and PWM are on different sides of the BBB the only thing in common 
as per the picture below is the GND.


The code below shows the computer side of things to get you an idea of what 
is going on there - I've posted the contents of xbee_tools.py below - not 
that I think there's an issue there - just as FYI.


<https://lh3.googleusercontent.com/-jrLyGwbO61A/Wa02YumrDFI/AAAAAAAARP4/lRP-ha8iGNMwSRvxfcq8rOPcrh9XNaezQCLcBGAs/s1600/helloworlderrors.PNG>

<https://lh3.googleusercontent.com/-FW_lZ-5K6ZM/Wa03WBMdadI/AAAAAAAARQU/dCchFdbxiasnOXfEI9w9QgdNfrmCG-2MQCLcBGAs/s1600/BBB_Xbee_Servo.jpg>

from xbee import XBee
import serial
import cPickle

class xbee_connection:
    def __init__(self, port, baudrate):
        # Start the serial connection
        try:
            self.ser = serial.Serial(port, baudrate)
        except serial.serialutil.SerialException:
            self.ser.close()
            print("Could not start serial connection, ensure that Xbee is 
connected to COM4 port")

        self.xbee = XBee(self.ser)  # Starting XBee connection
        self.msg = ""               # Initializing message as blank
        self.encoded_msg = ""


    def poll_data(self):

        try:
            raw_data = self.xbee.wait_read_frame()
            #print raw_data['rf_data']
            #self.msg = cPickle.loads(raw_data['rf_data'])
            self.msg = raw_data['rf_data']
            #print(self.msg)
            # Ensuring that these values can be converted into floats
        except KeyboardInterrupt:
            self.ser.close()
        except Exception as e: print(e)

        except:
            pass

        return self.msg

    def disconnect(self):
        self.ser.close()




On Monday, September 4, 2017 at 12:35:25 AM UTC+12, Przemek Klosowski wrote:
>
> Could you post a picture or drawing of your physical layout? I think the 
> evidence points to interference from the PWM circuit into the XBee. HOw 
> close physically are they?
>
> On Fri, Sep 1, 2017 at 9:18 PM, <[email protected] <javascript:>> wrote:
>
>> Just tried adding the 1uF decoupling capacitor in parallel with the 
>> existing 0.1uF capacitor - it didn't decrease the high error rate.
>>
>> On Saturday, September 2, 2017 at 12:08:00 PM UTC+12, [email protected] 
>> wrote:
>>>
>>> So tested all of that - see table below
>>> The servo power supply is a QM12V5A 
>>> <https://hobbyking.com/en_us/quanum-12v-5a-7-2-25-2v-dual-output-ubec.html?___store=en_us>
>>>  but 
>>> as seen below - even when this is not active, there is still a high error 
>>> rate.
>>> Also, I am not opening and closing the serial port now - it stays open 
>>> throughout each test. I sent 100 messages for each test. Error rates are an 
>>> approximate guess.
>>>
>>> PWM running      Servo & Servo Power Supply Active     Message Mode     
>>>          Error Rate
>>> Yes                      Yes                                             
>>>            RX-TX on loopback       0% - all good
>>> Yes                      No                                             
>>>             RX-TX on loopback       0% - all good
>>> No                       No                                             
>>>             RX-TX on loopback       0% - all good
>>> Yes                      Yes                                             
>>>            BBB to PC via xbee      10 - 50% - no good
>>> Yes                      No                                             
>>>             BBB to PC via xbee      10 - 50% - no good
>>> No                       No                                             
>>>             BBB to PC via xbee       0% - all good
>>>
>>> I don't really know what to make of it except that the problem seems to 
>>> be somewhere either in the xbee?
>>> The xbee is connected with a 0.1uF decoupling capacitor between +3.3V 
>>> and GND close to the xbee (~25mm length from xbee GND pin thru 0.1uF Cap to 
>>> xbee +3.3V pin)
>>>
>>> I see some people recommend a 1uF decoupling capacitor on the xbee - 
>>> maybe I'll try adding one of those in parallel with the 0.1uF cap.
>>>
>>>
>>> On Friday, September 1, 2017 at 9:22:31 AM UTC+12, Przemek Klosowski 
>>> wrote:
>>>>
>>>>
>>>>
>>>> On Thu, Aug 31, 2017 at 3:13 PM, <[email protected]> wrote:
>>>>
>>>>> Errors : yes garbage characters on the receiver side
>>>>>
>>>>> Cross-talk : so I have had a servo motor (powered from it's own ubec) 
>>>>> plugged in, however I thought that the ubec noise might be interfering, 
>>>>> so 
>>>>> I tried running the PWM signal without any device attached (no servo ubec 
>>>>> running) and no pwm wire plugged into the beaglebone. But still had the 
>>>>> same issue.
>>>>>
>>>> OK--so now can you test by losing the open/close ,disconnecting the 
>>>> XBee and jumpering TX and RX and writing some simple text out and checking 
>>>> that you receive it back correctly, while running PWM. If you see errors, 
>>>> then maybe beaglebone is sensitive to crosstalk; if you don't then the 
>>>> crosstalk must be in the XBee. BTW, suppying the  servo from a separate 
>>>> power supply might not fully prevent interference--it could be kickback 
>>>> from driving the servo.
>>>>
>>>>>
>>>>> --
>>>>> For more options, visit http://beagleboard.org/discuss
>>>>> ---
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "BeagleBoard" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/beagleboard/eabc977d-e1ea-4c07-abf3-6193fe8c2518%40googlegroups.com
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> -- 
>> For more options, visit http://beagleboard.org/discuss
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/a13bf443-af43-4b66-9e7f-6610cb12d95a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/beagleboard/a13bf443-af43-4b66-9e7f-6610cb12d95a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/0991da40-d839-41e0-891e-cc192b270d61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to