Qik2s9v1 Help

Hello,

I am using the simple example code I found in this forum.

void setup() 
{
  mySerial.begin(9600);
  mySerial.print(0xAA, BYTE);  // let qik learn the baud rate 
  mySerial.print(0x8C, BYTE);  // M1 forward command byte
  mySerial.print(63, BYTE);  // M1 speed = 127 (full speed in 7-bit mode)

  mySerial.print(0x88, BYTE);  // M0 forward
  mySerial.print(127, BYTE);  // M0 speed
}

It only works when either M0 or M1 speed set at 127 and another one any value between 0-127.

I tried to set both M0 and M1 speed to 63 but it doesn’t work.

How to set both speed to 63 which is half of the full speed?

Thanks

Hello.

I don’t fully understand your problem. Can you please post a (complete) version of your program that does what you expect and a version that you think should work but doesn’t. Also, can you be any more specific about what “doesn’t work” means?

- Ben

I want both motor to turn at half of the maximum speed

#include <NewSoftSerial.h>

#define rxPin 3
#define txPin 4

NewSoftSerial mySerial = NewSoftSerial(rxPin, txPin);


void setup() 
{
  mySerial.begin(9600);
  mySerial.print(0xAA, BYTE);  // let qik learn the baud rate 
 
  mySerial.print(0x8C, BYTE);  // M1 forward command byte
  mySerial.print(127, BYTE);  // M1 speed = 127 (full speed in 7-bit mode)

  mySerial.print(0x88, BYTE);  // M0 forward
  mySerial.print(63, BYTE);  // M0 speed
}

void loop()
{
}

This is the complete code I am using and the outcome was what I expect. The M1 was at full speed and M0 at half speed.

I change the M1 speed from full speed (127) to half speed (63)

  mySerial.print(0x8C, BYTE);  // M1 forward command byte
  mySerial.print(63, BYTE);  // M1 speed = 63 (half speed in 7-bit mode)

  mySerial.print(0x88, BYTE);  // M0 forward
  mySerial.print(63, BYTE);  // M0 speed

The qik2s9v1 green light flashes on and off every 0.4s, and the red light was off.

That LED pattern indicates that the qik is in baud detection mode, which makes it seem like the controller reset when you tried to set the motor speeds. One easy way to test this would be to insert a long delay (maybe 5 to 10 seconds) after sending the first (0xAA byte). If the controller is resetting, you should see the green LED do its brief heartbeat flash a few times and then go back to its even flashing after the delay.

It sounds like you have a power or motor noise problem, or some combination of the two. What is your power supply and what is the stall current of your motors at the voltage you’re using? Have you taken any precautions to limit motor noise (e.g soldering 0.1uF caps across your motor terminals, using the shortest motor leads possible, routing motor leads away from signal lines, and twisting motor leads around each other)?

- Ben

I added 5 seconds delay after 0xAA. After 5 seconds of the delay, the green light flashing pattern was in baud detection mode and the red light was on.

Both motors were soldered with 0.1uF caps.

I removed the motors connection from the qik2s9v1 and the green light flashing on and off in 2 seconds and red light was off after the delay.

You seem to be kind of reluctant to share details, but without details I can’t help you. For example, can you confirm that the flashing pattern actually changed after the 5 second delay when your motors were connected?

Can you answer my questions about your power supply and motors? Also, a picture of your setup along with a description of how everything is connected would be helpful. Finally, I suggest you add some code to your Arduino sketch that can let you tell if the Arduino is resetting (e.g. program it to blink the user LED a few times at the top of setup() before you start sending serial bytes).

Edit: I just saw the update you added to your post. If it works without motors connected, that’s a very good indication that you have a power or noise issue, so we should look into how you’re powering everything and the specifics of your connections.

- Ben