G15 Cube Servo and ioio

LINIX Brushless, VEXTA Brushless, RC Servo, DC Geared, Linear, Stepper, Tamiya.....

G15 Cube Servo and ioio

Postby zargoun » Sun Apr 13, 2014 10:19 am

im tring to control the G15 servo using IOIO board,
i have done a code to send the data packets to the G15. However the motor doesn't response at all.
i have connected the ioio board to computer throw hypertirmenal to check the data, the was sent by IOIO board perfectly

the question is "if i sent data packets just like in the user manual, is that should move the motor or not ?"

CODE: SELECT_ALL_CODE
 int availableBytes = 0;
  try{
   DTR.write(tx);
    try {
     
          out.write(0xFF);                          //the library waits for transfer complete, output.flush() is called
         out.write(0xFF);
         out.write(0x01);
         out.write(0x07);
         out.write(0x03);
         out.write(0x1E);
         out.write(0x20);
         out.write(0x02);
         out.write(0x47);
         out.write(0x02);
         out.write(0x6C);
         
         delay(20);
     
     
       
    }
    catch (IOException e){
    }
   
    DTR.write(rx);
    try{
    availableBytes = in.available();
     println(availableBytes);
    if (availableBytes > 0 && bufferOffset + availableBytes < readBuffer.length)
        {               
          try
          {
             
            bufRd.read(readBuffer, bufferOffset, availableBytes);
          }
          catch (IOException e)
          {
            e.printStackTrace();
          }
}
    } catch (IOException e) {}
  } catch (ConnectionLostException e){
  }
zargoun
Newbie
 
Posts: 12
Joined: Thu Apr 05, 2012 3:25 pm

Re: G15 Cube Servo and ioio

Postby tonywk88 » Sun Apr 13, 2014 10:32 pm

Hi,

Do check if the G15 motor is in 'Wheel' mode or 'Position' mode.

If the G15 is set to 'Wheel' mode, It will NOT work if you trying to sent the position to the motor.

Thanks
tonywk88
Moderator
 
Posts: 11
Joined: Tue Sep 27, 2011 9:37 am

Re: G15 Cube Servo and ioio

Postby zargoun » Mon Apr 14, 2014 9:11 am

tonywk88 WROTE:Hi,

Do check if the G15 motor is in 'Wheel' mode or 'Position' mode.

If the G15 is set to 'Wheel' mode, It will NOT work if you trying to sent the position to the motor.

Thanks


is the motor going to be in wheel mode by default ?
zargoun
Newbie
 
Posts: 12
Joined: Thu Apr 05, 2012 3:25 pm

Re: G15 Cube Servo and ioio

Postby zargoun » Mon Apr 14, 2014 9:51 am

tonywk88 WROTE:Hi,

Do check if the G15 motor is in 'Wheel' mode or 'Position' mode.

If the G15 is set to 'Wheel' mode, It will NOT work if you trying to sent the position to the motor.

Thanks


i have tried to turn on the LED and torque using the code in manual, but i have not succeed to turn it


CODE: SELECT_ALL_CODE
out.write(0xFF);                          //the library waits for transfer complete, output.flush() is called
         out.write(0xFF);
         out.write(0x01);
         out.write(0x05);
         out.write(0x03);
         out.write(0x18);
         out.write(0x01);
         out.write(0x01);
         out.write(0xDD);
zargoun
Newbie
 
Posts: 12
Joined: Thu Apr 05, 2012 3:25 pm

Re: G15 Cube Servo and ioio

Postby Idris » Tue Apr 15, 2014 8:54 am

Hi zargoun,

When you power up the G15, LED on G15 will blink once. This indicator show G15 is still in good condition. So, make sure this happen.

I assume you are using GD02 driver, so you need to control the CTRL pin to make the GD02 in transmit or receive mode. So my idea, try to set the GD02 as transmit only and control the G15 LED (like do blinking 1 sec). Plus in your program, just do transmit, ignore the receive part. This idea just want to troubleshoot on the communication part between IOIO and G15. Once this working, you can slowly do on receive part.

Anyway, could you post your current hardware and wiring pictures?
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: G15 Cube Servo and ioio

Postby zargoun » Wed Apr 16, 2014 9:23 am

Idris WROTE:Hi zargoun,

When you power up the G15, LED on G15 will blink once. This indicator show G15 is still in good condition. So, make sure this happen.

I assume you are using GD02 driver, so you need to control the CTRL pin to make the GD02 in transmit or receive mode. So my idea, try to set the GD02 as transmit only and control the G15 LED (like do blinking 1 sec). Plus in your program, just do transmit, ignore the receive part. This idea just want to troubleshoot on the communication part between IOIO and G15. Once this working, you can slowly do on receive part.

Anyway, could you post your current hardware and wiring pictures?


yes i can see the LED blink once, and im sure that motor works very well because i can control it using windows GUI
do i need to make a pull-up resistor for the DTR pin ?

the photos of the hardware are below
Image

Image

Image


this is the code for the LED blinking


