I just got my third EZB board installed in the brain of my B9 and hooked up to everything. On it's own it works great and I thought everything was going nice when I noticed a problem with the scripts I wrote in EZ Script. They were not running perfectly like before. The scripts effected when I connect to ANY board as the 3rd board are mainly the ones that get ADC values from Potentiometers that send back position feedback. I use this info to tell the script to stop the motor when a set variable is reached. (I use an H-bridge and DC motor to turn the waist and radar section that's mounted on a Lazy Susan and gear sets).
Before I was able to have the waist or radar section rotate and stop pretty much spot on my set variable and read from the pot. Now when I connect to any board as the 3rd board the rotation will shoot way past my set value or even seem to ignore it. The result is that the rotation till either go past and hit my limit switches or if it's trying to find center it will just rock back and forth till I stop it.
I don't know if my computer is to slow to handle 3 board connections, there is a problem with the Bluetooth connection or there is a bug in the software. Oddly, everything works great till I connect to a third EZB board. Then EZ Builder seems to have trouble seeing the ACD value till it's too last and the reading is past my set variable.
I hope this makes sense. I'll attach a copy of my project and a video. Any input or help is welcomed.
B9 Robot Project:
Here's the vid. It's over 8 min. Hope it's not too long:
I got a email from a fellow robot geek and he suggested installing a second bluetooth reciver (Dongle) in the laptop USB port and connecting the third EZB board to it. He said that Bluetooth is slow and I may be asking too much of it.
Has anyone got any insight on this? I wasnt awear I could run two bluetooth devices on one computer runnung Win 7. Even if I could, can I connect to different EZB boards within EZ Builder and two different bluetooth devices and have EZ Builder controll the boards?
I just tested 2 bluetooth dongles in one PC and had no luck. I am assuming it's a conflict with the BT stack.
You could, in theory, use two different bt stacks (MS and Widcomm).
There would be no problem with EZ-Builder. A com port is a com port at the end of the day, if EZ-Builder can connect to it and it goes to the right place (i.e. goes to the correct bt device) it will be fine.
Have you considered changing the BT to WiFi or USB?
Thanks for the test Rich. I had a feeling you would jump into this with me.
I need to do something because I cant control any stop points on the radius. It's a little annoying when I only want my waist to move a few inches and it flies past that point and slams into my stop block and it's limit switch. Thank goodness for those. I understand WiFi but not sure I want to rely on my home router and I've been reading about the problems others are having with WiFi. I dont understand USB. How would that work? Wouldn't I need to have the EZB plugged directly into the laptop?
My fall back potion is to just remove the 3rd EZB from the brain and run wires down into the torso to that EZB. I really dont want to go from 2 wires running down his neck pipe to 7. I'd like to avoid that with all the rotating and bobing the bubble area will be doing.
The EZB boards are all working properly. It just seems I have a lag somewhere and EZ Builder isnt getting the feedback info fast enough from the pots. Unless there is a bug in EZ Builder it's self. I just dont know why everything works great with two boards but starts to lag when I connect to the third board.
Yes USB would mean connecting the EZB direct to the laptop, I was unsure if it had an on-board PC.
You could try 2 BT dongles and attempt to use a different stack, I did a quick google on it and there are reports of MS and Widcomm stacks both working together and allowing 2 dongles. Not sure if it would solve the problem but if it is a communications issue then chances are it would, but you would be using a stack that's not supported.
I just did a benchmark on my EZB and it can read ADC 25 times per second. So basically it can read the feedback of 25 ADC ports once per second, if you only have 5 then it's 5 times a second, or each one once every 200ms. The first thing I would do is work out if you are going over your maximum reads/second (run your own benchmark, it may be different to mine). If you aren't then it's not going to be the communication between the two. If you are then you will need to look in to a different route in to the PC (WiFi/USB/another BT dongle and some messing around getting it working).
Benchmark is under General in controls.
Thanks again Rich! At least now I have some place to start. I had planned on installing a mini mother board into my robot at some point. Maybe now's the time to do that. Anyway I'm going to start by trying your other suggestions first and see which 1 works out best. I'll keep you posted.
Well, I've made progress and success but still unsure what the exact problem is. I moved my project over to another laptop to see if the trouble with not stopping at my specified values continued on it. To my surprise everything worked great. All the scripts run nice, the rotation of both my waist and radar rotate smoothly and stop at the point I entered. So as I suspected EZ Builder has no problems and the problem rests somewhere in my laptop.
So, what could be causing the problems? Both duel core CPU laptops are close to the same in most ways and were bought around 2007. The one causeing the problems is a Dell with built in Bluetooth and a clean install of Win 7 and the one that runs EZ Builder and my robot smoothly is a Gateway running Win 7 that I've been using for years loaded with all my stuff. I have to use a Bluetooth Dongle on the good running Gateway. When I installed each of the EZB Boards as a device in the Add Bluetooth Device section I noticed the 3 com ports were assigned a lot higher then on the Dell. On the sluggish Dell they were Com4,6 & 8. On the nicely working Gateway they are Com7, 9 & 11. I cant see any other differences. Any ideas?
Something else that may be of interest; Rich had mentioned above that he got 25 reads on his ADC benchmark. I also got that reading when I had only 1 or 2 boards connected. When I connected the 3rd board thatreading dropped down to 6! Ouch.
It sounds like the difference between Bluetooth antennas. One has a higher bandwidth and support for more devices. Sounds like the Bluetooth Dongle is helping.
Perhaps disable your Bluetooth on the slow performing computer and add the USB dongle in replacement
Need to verify but I suspect that the PC with bluetooth built-in will be a class 2 bluetooth.
I'll check that on the laptop and the Dongle. If your correct then class 2 is more powerful. Here's the power ratings:
100mW (20dBm) / 100 meters
2.5mW (4dBm) / 10 meters
1mW (0dBm) / 1 meter
Still it seems there's a bottleneck somewhere in the laptop with the built-in Bluetooth. I'll do some more testing today. Thanks guys.