I bought from the AION Robotics company a R1 UGV (Ardupilot Edition) that already comes with a Pixhawk 2.1 (running ArduRover v4.1.0-dev), RoboClaw 2x15A ESC, here2 GPS and a power distribuition system to provide power to Pixhawk 2.1 and Roboclaw. All wire connections were all made by them but the most important for this situation are the connections between pixhawk and roboclaw:
Pixhawk ----------> RoboClaw
PWM1 --------> S1
PWM3 --------> S2
The only change we made was to remove the here2 GPS and place the ardusimple rtk2b for for better accuracy.
Now let me tell you about the problems I have been facing:
For months everything seemed to be working well but suddenly it stopped working: we gave an order to walk forward for example and he started walking to the side or shaking and we can never understand the problem.
Analyzing better the connections and configurations that came from the company AION Robotics, I noticed that Roboclaw was configured for analog mode and I started to wonder how that would be possible, since the Pixhawk has no DAC in order to be able to send analog signals. I also noticed that the pixhawk was set to MOT_PWM_TYPE = 3 (brushed mode).
I tried to contact AION Robotics several times asking for a datasheet explaining their connections and the configurations they made on Roboclaw 2x15A and on Pixhawk and I never got an answer.
For me the most obvious/correct configuration would be to use the RC Mode which is a fixed frequency PWM and whose pulse width controls the direction and speed of each pair of motor that is connected to the ESC Roboclaw. So I configured Roboclaw for RC mode, I developed a small code on the Arduino Mega just to test it and I managed to control the motors by sending a PWM to the S1 signal and another PWM for signal S2. Then I reconnected the Pixhawk to Roboclaw and changed the settings to MOT_PWM_TYPE = 0 (normal mode aka RC Mode) and I was able to control the robot.
The GPS also stopped working on the GPS2 port and I changed it to the TELEM2 port since the order of pins VCC, TX, RX and GND is the same (and I made the changes
needed in pixhawk settings) and it worked. Days later, the GPS on the TELEM2 port also stopped working. I changed again to TELEM1 and it worked. What is the problem?
Can anyone help? What is the best way to control the roboclaw 2x15A with the pixhawk in order to perform ground missions? RC mode or another mode? If in RC mode, what settings do I need to ensure on pixhawk? What about GPS, why has it stopped working? And why did the company IONRobotics sell the robot with Roboclaw ESC configured for analog mode?
Thanks in advance.