I recently purchased this motor controller - pololu.com/catalog/product/120
Sadly it does not work at all - not even the LEDs light up.
So heres my wiring setup.
- VMOT - unregulated 6V
- GND - ground
- VCC - regulated 5V
- SER - to my UART transmit
- RST - to a digital pin
- motor wires go to the motors
I verified all connections with a multimeter and everything is fine
So heres what I am doing in my code:
Make the digital pin thats connecting to RST HIGH
Send out UART data @ 9600 baud to the motor controller
Here is the UART packet I am sending out( in hex) 80,00,00,7F - which according the manual is supposed to turn on all motors to a speed of 127 ( 7F )
I verified that it is indeed sending the correct packet by connecting it to my computer.
So I sent the packet and still nothing. No LEDs light up , nothing. I even disconnected the motors and still no LEDs lighting up.
Can anyone help me out as to what is happening here and how to fix it?
Disconnecting the motors and just using the LEDs is a good start. The command you’re sending is to just one of the motors, but you should still see one of the outputs responding. How did you verify the serial data? What microcontroller are you using?
Hi jan, thanks for the reply
I am using the Axon microcontroller - societyofrobots.com/axon/
I verified the UART data with this - sparkfun.com/commerce/produc … cts_id=718 .
Any idea what going on?
So far, I have no idea what the problem could be. Can you simplify your code to the simplest it can be and post it? Posting a picture of your setup might also help.
Another thing you could try is using your serial adapter and sending the data from your computer using our serial transmit utility.
I tried connecting the Tx of the USB serial data adapter to the Rx of the Motor Controller. I did all the proper connections( made sure Vcc got 5V and VMot got unregulated, reset got straight 5V) and also made sure that they all shared the same ground.
Any other tips or things you can do to help me out?
The reset line wasn’t being pulled HIGH - bad connection.
All is well.
When I said “All is Well” that meant that when I used the Pololu Serial Program from my computer to talk to the Motor Controller through the USB UART adapter , it worked.
Now when I try to connect my Axon to the Motor controller, the motor controller does not worked.
On the Axon I use AVRlib’s UART and set it up to 9600 baud rate. I then use the uart0SendByte command to send the bytes out.
I connected the USB UART adapter to the serial output of the Axon and found it to be sending the correct packet ( 0x80 , 0x00, 0x05, 0x64 ) at the correct baud rate (9600).
Here is some more info on the UART AVRlib that I use : mil.ufl.edu/~chrisarnold/com … uart2.html
Can you simplify your program to the smallest code you think should work, and then post that? One thing that might be a problem is the state of the serial line before you send the bytes; you should make sure the line is high, then reset the motor controller (using its reset line), and then wait a bit and send the bytes.
Here it is
uartInit uses the UART.c of AVRlib.
uartInit(); // initialize the UART (serial port)
uartSetBaudRate(0, 9600); // set UARTE speed, for Bluetooth
//G=Ground, T=Tx (connect to external Rx), R=Rx (connect to external Tx)
PORT_OFF(PORTH ,5); // Reset Low
PORT_ON(PORTE ,1); // Serial Line High
PORT_ON(PORTH ,5); //Reset High
Well, that generally looks okay. I don’t know the details of what your library functions do, so you might want to make sure of basic things like the pins being configured as outputs. Another thing to verify is that your serial line bit manipulation is not interfering with the UART’s access to the same line. If you have access to an oscilloscope or logic analyzer, you could look at your program’s output and compare it to what you’re getting from the PC.