cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] I was working with Arduino between G431rb and Sabertooth 2x32. Everything is working well but not stable. I decided to remove Arduino but couldn"t handle communication between Sabertooh 2x32 and G431rb.

cihadkck
Associate II

I checked the signals are going to the driver from Arduino on the Hercules desktop app. I tried to send these with USART but i didn't get any response.

uint8_t openRightSS[5] = {0x31, 0x32, 0x30, 0x0D, 0x0A};
// i got these hex numbers from hercules, when they sent to motor driver, motor driver works
HAL_UART_Transmit(&huart3, openRightSS,5,100);

I have some sources from Dimension Engineering(for Sabertooth 2x32 packet serial communication) website. There are some information about CRC and Checksum but i couldn't implement them also.

Last thing that i found was sending data with different way(?).

void driveForwardMotor1(uint8_t address, uint8_t speed)
{
	HAL_UART_Transmit(&huart3, address, strlen(address), 1000);
	HAL_UART_Transmit(&huart3, 0, 1, 1000);
	HAL_UART_Transmit(&huart3, speed, strlen(speed), 1000);
	HAL_UART_Transmit(&huart3, ((address + 0 + speed) & (0b01111111)), strlen((address + 0 + speed) & (0b01111111)), 1000);
 
}
void driveBackwardMotor1(uint8_t address, uint8_t speed)
{
	HAL_UART_Transmit(&huart3, address, strlen(address), 1000);
	HAL_UART_Transmit(&huart3, 1, 1, 1000);
	HAL_UART_Transmit(&huart3, speed, strlen(speed), 1000);
	HAL_UART_Transmit(&huart3, ((address + 1 + speed) & (0b01111111)), strlen((address + 1 + speed) & (0b01111111)), 1000);
}
void driveForwardMotor2(uint8_t address, uint8_t speed)
{
	HAL_UART_Transmit(&huart3, address, strlen(address), 1000);
	HAL_UART_Transmit(&huart3, 4, 1, 1000);
	HAL_UART_Transmit(&huart3, speed, strlen(speed), 1000);
	HAL_UART_Transmit(&huart3, ((address + 4 + speed) & (0b01111111)), strlen((address + 4 + speed) & (0b01111111)), 1000);
 
}
void driveBackwardMotor2(uint8_t address, uint8_t speed)
{
	HAL_UART_Transmit(&huart3, address, strlen(address), 1000);
	HAL_UART_Transmit(&huart3, 5, 1, 1000);
	HAL_UART_Transmit(&huart3, speed, strlen(speed), 1000);
	HAL_UART_Transmit(&huart3, ((address + 5 + speed) & (0b01111111)), strlen((address + 5 + speed) & (0b01111111)), 1000);
}

1 ACCEPTED SOLUTION

Accepted Solutions
cihadkck
Associate II

Solved the issue. Data i received from hercules were not working(idk why). I tried to see what arduino sent to sabertooth board through another arduino. They were different hex data arrays, i tried them with this code and it worked

while(counter<3){
HAL_UART_Transmit(&huart3, forward, strlen(forward), 100);
 counter++; 
}

View solution in original post

1 REPLY 1
cihadkck
Associate II

Solved the issue. Data i received from hercules were not working(idk why). I tried to see what arduino sent to sabertooth board through another arduino. They were different hex data arrays, i tried them with this code and it worked

while(counter<3){
HAL_UART_Transmit(&huart3, forward, strlen(forward), 100);
 counter++; 
}