Page 25 of 25 FirstFirst ... 152122232425
Results 241 to 245 of 245

Thread: PhantomX controlled by a Raspberry Pi

  1. Re: PhantomX controlled by a Raspberry Pi

    The power supply is stable and doesn't gives any problem.

    The same, for data, if it were possible an easier connection it's ok, but now I solved in this way.

    I tried with ttl logic converter but without results, maybe I don’t understand how it works

    Click image for larger version. 

Name:	wiring phantom-x.jpg 
Views:	147 
Size:	78.2 KB 
ID:	7302Click image for larger version. 

Name:	IMG_20180828_121720.jpg 
Views:	143 
Size:	113.0 KB 
ID:	7303Click image for larger version. 

Name:	IMG_20180828_121730.jpg 
Views:	119 
Size:	113.2 KB 
ID:	7304Click image for larger version. 

Name:	IMG_20180828_121803.jpg 
Views:	121 
Size:	93.8 KB 
ID:	7305

    So recently I've tested a little program wrote in php code uploaded on Rpi, who switch on/off some led fixed on the arduino board.

    With the web page write in php, the corresponding commands, they shall be directed to usb in order to switch on the led.

    now I think that it's necessary to rewrite the sketch commander like I explained before, in order to redirect the commands to usb were is linked Arbotix-m or maybe it's possible to wire the geekduino with the sketch commander on the rpi.

    So the latter have to redirect the signals from geekduino to arbotix-m.
    Last edited by minimalfra; 08-28-2018 at 04:44 PM.

  2. Re: PhantomX controlled by a Raspberry Pi

    Click image for larger version. 

