60V 2A Motor Driver

  

This is a micro controller using DRV8313 which basically is 3 x Half H-Bridge drivers in a chip supporting 60V and 2-3A out. The design is excellent for a 3-phase driver, DC Motor or solenoids and work perfectly.

The initial version had an issue with the 60V DC/DC that needs to be fixed. DRV8313 have a 10mA PSU, but this is not sufficient to drive the MCU and CAN Interface. The pics are from testing on DC/DC notice the capacitor “Tower” at left. These are the fix for the DC/DC.

Located on this is also Hall Sensor interface and some IO options. I will add a rev 1.1 of this. The MCU is either STM32F103 or STMF303. The picture show early testing of the DC/DC only. This is a bit larger that the DRV10983 base driver, but it is so much more fun to be able to drive the 3-phase from the MCU.

I need to modify DC/DC and I also want to add at least 1 phase current sensor to be able to drive the motor better. DRV8313 have capability for 3 x phase current sensors and STM32F303 have PGA etc. But, looking at that Board I also realize that I am out of Space.

  1. 60V 2A
  2. CAN Interface
  3. STM32F303CB or STM32F103CB/C8
  4. DRV8313
  5. Hall Sensors
  6. GPIO pins

28V/2A 3-Phase Driver

This is the smallest of my dedicated 3-phase controllers using DRV10983 and STM32F030F4. The entire controller is the size of a fingertip and will run a 3-phase motor using sinusoidal algorithm. The controller works, but I was not impressed over it so far because it tend to loose control over the motor I use for testing and start drawing to much current until it stops on over-current.

It is an excellent design controlling a motor 28V/2A from a very small design. It has 2 interfaces as you can control the motor through pins or I2C. The design needs to be optimized, but it’s nothing wrong with it so I want to see if I can get more control of the motor. If not it is not worth continuing using DRV10983.

30V 20A Motor Controller

This is my old universal motor controller that actually worked quite well. The main challenge I had was dodgy MOSFET’s. As I moved on I also moved to 60V and 50A + a Hat design that is a bit larger, but I have been thinking about updating this smaller design as well.

Todo on rev 1.2:

  • Max 30V, meaning 24V
  • Max 20A. I think 15A is more realistic, but the MOSFET’s can handle very large puse currents.
  • 4 separate Half H-Bridges as before
  • 4 BEMF sensors
  • 4 Current sensors. Revision 1.0 uses INA210, but I want to swap that for INA193/INA194.
  • Simplify some filters because we can do them in SW.
  • Replace PSU with 7812.
  • Replace LM1117 with SPC3819
  • Add connectors for caps on top.
  • Add 2 temperature sensors between MOSFET’s.
  • Replace connectors with JST Micro.
  • Add space between Shunt and connectors.
  • Remove 6 screw holes.
  • RS485 as before, but see if I can add CAN and TTL UART.
  • Export more spare IO.

8 x DC Motor Hat

This is the updated 8 x DC Motor Hat w/16 x Sensor IO’s. I have 3 Hat’s that I will order with PCB stencils this time. This Hat was basically made for a robot arm I have build by DC Motors. It’s a bit of fun to see if I can control the arm automated as DC motors don’t have any positioning.

Changing the blog

I don’t have the answer to this riddle yet, but I am searching for a more structured way of doing this blog that don’t involve myself digging into web development. I simply don’t have the time (or skills), so I am depending on either someone else assisting or finding a plug & play solution.

At present I use WordPress that is very capable, so I will look into different templates. What I want is to continue the blog as the main page, but I need articles to go on separate project pages to allow more continuity. I also want to re-open the comments field and add Forum as I move forward. I actually own both BasicIP.Org, BasicIP.Net and BasicIP.Com, so I might put them to use as well.

I guess what I am saying is that you might see a lot of experimental changes the next days/weeks before things settle. For now I will try changing Categories to be projects and see how that works out.

