I am working on a small project using the Raspberry Pi and Pololu Qik 2s9v1 Dual Serial Motor Controller.
I made all the cable connections but the qik does not move.
My cable connections are as follow:
GND & VCC -> are connected to 2x1.5 AA batteries (alkaline)
RX -> Raspberry Pi TX
TX -> Raspberry Pi RX
-M1 & +M1 -> first motor
-M2 & +M2 -> second motor
GND & VMOT -> 4 x 1.2V AA rechargeable batteries (NiMH)
I set the A jumper so the bit rate is fixed to 38400 and i re-configure the Pi’s serial port so that it’s not being used for console logins.
This is the small program i am trying to run:
import serial import time s = serial.Serial("/dev/ttyAMA0", 38400, timeout=0.5) s.write( chr(0xAA) + chr(0x09) + chr(0x0A) + chr(0x7F) ) # motor 0 full speed reverse time.sleep(2) s.write( chr(0xAA) + chr(0x09) + chr(0x0A) + chr(0x00) ) # motor 0 stop s.close()
The program was taken from here: ryosprojects.wordpress.com/2013/09/15/37/
When i first power it the Qik’s green led turns on every 2 sec or so and nothing changes when i run the program.
I tested the same code with auto bit rate detection (no A jumper). I also reinstalled the Raspian OS and installed only Python Serial module.
Also in DEMO mode the engines spin without a problem.
Right now i am stuck with this and don’t know what to do.