Qik2s9v1 Motor Controller Help needed please

Hey i have brought two Qik2s9v1 Motor Controller to controll the 4 motors…
I have added newsoftserial library along with Qik2s9v1.
i followed how to connect motor controller…here how i have connected…please advice me if have connected anything wrong.
GND - ARDUINO GROUND
VCC -5 VOLT FROM ARDUINO
TX OF QIK TO PIN 3 ON ARDUINO
RX OF QIL TO PIN 4 ON ARDUINO
RST - PIN 5 ON ARDUINO
M1 - TO MOTOR 1
M0 - TO MOTOR 2
GND - CONNECTED TO GROUND OF 9 V BATTERY I HAVE CONNECTED
VMOT -TO PISIVITE OF 9 V BATTERY …
THAN I HAVE UPLOADED CODE BELOW:

/*************************************************************

  • CompactQik2s9v1 - basic class to control Pololu’s Qik2s9v1
  • motor controller (pololu.com/catalog/product/1110)
  • This uses the default settings for the motor controller and the
  • Compact Protocol to communicate to it.
  • This library also depends on the NewSoftSerial library which
  • can be found at: arduiniana.org.
  • Sketch allows for motor control via serial connection to the
  • Arduino. PC -> serial -> Arduino -> serial -> Qik2s9v1

*************************************************************/

#include <CompactQik2s9v1.h>
#include <NewSoftSerial.h>

/*
Important Note:
The rxPin goes to the Qik’s “TX” pin
The txPin goes to the Qik’s “RX” pin
*/
#define rxPin 3
#define txPin 4
#define rstPin 5

NewSoftSerial mySerial = NewSoftSerial(rxPin, txPin);
CompactQik2s9v1 motor = CompactQik2s9v1(&mySerial,rstPin);

byte motorSelection;
byte motorSpeed;

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
motor.begin();
motor.stopBothMotors();
}

void loop()
{
if ( Serial.available() > 0 )
{
motorSelection = Serial.read();
switch(motorSelection)
{
case 0:
motor.motor0Forward(getSpeedByte());
break;
case 1:
motor.motor0Reverse(getSpeedByte());
break;
case 2:
motor.motor1Forward(getSpeedByte());
break;
case 3:
motor.motor1Reverse(getSpeedByte());
break;
case 4:
motor.motor0Coast();
break;
case 5:
motor.motor1Coast();
break;
case 6:
motor.stopBothMotors();
break;
default:
showHelp();
break;
}
}
}

byte getSpeedByte()
{
return Serial.read();
}

void showHelp()
{
Serial.println(“Send 1 or 2 bytes: “);
Serial.println(” ()”);
Serial.println(“motor selection choices:”);
Serial.println(“0 - m0 forward”);
Serial.println(“1 - m0 reverse”);
Serial.println(“2 - m1 forward”);
Serial.println(“3 - m1 reverse”);
Serial.println(“4 - m0 coast (no speed byte)”);
Serial.println(“5 - m1 coast (no speed byte)”);
Serial.println(“6 - stop both (no speed byte)”);
}

I HAVE ALSO USED ANOTHER CODE WICH IS BELOW…

/*************************************************************

  • CompactQik2s9v1 - basic class to control Pololu’s Qik2s9v1
  • motor controller (pololu.com/catalog/product/1110)
  • This uses the default settings for the motor controller and the
  • Compact Protocol to communicate to it.
  • This library also depends on the NewSoftSerial library which
  • can be found at: arduiniana.org.
  • This sketch shows the required setup and then tells the
  • motors to stop

*************************************************************/

#include <CompactQik2s9v1.h>
#include <NewSoftSerial.h>

#define rxPin 3
#define txPin 4
#define rstPin 5

NewSoftSerial mySerial = NewSoftSerial(rxPin, txPin);
CompactQik2s9v1 motor = CompactQik2s9v1(&mySerial,rstPin);
byte fwVersion = -1;

void setup()
{
mySerial.begin(9600);
motor.begin();
motor.stopBothMotors();
}

void loop()
{
// nothing to do, used to stop the motors
}


after doing that my motor is not running at all…
can anyone can tell me what should i do?
:frowning:
is there any problem with wiring that i have shown above…
i am using motor GM8 143:1 Gear Motor brought from pololu…it said compatible with
Qik2s9v1 …
so whats went wrong please help …

Hello.

Your connections look right. Can you please try the steps listed in the troubleshooting section of the qik user’s guide and let me the results? In general, it’s not a great idea to try to get something working by using code you don’t understand. For example, it shouldn’t be surprising that the motor doesn’t move when you run the second program you posted. What were you expecting it to do?

- Ben