Unipolar Stepper Example

The logic for driving these stepper motors are straight forward as you apply 4 or 8 steps. The 4 step logic is faster and you rotate in a circle CW or CCW:

  • Step 1: 0 + 1
  • Step 2: 1 + 2
  • Step 3: 2 + 3
  • Step 4: 3 + 0

This will create a movement in one direction as you only move one step at the time, meaning you have position Control and speed Control by how fast you apply steps.

The 8 step logic is similar, but only uses half the speed.

  • Step 1: 0
  • Step 2: 0 + 1
  • Step 3: 1
  • Step 4: 1+ 2
  • Step 5: 2
  • Step 6: 2 + 3
  • Step 7: 3
  • Step 8: 3 + 0

To decrease the stepper logic even further we need to get a bit smarter because direct 0 and 1 logic cannot help us more. We can control speed and direction. Maximum speed us set by the minimum time we can have a coil on before it moves. I found that to be ca 3ms on 5V, but this will vary depending on the Stepper Motor. If you use 12V on a 5V Motor (which is a bit naughty) you might find that you can do this faster.

A stepper can’t increase speed much further due to cogging torque that is very strong on a stepper. On a 3-phase motor this will be weaker so we can increase speed though acceleration. This is not impossible, but it is not what a Stepper is created for. We can however decrease the steps further for a more accurate positioning system.

You have to be aware that as you decrease below full steps you also decrease the holding torque and your chances of a miss-step increases.

To decrease further we need to apply an analogue value on the steps. If we as an example allow a step to be 2.5V and 5V this would allows us to create a 16-step algorithm. But, how can we create an analogue output value using only PWM?

The answer is that a PWM with 100% duty is the same as 5V, while the same pulse with only 50% Duty is 2.5V. To drive a step we need output voltage on for a minimum of time. If we stop we will be “holding” that signal, so what we do is to build a PWM signal from a higher frequency where we can manipulate PWM duty and hence create a different analogue output value.

The picture above illustrate the two pulses. The 5V pulse is always on giving 5V out, while the 2.5V pulse is 50% on/off creating 2.5V output value. This will now allow use to create 16 steps. In fact using a sinusoidal curve we can now create as many micro-steps as we want.

The last trick is how you apply the 2.5V output value, because step 1 with 2.5V and 5V is still the same position. To use these mid positions you will always need 2 coils. Full steps are then one coil is on and the other off. This gives 2 position only. But, as we now can apply 2.5V we can evolve the logic as follows:

  • Step 1c: 0=5V (full step)
  • Step 2a: 0=5V, 1=2.5V
  • Step 2b: 0=2.5V, 1=5V
  • Step 2c: 1=5V (full step)

If you complete this table you will have 16 steps. And by adding 25% duty steps you have 32 steps etc. But, remember that cogging torque that hold your position will be weaker, so these micro-steps do come at a cost.

Programmable Function/Audio Generator

I bought a kit with AD8950 earlier that I consider using to create a programmable function/audio generator. AD8950 can generate waves to very decent frequencies and cost ca 10.- USD. AD8951 cost a bit more and it is straight forward to create a DDS/DAC based on these. But, I also need a driver stage where I can select output voltages in positive and negative values. The later is more important than high frequencies, but I could have 2 output’s – one 3.3V signal and one +/- with a programmable voltage selection.

The base concept is similar to creating a DC/DC PSU, but with the exception that I use AD8950/AD8951 to create the “PWM” signal. Also, since the signal is an actual waveform we need to use linear transistors like a high frequency audio amplifier. It would be nice with 1A out, but 100mA is also ok.

The more difficult stage is to be able to program the +/- output levels. One way of doing this would be to use 2 DC/DC converters in series. The first to set +/- DC levels for a Waveform amplifier. But, I will need to do some research here.

