I am using the RoboClaw controllers to run all my actuation on a project.
The project consists of a Steward Platform atop a kiwi drive omni directional base
I am controlling 6 linear actuators for the platform, and 3 DC motors for the base
I am using an Adafruit ESP32 Feather for the MCU and have been using the Arduino libraries
The problem I am currently trying to solve is that I am getting a 30ms latency on each serial communication between the MCU and the RoboClaws - with 9 actuators this is adding up to 270ms for each command cycle, which is not functional. This gets worse when I try and request information from the RoboClaws.
I had been running previously off an AVR AtMega2560, I experienced a similar problem until I split the base and platform control over 2 Serial channels, but that doesn't seem to be fixing it this time (and it doesn't solve the initial problem with the source of the latency) - any help on this would be greatly appreciated.
Here are the drive functions:
Code: Select all
//kiwi drive base driving function
// Stewart Platform drive to position function
for(int i = 0; i <3 ; i++)
kiwiDrive(kiwiA, kiwiV, kiwiR);
int tm2 = millis(); //this is to check serial latency only, comment out once fixed
tm2 = millis();
When I set the timeout to 1000 instead of 10000 when defining the roboclaws, the latency drops to 10ms - the esp32 therefor is timing out with communicating to the RoboClaws - given the trouble I was having with requesting info from the controllers, it would seem that the ESP32 isn't reading data back from the controllers?
Even with the timeout set to effectively zero, the latency on the Platform drive is still around 8ms on each communication cycle (with the encoders and actuators not currently connected) - so around 83ms for all nine control commands (I have ran it wirelessly, connected to all the actuators, so the control commands are getting from the ESP32 to the Roboclaws just fine)