0

First of all, sorry if my post is too general. If you know a better place for this post please let me know.

Problem

I have 5 motors to be controlled independently (but not simultaneously, i.e. one motor at once). The motors are supposed to be controlled through 5 motor drivers Leadshine DM556. Each motor driver has 3 control (PUL, DIR and ENA) signals optically decoupled with the internal scheme as shown in the picture (from the datasheet):

driver inputs

I'm considering the Arduino Uno board to control the drivers in turn. Of course, the first thing that comes to mind is to use digital pins of Arduino Uno to drive these lines. But there are several issues regarding this approach. The first one is the current. The DM datasheet says:

driver currents

So even in case of typical current it would draw $$I_{out} = 3\times 5\times 10 \text{mA} = 150 \text{mA}$$

And as I know from this post:

The total current from all the IO pins together is 200 mA max

Too close I think. The second problem is the number of the used pins. There would be 15 of them! The Uno has only 13, C'mon. OK. From the DM datasheet we see that the ENA signal may be left unconnected (enabled). We can reduce the current and the number of pins to 10. But here comes the third problem : the software. I think it would be a nightmare to write a safe and maintainable code for the above-mentioned configuration.

My "solution"

I've chosen to use the following configuration (only 4 of 5 drivers are shown):

enter image description here

The PUL+ and DIR- signals are driven by the Arduino pins (D3 and D4) and form the CONTROL BUS. The drivers (DM's) in turn are connected to this bus through the 3-state buffers hosted on the 74AC11244 IC. This IC actually contains 8 of them. So one IC can be used to connect 2 drivers (not 4 because it uses one enabling signal (nOE) for a group of 4 buffers, see the schematics).

The other part is the ADDRESS BUS. It consists of 5 lines (one for each driver) which are connected to the enable pin nOE of the corresponding buffer group. Addressing is performed by the CD74HC138 3-to-8 decoder (NOTE: there must be only one active driver and therefore only one active address line at a time). The Arduino pins D10, D11 and D12 are used to choose the address (A0, A1, A2), and pin D9 is used to enable addressing (ADDREN).

So the algorithm would be as follows :

  1. Prepare direction (the DIR+ pin)
  2. Choose the motor
  3. Enable addressing
  4. Perform movement (the PUL+ pin)
  5. Disable addressing (all ADDRESS lines are HIGH so all buffers are opened)

Questions

I am a very beginner in solving such kind of problems. And don't even know if my solution is an adequate one at all. So, one more sorry if it is a silly approach. But here is how I see what's going on.

Does it solve the current problem? I think yes, because the Arduino pins are not connected directly to the DM signal lines. The problems which should be addressed in my opinion are

  • The source current of the +5V Arduino pin as it powers all the ICs, and also the sink current of the GNDs. As I know from the datasheets and (again) this post this pin can source 400mA, and GND's are also can source 400mA. Honestly, I am not sure where should I look in the datasheets to answer this question. For example, I see that the DC Vcc or Ground Current for the decoder is +/-50mA. But it's a maximum rating. And what does it depend on? I think it depends on the output of the IC. And the output in turn is connected to the nOE pin of the 3-state buffer whose input current (the Ii characteristic I suppose) is almost zero.

  • Other question is about the output of the 3-state buffer. The crucial characteristic I think is the High Level Output Current which for the 74AC11244 buffer is -24 mA but I can't say whether it is the current per pin or the total current maximum.

This solution also reduces the number of pins used: 6 now.

And obviously it is more easier to write control programs now.

UPDATE

According to @brhans comments I've made another variant without using 3-state buffers. Here the schematics (motors are also shown):

enter image description here

I don't have drivers, motors and 3-to-8 decoder yet, but I've tested the transistor part using 10 LEDs instead of PUL and DIR inputs.

UPDATE 2

This schematics combines @brhans' comments and @Ralph's answer:

enter image description here

I think don't really need to care about the INTs because in my case GPIO ports are configured to be the outputs. Address lines are connected to the LOW level (all bits are zeros). And I think the RESET pin should also be connected to the Arduino (but for now it has been left unconnected).

Documentation

Leadshine DM556 (motor driver)

74AC11244 (3-state buffers)

CD74HC138 (3-to-8 decoder)

2N3904 (general purpose NPN transistor)

MCP23017 (16-bit I/O Expander


Any help will be extremely appreciated. Thank you in advance.

LRDPRDX
  • 151
  • 4
  • You write that you'll only be driving one motor at a time - so by that logic you would only ever need to drive 3 I/Os at a time, for a typical current draw of only 30mA. – brhans Jan 26 '22 at 19:12
  • 1
    You also seem to be ignoring the functionality of the ENA signal to your driver. If ENA to a driver is driven to its disabled state, then it doesn't matter what the PUL and DIR signals are doing - that disabled driver will ignore them. So you could connect all of the drivers' PUL and DIR signals together into a single pair, and then use an individual ENA signal to each driver - for a total I/O count of only 7 pins for all 5 drivers. – brhans Jan 26 '22 at 19:15
  • 1
    However, if you do connect multiple PUL and/or DIR pins together they'll need a higher combined current drive - so you might want to consider using a N-FET or NPN transistor to drive them. – brhans Jan 26 '22 at 19:17
  • @brhans, Thank you for commenting. (to the 1st comment), I don't know if I understand you correctly but I need to drive one motor __at a time__, but I also I need to switch between them. (to the 2nd comment) in the DM datasheet it is said that if `ENA` is not connected than the driver is considered __enabled__. I don't really understand how your suggestion about connection `PUL` and `DIR` together solves the problem. The `ENA` signal doesn't control the current in the other signals : they are just different optocouples (as one sees in the doc). – LRDPRDX Jan 27 '22 at 04:09
  • (to the 3rd comment) I think it supposed to be an addition to the 2nd your comment ? – LRDPRDX Jan 27 '22 at 04:10
  • Something like a 74hc259 or if you want higher current drive, tpic6b259 – Kartman Jan 27 '22 at 04:35
  • I think you're missing the point as to what the ENA signal does in the driver. It's not supposed to "control the current in the other signals" - it's supposed to Enable or Disable the driver. If the driver is disabled, then it makes no difference what the other signals are doing - the driver will remain disabled. Also, I'm not suggesting you connect PUL and DIR together anywhere - I'm suggesting that you connect all 5 of the PUL signals together, and all 5 of the DIR signals together, and then drive the combined PUL with one N-FET or NPN and the combined DIR with another. – brhans Jan 27 '22 at 13:00
  • @brhans, OK. I now understand what do you mean under connecting the `PUL`'s and `DIR`s. I thought you meant that the current through the `PUL` and `DIR` somehow depends on the `ENA` __signal__. And again, if the `ENA`s are not connected then the driver is **enabled** always. – LRDPRDX Jan 27 '22 at 16:49
  • And I think you're right. It's more safer to control these `ENA`s. – LRDPRDX Jan 27 '22 at 16:49
  • @brhans, could you please read the **UPDATE** in the post. Did I understand you correctly? – LRDPRDX Feb 02 '22 at 12:01
  • Yes, that looks great. I would probably choose a lower resistor value for your R1 & R2 to make sure that those NPNs are fully saturated when switched on - probably around 4k7 or thereabout. – brhans Feb 02 '22 at 13:47
  • 1
    @brhans, thank you, got it. BTW, now the 3-to-8 decoder should be `...238` not `...138` (not inverted one) – LRDPRDX Feb 02 '22 at 15:29

1 Answers1

1

Maximum current rating for the chip means what is the maximum amount of current that should be pulled from the outputs, so you did understand correctly.

The second point for -24 mA current for 74AC11244 is per pin, and max per pin is actually 50 mA and 200 mA for all pins combined.

I would keep the pulse signals to the microcontroller (using tranistors as buffers as you did though) and connect the rest of the signals to GPIO chip controlled via I2C/SPI bus, such as MCP23017. If you are again out of pins, then I'd route the pulse signals to a shift register, if precise timing is required.

Ralph
  • 3,026
  • 1
  • 4
  • 22