MC3X60V Working

I am only using 12V, but DRV8313 worked on 2nd attempt. First failed so I ripped it off, revoved a lane and placed a new that worked straight up. Just using trapsoidal for the moment, but it’s a start.

I need to code up a Sinusoidal algorithm and better Acceleration and Speed Control. I also want to see if I can get Hall sensors working.

MC3X60V DC/DC working again


This was a bit of work. Soldered 2 x 10uF in a bridge – simply removed the protection TVS for now. If you look next to the led you also see space for a coil where I use a 1206 component, so I can probably squeeze the 1206 caps in there. I don’t want to try 60V yet, I want to solder on and actually test the motor driver. I scoped 3.4V and it looks real nice. I will dig deeper into that later to see ripple.

New Micro PLC design

I have done a few PLC system drafts – one based on Raspberry PI, a second larger one and a 3rd based on distributed components. The pure PLC system was “ok”, but it was a bit larger with the bus than I expected. Looking at some of my 50x20mm designs I wanted to try a 50 x 50 mm design where we plug in a CAN/RS485 bus. The objective is to make a component based system that is very small.

The idea for this came as I stacked my CANUsb adapter and small motor controller (50x20mm) together for fun – I might even use that small format, but I think 50×50 is better. Worth a try.

As

60V DC/DC

This is the PSU from the MC3X60V – my small motor controller. It snapped at 35V. To save space I omitted the components in the yellow circle.

Reviewing this with a friend I believe that C10 is the cause. This circuit need a small cap close to TSP54060. I already know that this circuit misbehaved without the larger motor caps mounted (not shown), so it is something to this, but we will see as I get around to patching a PCB.

The resistors R11 and R12 should be ok according to the datasheet. This set the under-voltage cut off and can be left floating – or more correct that is my interpretation of the datasheet for TPS54060.

I will see if I can patch one of the PCB’s as proof of concept, but I also want to make and order a break out board for a few of the 60ich V designs. As you can see above – the PSU is in the top-left corner and I don’t have much space here either. Also – again I will need to allow 60V components on C10.

Next question – Is this actually a 60V design?

The answer is NO! The circuit say 60V, but if you actually operate a motor controller on marginal design terms you will break it. This is a design for 48V with a max limit of 60V allowing it some tolerance.

MC3P60V Cap Change

I was rather pleased with routing MC3P60V because it is a dense, functional design. But, as I reviewed the design I found this. The error here is that this is 60V and I used 0603 packages. 0603 usually hold 6ich V, so I will either need to upgrade to larger 60V or try something else.

 My first thought is to use 2 x 1206 components in series to achieve 60V, but I need to check around what I can get and actual size of components. I have 2 of these cap circuits related to DRV8301.

And looking at the current PCB you can see that I am a bit out of space. I have a heat-sink that cost 1ich USD and that is perfect size, so I seriously do not want to change size on this design.

What IDE should I use?

I am a big fan of things that just work, which is why I have stuck to Coocox and CoIDE for years. But, as it now looks like this tool is dead I basically need to move on.

Coocox had a very good concept and was one of the few Eclipse based IDE’s I liked, so it is sad to see them go. But, I understand they could not make money from their business model and in the end gave up. Their site is now down and I am stuck with version 1.7.8.

Looking at alternatives I find the following:

SW4STM32 is free and supported by CubeMX. I will discuss CubeMX a bit later.

Em::Bitz is free and have reached version 1.1. This originate from Code::Blocks and was previously Em::Blocks that now is forked into Em::Bitz. The drivers supported here are only the old drivers, but you can dowload and set up new ones as well.

TrueStudio is a commercial IDE, but it has a fully free version for STM32 as well. It is also supported from CubeMX and is Eclipse based.

