Home        Store        Docs        Blog

ESCs, T200, Pressure Sensor, rosserial


(Ayush Gupta) #1

Hey there,

We were building a robot with 8 T200 using basic ESCs as well as the Bar30 pressure sensors interfacing with Arduino. In turn they were begin controlled by rosserial.
If I comment out Wire.h and everything required by the pressure sensors the 8 thrusters work very well, but they don’t, and the rosserial loses sync with the Arduino whenever we use them together.

Is there any way we can solve this. It’s quite urgent.

Thanks
Ayush


(Patrick José Pereira) #2

Hi,

Arduino has a small number of timers, this can explain what you are facing, with 8 PWMs + I²C + Serial.
Try to use software serial or/and software PWM, this maybe can result in a stable approach.


(Ayush Gupta) #3

I have a competition this weekend, and cannot make a lot of changes. Can you please what I can do to proceed. Is there any way I can reduce the timers? Or adjust it into the buffer?


(Patrick José Pereira) #4

Hi,

We can’t provide further help, but you can find some good documentation in the internet about Arduinos, timers and interruptions.

Take a look in this post:

And the official documentation:
https://arduino.cc

I would also recommend more three things:

  1. Try to isolate and minimize your code until the point you can make your problem explicit and easy to debug. Try commenting out one line at a time to see if the problem goes away, this way you can find which particular lines are causing the problems.
  2. Take a look in the Arduino forums, since your problem is not related to Blue Robotics products, but arduino in general. You will get better advice there.
  3. When asking about a problem with code, you should include a minimal example piece of code that demonstrates your problem. This way, others can replicate your problem in front of themselves, and this makes it faster to find the problem. Don’t paste an entire project with unrelated code, but just the core pieces that create the problem. In the process of creating this code, you might find the problem yourself (this is very closely related to advice #1 above)

(Willian Galvani) #5

Hi,

It is also possible that your serial buffer is overflowing while reading the Bar30 (each read takes around 40 ms), which could cause the communication issues with ROS. Try lowering the baudrate to 9600 and see if works.


(Ayush Gupta) #6

Hello sir,

I lowered down the rate of reading the values from the pressure sensor to 8 Hz but it still fails some time. Can you refer me to someone who has faced this difficulty and solved it?

Thanks


(Jacob) #7

Hi Ayush, We don’t know of someone in your situation, but my recommendation would be to reduce the oversampling in the ms5837 library, or modify it so that it can work without the blocking delay call.


(Jacob) #8

We can add support for this some time: