Firt off, I am new to this forum, and this is my first time using a product from Pololu. I am working with a team of 2 others who are designing a robot spider.
One of my team mates obtained a Pololu Micro Dual Serial Motor Controller (MDSMC) to be used along with a PIC18F4550 to control the way the robot spider moves.
Now on to the questions. According to the manual, the MDSMC can be used with up to two separate motors. Is it possible to hook up two motors instead of just one so that four motors will be controlled? Yes, the two motors on each side will always be moving in the same direction, just in case you are wondering.
Another question is: Does anyone know how to use the MDSMC with MikroC or MikroBasic from Mikroelektronika? Currently, I am using MikroC to program the PIC Microcontroller. Both MikroC and MikroBasic have USART functions, but I am unsure whether this will be enough, or if it will work at all. Any hints as to this issue is appreciated.
The manual talks about “Using the motor controller”. Is this serial data supposed to be put in a loop? An I am concerned about the Configuration. The sample code (from what I understand it doing) does not send the Configuration bytes, but instead goes straight to using the motor controller.
I would also like to know what the difference is between Pin 1 and Pin 3. Is it OK to attach both of them to the same power supply of 5V?
That’s all the questions I have for now. Thanks in advance for your helpful replies.
It’s certainly possible to connect multiple motors to a single motor output. For many people, however, even their single motor is beyond the size the motor controller is made for, so make sure your motors have a low-enough stall current (max 500 mA).
The USART should work fine with the uDSMC as long as you configure it correctly (i.e. UART, or asynchronous mode; acceptable baud rate; 1 stop bit; etc.).
Configuration is intended to be a one-time use option when you want to change the motor numbers to which the controller will respond. If you’re happy with the default (2 and 3) or the settings you’ve already chosen, there’s no need to re-configure every time.
You should send the motor controller a new command every time you want to change speed. Typically, you would have some loop where you read some sensors, process the data, and then update the motors based on that.
Pin 1 is for the motors; pin 3 is for the logic. They can generally be connected to the same supply if you know what you’re doing, but it doesn’t sound like you do. One of the most common problems with motor control is dealing with electrical noise from the motors. Using separate supplies helps a lot. Also, 5V is not a naturally-occurring voltage, which makes me think that you are going through some sort of regulator. Make sure it can deliver the necessary current and handle the widely-varying load that a motor presents.
Thank you Jan for the reply.
Currently, the circuit that I am using is configured with two power supplies. The first one is a DC power supply, providing our PIC18F4550 and the logic pin of the motor controller with 5V. The motor power is attached to a battery, providing it with 9V. I don’t know if this is a bad thing or not.
I do not know if something is wrong with the hardware or the software, or the PIC itself, but the PIC seems to be sending something to the Motor Controller, but it is not consistent. Sometimes it works, and at other times it does not. Also, the signal seems to be making pins 8 and 9 low. Maybe I am doing something wrong.
Have anyone used MikroC or MikroBASIC to program a PIC to work with this motor controller? Any help on this would be nice.