This would however be an awesome Hat and I also wonder if I could put the 2 x I2S and/or DAC channels on STM32F405 to use to generate waveforms rather than using AD8950/AD8951. I would not be able to reach the same frequencies, but I am pretty sure I still can reach decent output frequencies and we could play audio files/channels as well.

Using DAC/I2S I can probably generate waveforms up to 200Khz. Using AD8950/AD8951 I can reach 20Mhz at least.

At this stage I want to let the ideas mature a bit while I do research and talk to friends more skilled in analogue electronics than I am.

Programmable DC/DC

One of the ideas I am playing around with is to make my own programmable DC/DC PSU based on a MCU. The technique is very similar to a driver channel on a motor by generating a PWM signal. To get a DC out you add filter(s). If you have 48V and 50% PWM duty the output should be 24V etc. The advantages of doing this is that I can switch PSU’s on/off, monitor system currents and use the same module for 5V, 12V, 24V and 48V. And with some of the SO8 MOSFET’s I have used I can deliver 10-15A from a Hat size PSU. I also get the advantage that I can deliver multiple voltages from one input Source and Control how I ramp up/Down Power in a system.

I have done the experiment with the motor drivers, so I know this will work. My main concern is the space needed for capacitors and coils for 10A.

The illustration above also show a PSU line with a relay and current sensor. It is also an option to simply have 3-4 relays, current sensors and capacitance to control power delivered from external modules. The advantage of this is that I can just buy 3rd party PSU’s and plug them in, but it will require a bit more space.

It would most definitively make an interesting project as we also could add programmable output curves like a low frequency function generator.

Space is a concern because I need to take into account that I am driving motors, so we need output capacitance and protection. It might be that a Hat size format is out of the question both due to size and height requirements for the components I will need.

60V DC/DC Working

Good news is that TPS54160 is working. C5 & C4 did the trick of getting me past 35V input. I tested 50V In for now. Minor is that the values shown on R1/R2 and R5/R6 are wrong. R1/R2 can be dropped to always enable the DC/DC. R5 needs to be ca 140K for 12V, the value shown is 3.3V.

A bit more annoying was the three caps in red. This pic looks like it is sufficient space between them, but it was not. I did not have 4.7uF caps in 1206 size, so I used 10uF (yellow) that worked fine.

I am also a bit concerned about the height of those 1000uF/25V capacitors, so I might need alternatives here. Always good to get a PCB so you can deal with mechanic changes as well. I also wonder if I should add a different connector for 12VE, 5VE and 3.3VE signals to make it easier to connect them to a MCU.

A bit concerning was that the first TPS54160 only gave ca 50% output values. As I changed to a TPS54060 the output value became normal according to datasheet. Datasheet ask for very accurate resistors etc, but I don’t care as long as the output voltage is ca correct.

But, all in all this was a success. I am really happy to see TPS54x60 working as expected.

Motor Controllers

These are the 4 different motor drivers I have made so far.

The smallest (at left) is capable of 24V @2A. It uses DRV10983 and one of the smallest STM32’s. I got it working, but I had some trouble controlling the logic to behave.

The second one uses a DRV8313 that basically is 3 x Half-Bridges. This works perfectly, but I am not to happy with the Hall Sensors on it + I had some challenges with 30-60V supply. I was however very pleased with the performance of DRV8313 which is why I also use this for a Hat.

No 3 from left is a 24V @ 15A on 4 separate Half-Bridges. This is designed to drive a decent 3-Phase or Stepper. I tested the driver for 10A fine, but I had serious challenges with dodgy MOSFET’s from Asia on this. The only part that I have not been able to get working is INA210 current sensor, but I have 9 left. My initial thought was to abandon this design because the next one is so much more powerfully, but it is also a matter of size. I was all in all quite pleased with this design.

The last one at right is an upgrade to 60V and 50A + I use the Raspberry PI Hat format. The story of this one is yet to be told.

The designed max effects are 48W, 120W, 240W and 3KW