ros-ukraine/leobot

Motor driver discussion

Opened this issue · 11 comments

Hi,

We have some issue with STM32 board and VNH2SP30 motor driver:
Logic levels for STM32 are 3.0V (3.3V but the board has IC with a diode which generates 3.0 power supply for STM32 ). According to the datasheet of VNH2SP30 (https://www.st.com/resource/en/datasheet/cd00043711.pdf) all input pins are "5 V logic level compatible inputs". (page1), and "Input high-level voltage 3.25" (table 7). So even we provide 3.0V PWM, this board recognized it as logical 0, and the motor will not be enabled.

Solutions:

  1. Use level shifters like this:
    https://www.ebay.com/itm/3-3V-5V-4-Channel-Logic-Level-Converter-TTL-Bi-Directional-Shifter-Module-10pcs/152613484769?hash=item238878f8e1:g:kN0AAOSwFJBZXdOE:rk:5:pf:0

  2. Change the motor driver to other which has "3V-compatible inputs" levels like this:
    https://www.pololu.com/product/1451
    High-level input voltage 2.1 V (table 7).
    https://www.pololu.com/file/0J504/vnh5019.pdf

As for me, the second solution is better as we don't need to have any extra boards. But the first solution is much cheaper.

Thanks,
Vasyl

@LyubomyrD what will you recommend?

As for me, we need to select 1 or 3 solutions. Solution 3 also requires DC/DC isolated module (5v to 5V) but is more reliable than 1.

So in case of option #3 we need one opto-isolator with 8 channels for whole robot? Why do we need DC\DC isolated module? (I thought we just need isolated power supply with 5V)
For option #3 is this product good enough https://www.aliexpress.com/item/8-Channel-Optocoupler-Isolation-Board-Module-12V-High-Level-Trigger-Plate-Positive-Phase-Larger-Version/32719949787.html ?

I vote for the Opto-isolator IC Module.

@nemo8 can't we get 5V from the pin of Discovery board?

@AndriyPt we need the Opto-isolator IC Module for the following pins InA, InB, EN, PWM.
Therefore I guess the best solution is purchasing the four following items

https://www.ebay.com/itm/TLP281-4-Channel-Opto-isolator-IC-Module-Arduino-High-Low-level-Expansion-Board/191736124728?hash=item2ca45d1538:g:QooAAOSwL7VWlz-R:rk:19:pf:0

What do You think @nemo8 ?

@LyubomyrD , @AndriyPt As Lubomyr said we need to protect 4 pins ( InA, InB, EN, PWM). We have 4 drivers, so we need to have 16 channels isolation for the whole robot. It can be one board or separated.

Isolation is needed for two reasons:

  1. For blocking noise from the motor.
  2. To protect STM32 and connected PC from 12V if the motor driver is damage.

We also need 5V supplying the second part of optocouplers. This voltage can' t be the same as we have on STM32, otherwise, isolation will be not working.

We have two solutions how to get 5V:

  1. Use isolation DC/DC (5V to 5V) to get 5V from STM32 board.
  2. Use ordinary DC/DC (12V to 5V) and get 5V from the battery or power supply (Motor source)

isolation

I totally rely on @nemo8 advise with 5V/5V or 12V/5V isolation. If You can provide some theoretical materials to clarify this issue I would be grateful. This is a very common practice in different PCB's and I do not want to make this mistake in the future.

@nemo8 the 12V/5V choice seems more reasonable for me, but what is Your advice?

@LyubomyrD ,
https://habr.com/post/386721/

12V to 5V converters without isolation usually are more chipper than isolated 5V to 5V.
We don't need to have big current for 5V, only for pull up(or pull down) up resistors. It can be LDO like this: https://www.ebay.com/itm/DC6-5-12V-to-DC-5V-1117-5V-600mA-Power-Module-Low-Dropout-Regulator-Anti-reverse/272981540881?hash=item3f8ef7c011:g:wK0AAOSwdx1aMWO8:rk:1:pf:0