CODE: SELECT_ALL_CODE
void ioioSetup(IOIO ioio) throws ConnectionLostException {
 
  uart = ioio.openUart(4, 6, 19200, Uart.Parity.NONE, Uart.StopBits.ONE);
  led = ioio.openDigitalOutput(IOIO.LED_PIN, true);
  DTR = ioio.openDigitalOutput(3, true);
 
 
  in = uart.getInputStream();
  out = uart.getOutputStream();
 
}

void ioioLoop(IOIO ioio) throws ConnectionLostException {
 
  led.write(false);
 
 
 
  try {
     
   
    DTR.write(false);
   
    try {
     
         
         out.write(0xFF);                         
         out.write(0xFF);
         out.write(0x01);
         out.write(0x05);
         out.write(0x03);
         out.write(0x19);
         out.write(0x01);
         out.write(0xDD);
         
         delay(2000);
         
         out.write(0xFF);                         
         out.write(0xFF);
         out.write(0x01);
         out.write(0x05);
         out.write(0x03);
         out.write(0x19);
         out.write(0x00);
         out.write(0xDF);
     
         delay(2000);
     
       
    }
    catch (IOException e){
    }
   
    Thread.sleep(20);
  }
  catch (InterruptedException e) {
  }
}




here is the data from hyperterminal

Image

CODE: SELECT_ALL_CODE
try {
     
         
         out.write(0xFF);                         
         out.write(0xFF);
         out.write(0x01);
         out.write(0x05);
         out.write(0x03);
         out.write(0x19);
         out.write(0x01);
         out.write(0xDD);
         out.write('A');
         
         delay(2000);
         
         out.write(0xFF);                         
         out.write(0xFF);
         out.write(0x01);
         out.write(0x05);
         out.write(0x03);
         out.write(0x19);
         out.write(0x00);
         out.write(0xDF);
         out.write('B');
     
         delay(2000);
     
       
    }
    catch (IOException e){
    }
zargoun
Newbie
 
Posts: 12
Joined: Thu Apr 05, 2012 3:25 pm

Re: G15 Cube Servo and ioio

Postby Idris » Wed Apr 16, 2014 4:31 pm

Zargoun, nice project!

Anyway, you can use RealTerm as terminal software to display data in HEX.
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: G15 Cube Servo and ioio

Postby zargoun » Wed Apr 16, 2014 5:10 pm

Idris WROTE:Zargoun, nice project!

Anyway, you can use RealTerm as terminal software to display data in HEX.


i have use realterm to display, all the bytes been sent correctly as shown in the picture below

Image
i feel that DTR pin is the problem, but i have tried everything to make it work
do i have to to do anything before i send these bytes such as baudrate setting for the motor, because the way i do it is as following:

i turn on the motor, then directly send the bytes
zargoun
Newbie
 
Posts: 12
Joined: Thu Apr 05, 2012 3:25 pm

Re: G15 Cube Servo and ioio

Postby Idris » Thu Apr 17, 2014 9:18 am

To set the GD02 in transmit mode, make sure CTRL pin is HIGH, you can measure using multimeter.

Try this,

Turn ON LED
Byte 1: 0xFF // Header
Byte 2: 0xFF // Header
Byte 3: 0x01 // G15 ID
Byte 4: 0x04 // Length (Parameter + 2)
Byte 5: 0x03 // Write instruction
Byte 6: 0x19 // G15 LED address (Parameter 1)
Byte 7: 0x01 // Turn ON LED (Parameter 2)
Byte 8: 0xDD // Checksum

Turn OFF LED
Byte 1: 0xFF // Header
Byte 2: 0xFF // Header
Byte 3: 0x01 // G15 ID
Byte 4: 0x04 // Length (Parameter + 2)
Byte 5: 0x03 // Write instruction
Byte 6: 0x19 // G15 LED address (Parameter 1)
Byte 7: 0x00 // Turn OFF LED (Parameter 2)
Byte 8: 0xDE // Checksum
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: G15 Cube Servo and ioio

Postby zargoun » Thu Apr 17, 2014 11:27 am

Idris WROTE:To set the GD02 in transmit mode, make sure CTRL pin is HIGH, you can measure using multimeter.

Try this,

Turn ON LED
Byte 1: 0xFF // Header
Byte 2: 0xFF // Header
Byte 3: 0x01 // G15 ID
Byte 4: 0x04 // Length (Parameter + 2)
Byte 5: 0x03 // Write instruction
Byte 6: 0x19 // G15 LED address (Parameter 1)
Byte 7: 0x01 // Turn ON LED (Parameter 2)
Byte 8: 0xDD // Checksum

Turn OFF LED
Byte 1: 0xFF // Header
Byte 2: 0xFF // Header
Byte 3: 0x01 // G15 ID
Byte 4: 0x04 // Length (Parameter + 2)
Byte 5: 0x03 // Write instruction
Byte 6: 0x19 // G15 LED address (Parameter 1)
Byte 7: 0x00 // Turn OFF LED (Parameter 2)
Byte 8: 0xDE // Checksum



yes it works, thank you very much
my mistake was i connected the RX>TX and Tx>Rx but actually it must be Rx>Rx and Tx>Tx
plus the mistake from the bytes value

thank you
zargoun
Newbie
 
Posts: 12
Joined: Thu Apr 05, 2012 3:25 pm

Next

Return to DC Motor

Who is online

Users browsing this forum: No registered users and 9 guests