Home        Store        Docs        Blog

Blue Esc controlled with 3.3V I2C


(Ryan McBee) #1

Hello everyone,

I am part of the Purdue University ROV team and we are using T200 thrusters this year on our ROV. We are trying to control the thrusters with a 3.3V stm32f4 microcontroller with a I2C level shifter from spark fun https://www.sparkfun.com/products/12009. For some reason I have not been able to get it working. I am able to test that the motors work by changing the speed with an arduino.

The oddest thing is that I can read the read bytes from the motor, while still not able to set the speed. Any suggestions or knowledge into this issue would be much appreciated.


(Rusty) #2

Ryan,

Can you share any of your code? Sounds like you’re really close if you’d able to read bytes from the motor.

-Rusty


(Ryan McBee) #3

Here is the part of the code that does the command sending.


uint8_t motorAddress = 0x29;
uint8_t temp[3] = {0x00, (throttle>>8), throttle};
HAL_I2C_Master_Transmit(&hi2c1, motorAddress << 1, temp, 3, 100);

I am using an stm32f4 specific library, which is why some of the commands might look strange, but the master transmit has been tested and I know it works with all of the 3.3V sensors I have. temp is the packet of data that i2c will send.

Also, I took pictures of the arduino and the stm chip both sending and i2c command to set the thrusters to speed 7000. The main difference is the clock line, where the arduino has some spacing after each byte while the stm chip does not. I think that spacing is important but I am not sure if it actually is important and how to get it to happen with the stm chip.

Attached are the two pictures I took from my logic analyzer.




(Philipp Schmidt) #4

Hello guys,

i got the same problem as the author.

I want to control the Thruster T100 with a Nucleo STM32 F411 RE via I2C. I spend much time in it and tried much ways, but the ESC dont sent a ack back. With a Arduino Due the Thruster works well. I use a homemade 3,3V to 5V I2C-Adapter.

Is there any solution until now?

@Ryan McBee Do your Thruster work with the STM32 F4 meanwhile?


(Ryan McBee) #5

Hello @Philipp Schmidt

I have not found a solution yet. From what I have tested I believe the issue is with the stm32 chips. I believe that they are unable to account for the clock stretching that the thrusters require. Here is a link to more information on clock stretching http://www.i2c-bus.org/clock-stretching/. I think the issue with the clock stretching is inherit to chip. I tested my logic level shifter with a 3.3 V tensy lc and the clock stretching went across the line fine. That is as far as I have discovered. I am busy for the next few months and will probably not have any more time to explore how to fix this.