Thanks for your so quick reply…
Now i am sure the connections are right…
I try to understand the code. i came up with simple code that is below pls help me with any error or syntax error or any logical error since i am not really programing guy …
U r advice and help will realy help me…
Its school project task that i have to do…
Proffesor also want me to control this car( right and left turn forward and reverse using
accelerometer memsic wirelessly… So i brought two XBee
To send data from memsic accelerometer in my hand connected to one XBee to send data to arduino connected wirelessly on car… I hope that might work…

#include <CompactQik2s9v1.h>
#include <NewSoftSerial.h>

#define rxPin 3
#define txPin 4
#define rstPin 5

NewSoftSerial mySerial = NewSoftSerial(rxPin, txPin);
CompactQik2s9v1 motor = CompactQik2s9v1(&mySerial,rstPin);
byte fwVersion = -1; // what this line do? Is it firmware version of chip or it use for sending bytes…

void setup()
{
mySerial.begin(9600);
motor.begin();

}
void loop()
{
Motor.motor0Forward();
Motor.motor1Forward();
delay(2000);
Motor.motor0Reverse();
Motor.motor1Reverse();
delay(2000);
Motor.motor0Coast();
Motor.motor0Coast();
Motor.StopBothMotors();
}

Hello.

It looks like you have completely ignored my previous post. Please follow the steps from the troubleshooting section of the user’s guide and let me know the results of each step.

I’m not sure how you expect me to respond to your last post. You just gave me a block of code that calls functions from some other library, and you’re not even telling me anything about what happens when you run that code. Instead, please simplify things (e.g. follow the serial-test steps in the troubleshooting section of the user’s guide.

- Ben

hey ban i did trouble shoot the steps…
first step ,i can see the green LED flashing about twice per second… no red LED is flashing or turn on
that means there is no voltage problem because i am using arduino 5v and 9v for motors connected to Vmot on controller snd i have proper GND…
secondly , i downloaded and used serial transmitter utility software and sent 128 decimal at 9600 baud rate and i recived back packages that means the programm si runing well…
third i am using 120:1 Plastic Gearmotor Offset Output motors from pololu that says its compatible with Qik2s9v1 Motor Controller…
whats wrong do u think i should redo the code …i the code below and in serial monitor i typed 1 and speed 97 ,i typed 5 but the motors are not running…
:frowning: :question:
/*************************************************************

  • CompactQik2s9v1 - basic class to control Pololu’s Qik2s9v1
  • motor controller (pololu.com/catalog/product/1110)
  • This uses the default settings for the motor controller and the
  • Compact Protocol to communicate to it.
  • This library also depends on the NewSoftSerial library which
  • can be found at: arduiniana.org.
  • Sketch allows for motor control via serial connection to the
  • Arduino. PC -> serial -> Arduino -> serial -> Qik2s9v1

*************************************************************/

#include <CompactQik2s9v1.h>
#include <NewSoftSerial.h>

/*
Important Note:
The rxPin goes to the Qik’s “TX” pin
The txPin goes to the Qik’s “RX” pin
*/
#define rxPin 3
#define txPin 4
#define rstPin 5

NewSoftSerial mySerial = NewSoftSerial(rxPin, txPin);
CompactQik2s9v1 motor = CompactQik2s9v1(&mySerial,rstPin);

byte motorSelection;
byte motorSpeed;

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
motor.begin();
// motor.stopBothMotors();
}

void loop()
{
if ( Serial.available() > 0 )
{
motorSelection = Serial.read();
switch(motorSelection)
{
case 0:
motor.motor0Forward(getSpeedByte());
break;
case 1:
motor.motor0Reverse(getSpeedByte());
break;
case 2:
motor.motor1Forward(getSpeedByte());
break;
case 3:
motor.motor1Reverse(getSpeedByte());
break;
case 4:
motor.motor0Coast();
break;
case 5:
motor.motor1Coast();
break;
/* case 6:
motor.stopBothMotors();
break;*/
default:
showHelp();
break;
}
}
}

byte getSpeedByte()
{
return Serial.read();
}

void showHelp()
{
Serial.println(“Send 1 or 2 bytes: “);
Serial.println(” ()”);
Serial.println(“motor selection choices:”);
Serial.println(“0 - m0 forward”);
Serial.println(“1 - m0 reverse”);
Serial.println(“2 - m1 forward”);
Serial.println(“3 - m1 reverse”);
Serial.println(“4 - m0 coast (no speed byte)”);
Serial.println(“5 - m1 coast (no speed byte)”);
Serial.println(“6 - stop both (no speed byte)”);
}

Please stop posting the code you are trying to use. Right now I just want you to perform some simple tests to make sure the motor controller is working properly, so it is not helpful at this point.

128 is not a valid qik command, so I’m not sure what you mean when you say you received back packages that mean the program is running well. Can you actually try performing the tests listed in the troubleshooting section of the user’s guide? What happened when you tried Demo Mode?

If you think your only problem is your Arduino code, can you just try writing a sketch from scratch that just sends bytes to the qik using software serial? It should be very easy for you to send the motor foward command in setup().

- Ben

hey ban now i am using IC SN75441 H bridge …i am trying to runnign Grear motor 143:1 i brought from pololu with this IC chip…
now i have connected motors to the IC chip,first it has worked fine but after while it gradualy slowed down and come to full stop. when i touch my ic it was hot…i am sure my IC chip is fine …
Is the motor is not compatible with the IC chip …becuase it says the motor initial current should be 6 V and i am using arduino 5 v to poer up arduino and 9 volt for connected to chip Vcc1 and Vcc2…i ahve connected two capacitor both motor pins…i tried to understand the data sheet but it didnt really make any sense to me…
can u tell me whether motor is compatible with IC SN75441… if not what shouls i do next…
i appreciated for your responce…

As far as I know, we do not sell a 143:1 gearmotor. Please provide a link to the exact motor you are using. How are you sure the problem is not with your motor driver IC? It’s very easy to see if there is a problem with your motor: just connect the motor leads directly to your battery and see how it behaves.

Note that 9V batteries cannot output much current and are generally poor choices for high-current applications such as driving motors.

- Ben