Log in

Bekijk de volledige versie : USB and servo motor problem



Mike_Su
27-01-2008, 14:10
Hi,

I'm working on the project involving wl500g (currently I'm running dd-wrt
with 2.4.34-pre2 kernel) , servo motor and a camera.
I've got camera working fine, I've bought servo motor and a controller (http://www.phidgets.com/products.php?product_id=2001,
and basically I wanted to attach my camera to a servo motor.
Actually I've written the software before buying servo phidget, it is a java
applet embeded in a webpage and daemon running on asus, listening for
commands from java applet (like 'rotate left', 'rotate right').
The project is almost finished, but... unfortunately the servo connected to asus doesn't behave well.
If I connect the phidget to my Linux 2.6 PC box (uhci_hcd driver), everything is perfect, I can
control the rotation from my software, everything goes very smoothly.
When it's connected to the asus (uhci driver and usbfs mounted) then servo rotation is very weird, it stops every 0.5 sec and then goes again.
Here is a thread on Phidget's forum:
http://www.phidgets.com/phpBB2/viewtopic.php?t=2093

I'm worrying that it could be the worst scenario - VIA VT6212L bug.
I will appreciate any suggestion. Maybe somebody is running servo connected
to asus without problems? Has anybody tried to run non-stadard usb device using uhci? Maybe you had similar problems?
It's very frustrating to have all software written and not being able to play with the toy because of some obscure bug.

Thanks,
Mike

dyonisos
27-01-2008, 16:21
Why not using a Logitech QuickCam Sphere webcam that has pan-tilt function and therefore no need for extra servo?

Mike_Su
27-01-2008, 19:15
Well, basically I find it much more interesting to build something by myself and
I've got more flexibility (i.e adding another servo, mounting cam on a robot arm etc.)
It was suppose to be just a first, initial project with phidgets.
Many different things can be build using those components (leds, motors, rfid etc.). So far it was fun too.
Debugging low level USB drivers doesn't sound like fun though.

dyonisos
27-01-2008, 22:02
have you tried to rmmod ehci-hcd, maybe it helps?

Mike_Su
28-01-2008, 09:10
Yes, I've unmounted pen drive and removed all other usb modules. I tried uhci and usb-uhci. I checked different usb cable on both asus USB ports. The phidget controller has 4 ports, I tried all of them, with and without external power supply. Probably I have to buy another asus and check kernel 2.6. AFAIK there is no wifi with 2.6 though. I need wifi on my current router so I can't install 2.6 there.

al37919
28-01-2008, 10:35
kernel 2.6.24 has driver b43 which provides support for bcm43xx wl chips
http://forum.openwrt.org/viewtopic.php?id=14251

Mike_Su
28-01-2008, 22:57
Thanks for the information, all I found about 2.6 and wifi was that it isn't stable yet. Probably before installing 2.6 I'll make some tests to rule out threads issues. Phidget library uses threads and libusb has some hacks for threaded applications to work correctly. It is possible that libphidgets, libusb and uclibc thread implementation don't mix together. Probably it's worth to check.

Mike_Su
30-01-2008, 20:06
Problem solved, I wrote simple program that uses only libusb and it's
working 100% properly.
Definitely the problem is with uclibc thread implementation
and/or how libphidget uses threads.
Here's the solution and simple working program:
http://www.phidgets.com/phpBB2/viewtopic.php?t=2093&start=15

Thank you for all responses.