I will be evaluating these options over the next days and share my findings with you. The one I am curious on is EmBitz. This is unlike the others based on Code::Blocks and written in C++. I mention this because performance do matter and I hate tools that forces me to care about Java versions installed on my computer. Why should I as a user need to care about what my tools are programmed in? But, using a Java based tool you often need to do that. The other issue is that C++ developers tend to have a better gasp of what is needed for Embedded C/C++ development. With one exception – CoIDE will be missed. Their concept was good.

3-4-phase – Motor Controllers

I have a load of motor controllers that I want to continue on, but to focus on the more advanced ones.

MC4X60V50A

This is an early draft of rev 1.1 of the MC4X controller. Notice the heavy wiring at right to support 50A + all components top-side so I can add heat-sink on the PCB. All transistors have pad’s and being cooled at bottom. Two temp sensors added between MOSFET’s.. INA194 as Current Sensors, CAP’s on the PCB etc.

The results from the previous 1.0 version was actually so promissing that I am looking forward to this one. But, it is still work in progress.

MC3P60V50A

This has been in the pipe a few weeks. It is a dedicated 3-phase controller. It is 15mm more narrow than MC4X60V50 and uses DRV8301. I want to do an upgrade before I ship for this – some of the small capacitors are 0603 and need to support 60V – that will not work + I need a better place to mount the main capacitor.

Comparing MC3P and MC4X I must admit that I get a lot of functionality for those 15mm extra. MC3P is a bit smaller, but MC4X can do the same and more. I still want to do MC3P because I want to play with DRV8301. ANother change is that I consider putting wires on top so I can use a 100x25mm heat-sink on PCB-bottom.

Another concern is that I on this planned thick PCB lanes on power – simply creating a thick solder path. I am considering upgrading that to wires like I did on MC4X.

MC3X60V3A

This is the smaller of the 60V design. First test failed at 35V, but I have been advised to make a change on the DC/DC that I want to try out.

MC3P28V3A

This is the smallest based in DRV10983. It works, but I am not impressed over DRV10983 speed regulation. I will find more time to play with the I2C interface on this, but I need to see a better controller if I am to continue with it.

CAN Interface

I finally got revision 1.1 of these boards yesterday, so I can get on with this adapter. The main error on 1.1 was lack of crystal and I realized I needed the crystal for USB as I tested.

I like CubeMX, but I fail to undestand “designers” that want to create a “HAL” and only do low level, MCU specific interface. In this example I would have liked a function to select bitrate, but are left with setting up loads of timing details.

Even more annoying was that the generated project for STM32F105RB do not want to compile due to lack of files. This is where auto-generation and I usually separate.

 

CubeMX FreeRTOS Config

The config system in CubeMX allows you to configure and generate code for all components you have included, including FreeRTOS and libraries. This page show the config for FreeRTOS and it allows you to create a list of Tasks as well as message queues.

The folders on top are

  • Config Parameters
  • Include Parameters
  • User Constants
  • Task & Queues (shown here)
  • Timers and Semaphores
  • FreeRTOS Heap Usage

The reason why I like this is because I don’t know FreeRTOS and within a few clicks I am using it and on my way into functionality. FreeRTOS is also included in ESP32 IDE supporting multiple cores and have been around for years.

STM32CubeMX

This shows the STM32CubeMX for my 3 x RS-X PLC Module. I find this tool to be quite usefully as it allow you to set up the clock, configure each function and wire the MCU. It also generate a nice PDF document with all details as well as a starting project with all init code as well as FreeRTOS should you want it.

The generated code opens in System Workbench for STM32 and the only complain is that they only support C. But, you should be able to get C++ with a bit of manual work.

It all works well with a low cost ST-Link, so you are on your way blinking a status led within minutes.

System Workbench for STM32 is far behind CoIDE and CooCox, but I still use CoIDE 1.7.8 and as CooCox seems to be down (?) I need to move on. My main concern is lack of C++ support which sadly is very common in many embedded IDE’s. Returning to STM32CumeMX, this tools is free from ST and a big time saver. It download latest drivers and give you working examples on how to initialize the MCU. It also warns you about wiring conflicts and does the job of setting up the complex clock.