Pages: [1]   Go Down
Author Topic: How can i control my Pan Tilt Pod 5 metres along from my PC  (Read 1226 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi bro,
I'm a beginneer in electronic design and i've just already build my tiny project with arduino :

Pan-Tilt Servo motor <---------> Arduino <----------> PC

My problem is like in this thread
http://arduino.cc/forum/index.php/topic,96227.0.html

So i want to remote control the Pan-Tilt Pod from my PC , with 5 metres length USB cable from my PC to Arduino board.
Could i use the USB cable to lengthen the Pan-Tilt Pod. Or is there any other solution ?

Please help me , thanks u so much smiley
« Last Edit: March 13, 2012, 08:47:35 pm by duc_bkav » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48569
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So i want to remote control the Pan-Tilt Pod from my PC , with 5 metres length USB cable from my PC to Arduino board.
Quote
How can i control my Pan Tilt Pod 10 metres along from my PC
I'm not sure how a 5 meter cable is going to stretch to 10 meters...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So i want to remote control the Pan-Tilt Pod from my PC , with 5 metres length USB cable from my PC to Arduino board.
Quote
How can i control my Pan Tilt Pod 10 metres along from my PC
I'm not sure how a 5 meter cable is going to stretch to 10 meters...
Sorry bro,
really i'm using a 5m USB cable for my project, but each time i try to control my Pan Tilt Pod, the system has disconnected /dev/ttyACM0 and register a new /dev/ttyACM1 ...
the dmesg is looked like below:

Mar 13 16:37:36 Chicken kernel: usb 4-1: USB disconnect, address 66
Mar 13 16:37:37 Chicken kernel: usb 4-1: new full speed USB device using uhci_hcd and address 67
Mar 13 16:37:37 Chicken kernel: usb 4-1: New USB device found, idVendor=2341, idProduct=0043
Mar 13 16:37:37 Chicken kernel: usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
Mar 13 16:37:37 Chicken kernel: usb 4-1: Manufacturer: Arduino (www.arduino.cc)
Mar 13 16:37:37 Chicken kernel: usb 4-1: SerialNumber: 74937303936351512230
Mar 13 16:37:37 Chicken kernel: usb 4-1: configuration #1 chosen from 1 choice
Mar 13 16:37:37 Chicken kernel: cdc_acm 4-1:1.0: ttyACM1: USB ACM device


Could you tell me what is my problem here ?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48569
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Could you tell me what is my problem here ?
Must be the blue shirt you are wearing. Try a green one.

See, that answer makes as little sense as your question. Not that there is a problem with the question, but there is absolutely no context for it, and it is completely unrelated to how to use a 5 meter cable to stretch 10 meters.

What operating system are you using? Clearly, it isn't windows.
What application are you trying to use to talk to the serial port?
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Instead of a long run of USB cable, you should try the long run of wire using regular wire between the arduino and servos. I've used cat3 four conductor wire to control servos at a distance. One conductor for common ground, one conductor for servo power, and the remaining two wires for the servo PPM control signals.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Could you tell me what is my problem here ?
Must be the blue shirt you are wearing. Try a green one.

See, that answer makes as little sense as your question. Not that there is a problem with the question, but there is absolutely no context for it, and it is completely unrelated to how to use a 5 meter cable to stretch 10 meters.

What operating system are you using? Clearly, it isn't windows.
What application are you trying to use to talk to the serial port?
Thanks Pauls, sorry for my missing,
i'm using CentOS 6 and using qextserialport class in Qt to talk to the serial port.

Here is a part of my code in Qt (just do as some guide on the internet)
void ControlWidget::initPanTilt()
{
    port = new QextSerialPort("/dev/ttyACM0");
    port->setBaudRate(BAUD9600);
    port->setFlowControl(FLOW_OFF);
    port->setParity(PAR_NONE);
    port->setDataBits(DATA_8);
    port->setStopBits(STOP_2);

    if (port->open(QIODevice::ReadWrite))
    {
        cerr << "Opened ttyACM0" << endl;
    }
}


void ControlWidget::PanLeft()
{
    if (*panPos >= 0x05)
    {
        *panPos = *panPos - 0x05;
    }
    else
    {
        *panPos = 0x00;
    }
    writePanTilt();
}

void ControlWidget::PanRight()
{
    if (*panPos <= 0xaf)
    {
        *panPos = *panPos + 0x05;
    }
    else
    {
        *panPos = 0xb4;
    }
    writePanTilt();
}

void ControlWidget::TiltDown()
{
    if (*tiltPos >= 0xba)
    {
        *tiltPos = *tiltPos - 0x05;
    }
    else
    {
        *tiltPos = 0xb5;
    }
    writePanTilt();
}

void ControlWidget::TiltUp()
{
    if (*tiltPos <= 0xf5)
    {
        *tiltPos = *tiltPos + 0x05;
    }
    else
    {
        *tiltPos = 0xfa;
    }
    writePanTilt();
}

void ControlWidget::writePanTilt()
{
    if (port->isOpen())
    {
        port->write(reinterpret_cast < const char* >(panPos), 1);
        port->write(reinterpret_cast < const char* >(tiltPos), 1);
        port->flush();
    }
}



everything work fines with the 1m usb cable but when i try to use 5m usb cable, the problem is same as i've describe before.
Is it the problem with length of the cable ?   

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Instead of a long run of USB cable, you should try the long run of wire using regular wire between the arduino and servos. I've used cat3 four conductor wire to control servos at a distance. One conductor for common ground, one conductor for servo power, and the remaining two wires for the servo PPM control signals.

Hi zoomkat,
i also thinked  as same as what you're thinking but my problem is:
this Pan-Tilt Pod is used for bear a USB camera. This camera i've used 5m cable to extend already.
And i want to anchor the Arduino with the Pan-Tilt Pod, finally i have to use 2 5m USB cable for my PTZ camera system smiley-grin.
If i use ethernet cable for extend the length between Servo and Arduino, my system becomes distributed, one end have Servo+USB Camera, one end have Arduino , also 2 cable type (USB + CAT)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've just try to use 3m USB cable but the problem is still appear.. May be i have to try an anti-noise USB cable smiley-sad
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you powering everything?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you powering everything?

The Arduino UNO is powered via USB cable only . I've check that the Vcc is about 7.5V. Is there a problem here
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48569
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Arduino UNO is powered via USB cable only . I've check that the Vcc is about 7.5V. Is there a problem here
The USB voltage is supposed to be 5.0. If you are getting more than that anywhere, yes, there is a problem.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Arduino UNO is powered via USB cable only . I've check that the Vcc is about 7.5V. Is there a problem here
The USB voltage is supposed to be 5.0. If you are getting more than that anywhere, yes, there is a problem.
Thanks everybody,
i've found the solution for my problem:
Quote
I've check that the Vcc is about 7.5V
Sorry for my missing, it isn't 7.5V for my USB port, just because the error of the volt meter. Use anther voltmeter , it is 5V normally.

After that, i've used the 12V-2A external power for Arduino Uno board. and everythig work fine .

In conclusion, it is the Power problem
Logged

Pages: [1]   Go Up
Jump to: