In my spare time I’ve been trying to solve a particular noise/format issue with my 18v15. I followed the guide here and soldered 0.1uF capacitors across the motor leads and to the chassis, but I’m still consistently seeing the errors. Specifically, the screenshot below:
Now, for a bit of background, I have two motor controller’s daisy chained together sharing the same RX line. The motors have been given ids of 10 and 12. Here is a snippet of code which generates the byte array. I am using the Pololu protocol with full motor resolution as described here
int setExitSafeStart(int fd, unsigned char id) {
unsigned char bytes[3] = {0xAA, id, 0x03};
if (write(fd, bytes, sizeof(bytes)) == -1) {
perror("error writing");
return SERIAL_ERROR;
}
return 0;
}
int setMotorSpeedWithId(int fd, int speed, unsigned char id) {
unsigned char bytes[5];
bytes[0] = 0xAA;
bytes[1] = id;
if (speed < 0){
command[2] = 0x06;
speed = -speed;
} else {
command[2] = 0x05;
}
bytes[3] = (speed & 0x1F);
bytes[4] = (speed >> 5 & 0x7F);
if (write(fd, bytes, sizeof(bytes)) == -1) {
perror("error writing");
return SERIAL_ERROR;
}
return 0;
}
I added some logging to the code for debug purposes. The speed values are output from an analog joystick. In this instance, the joystick was pushed forward almost full throttle (max = 3200) and then pushed backwards close to full reverse(max = -3200). As you can see the Pololu command switches accordingly from 0x85 to 0x86, clearing the MSB (0x05, 0x06) and sets the last two bytes to low 5 high 7.
Joystick forward speed output: 2848:
Sending bytes: AA:0C:05:00:59
Joystick reverse speed output: 3025:
Sending bytes: AA:0A:06:11:5E
What I have done to troubleshoot:
The particular motors I am using are 12v Pittman GM9236. To rule out the motors themselves I grabbed a couple very small RC motors to test with, however I still reproduced the same errors. I tried switching the polarity, twisting the motor leads, and soldering 3 capacitators per motor. Interestingly enough, I completely removed the motors from the motor controllers and not a single error was produced? The controllers blinked yellow and pulsed when throttling up or down, showing me that commands were being received without errors. This was great news, until I hooked the motor back up and it went red again with noise/format errors.
Given the information above, is there anything that looks out of place or doesn’t sound right? I do not have a scope to test with however based on the response I might try to bring this into work and use theirs.
Addition information just incase:
- The motors work fine for a few seconds when moving the joystick and then sporadically go red. Sometimes just one, sometimes both. Always with the same noise/format error.
- The power supply is a new 12V sealed lead acid battery.
- Both controllers are set to auto baud.
- I have never been able to cause a noise/format error within Pololu Control Center. Only with my own code.
- The platform is a Jetson TK1. Voltage levels are 1.8v on this system so a level shifter is used to step up SMC lines.
- 3 motors were used in testing, all with the same result, with and without capacitors.
- setMotorSpeedWithId is called at 1 second intervals for now. This is very very slow for a joystick but I am debugging and thought maybe I was sending commands too fast.