Name:	wiring con ttl.jpg 
Views:	136 
Size:	76.3 KB 
ID:	7310
    About the ttl logic converter, this is the wiring that I tried, but test the ttyAMA0 on raspberry, there's no signal coming from Arbotix.

    Can you explain how to use OpenCM9.04 in this project?

  3. #243

    Re: PhantomX controlled by a Raspberry Pi

    OpenCM board, just plug it into the RPI board, it will show up something like /dev/ttyAMA0
    Which you can open up and communicate.

    Depending on wjat upir needs/desires for the board. You could run a real real simple program on the OpenCM board that communicates with whatever servos you have connected to it...

    Example:
    Code:
    #include <DynamixelSDK.h>
    //====================================================================================================
    // Really basic Servo Controller... 
    // This version for Robotis OpenCM9.04
    //====================================================================================================
    //=============================================================================
    // Options...
    //=============================================================================
    #define BAUDRATE                        1000000
    #define DEVICENAME                      "3"                 //DEVICENAME "1" -> Serial1(OpenCM9.04 DXL TTL Ports)
    #define BUFFER_SIZE   64
    //=============================================================================
    // Globals
    //=============================================================================
    dynamixel::PortHandler *portHandler = dynamixel::PortHandler::getPortHandler(DEVICENAME);
    uint8_t buffer[BUFFER_SIZE];
    int led_state = LOW;
    
    //====================================================================================================
    // Setup
    //====================================================================================================
    void setup() {
      pinMode(BOARD_LED_PIN, OUTPUT);
    
      Serial.begin(115200); // actual speed does not matter USB
    
      // Open Port handler
      portHandler = dynamixel::PortHandler::getPortHandler(DEVICENAME);
      if (!portHandler->openPort()) signal_abort(1);
      if (!portHandler->setBaudRate(BAUDRATE)) signal_abort(2);
    }
    
    //====================================================================================================
    // loop
    //====================================================================================================
    void loop() {
      bool did_something = false;
      int cb;
      // First forward anything received from DXL
      cb = portHandler->readPort(buffer, BUFFER_SIZE);
      if (cb > 0) {
        Serial.write(buffer, cb);  
        did_something = true;
      }
    
      // Now forward anything received on USB to DXL
      cb = 0;
      while (Serial.available()) {
        buffer[cb++] = Serial.read();
      }
      if (cb) {
        portHandler->writePort(buffer, cb);  
        did_something = true;
      }
      if (did_something) {
        led_state = led_state? LOW : HIGH;
        digitalWrite(BOARD_LED_PIN, led_state);
      }
      
    }
    
    
    //====================================================================================================
    // Signal_Abort - Fatal error,  show blink pattern of error number...
    //====================================================================================================
    void signal_abort(uint8_t error) {
      for (;;) {
        for (uint8_t i = 0; i < error; i++) {
          digitalWrite(BOARD_LED_PIN, HIGH);
          delay(100);
          digitalWrite(BOARD_LED_PIN, LOW);
          delay(100);
        }
        delay(500);
      }
    }
    I was then able to use Robotis DynamixelSDK on my UP board and compile their dxl_monitor program and was able to detect the three servos I had connected.

    How you connect servos up, depends. The test case I did this morning was with one of their RS485 expansion boards that also has AX like servo connectors. I have also used the 904A board and soldered in those type of connectors. In that case I use one of the Trossen DXL powered hubs to handle the power...

    As for your current setup and not seeing anything...
    Have you figured out where the problem is? That is have you configured the UART on the expansion port to be available and there is no debug monitor running on it and baud rate is set to match what you have on Arbotix...

    Again not sure what all you are asking here?

  4. Re: PhantomX controlled by a Raspberry Pi

    I configured minicom with these parameters: Serial device: /dev/ttyAMA0 and baud rate 38400, but the serial monitor is mute. Anyway, this is a secondary problem.

    I would send the signal from commander to arbotix through the raspberry. In order to do this, it's necessary to link the two boards to the raspberry and send the signal from a port to the other one, or is it possible to eliminate the geekduino board and rewrite the sketch commander to upload it directly on the raspberry?

  5. #245

    Re: PhantomX controlled by a Raspberry Pi

    I am sorry, I don't fully understand your question:

    First to configuring RPI to do Serial communications using the expansion connector. Some of this depends on which RPI you have. For example RPI3, the /dev/TTYAMA0 device I believe defaults to the Bluetooth onboard... and /dev/TTYS0 is the expansion connector...

    Again it is easiest to do a net search to configure...

    Example web page: https://hallard.me/enable-serial-port-on-raspberry-pi/

    I don't know which Geekduino board? I have never used one... What I have done in the past is to simply connect the XBEE up to the RPI, with something simple like: https://www.sparkfun.com/products/11812
    Which simply plugs into USB of RPI... It will create a /dev/ttyUSBn object...

    Then depending on how you wish to connect the Arbotix to RPI... Expansion connector (through level shifter) or simple FTDI cable (or other USB to serial adapter). again will create another /dev/ttyUSBx object... Note: In my code I would then typically setup to use udev rules to create an alias for each them as to not randomly use one or the other...
    Example create one /dev/ttyDXL for whatever actual device I have hooked up to have my code base output data to the servos...
    Likewise maybe create another one like /dev/ttyXBEE for the actual XBee.

    Again how I did some of this is in my random notes (Readme) of my Raspberry_pi project in the section: Setup tty Device on RPI

    But again your millage may differ.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Raspberry Pi
    By Robonaut in forum Robot Computers
    Replies: 20
    Last Post: 07-07-2013, 11:46 AM
  2. Raspberry Pi Camera coming soon
    By sarendt in forum Robotics General Discussion
    Replies: 1
    Last Post: 03-16-2013, 11:15 PM
  3. About to give up on the Raspberry Pi
    By jwatte in forum Software and Programming
    Replies: 5
    Last Post: 01-14-2013, 11:57 AM
  4. Just For Fun My Raspberry PI
    By rebel in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 12-31-2012, 06:57 PM
  5. For learning: PhantomX Hexapod vs PhantomX Quadruped
    By Leugim in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-26-2012, 09:50 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •