[LASMO] Making progress in PCB, basic I/O functions

Hi! Last week has been mostly about PCB design. We’re still waiting for our galvanometers and lasers to arrive… Hopefully we’ll have them soon. In the meantime we can’t make much progress about the PCB itself but we corrected some problems.

About the input of the galvanometers, I made a mistake in the voltage adaptation circuit: when the scanner is at its maximum angle, it should be either at -5V/5V or 5V/-5V (positive input/negative input). So we had to adapt the system so that when the ADC outputs 0V, it outputs -5V/5V; when 3.1V (max) 5V/-5V; when 1.55V, 0/0. That means we have to change the resistors values: R1 = 1kΩ, R2 = 2.21kΩ. As Mr Polti pointed out, we also have an issue with the component used: the ADA4941-1 has an output voltage swing of +/-2.9V, which isn’t enough to generate the desired signal. So we decided to make our own adaptation circuit with two ampops that will have the good characteristics (for example, the ADA4666-2 works). The circuit is as follow:

Voltage amplification circuit for scanner input

Meanwhile, I also worked a bit on coding the basic I/O functions of the main controller: I started with connecting the SD slot, testing my code on the development boards we use in practical works this year, OLIMEX STM32-E407. I haven’t been able to test it though, as the only microSD card I have is the on in my smartphone, and I failed to get it out of the phone.  

[LASMO] PCB progress

Externals Clocks

In my previous article, I talk about the STM32F7’s and the STM32F1’s clock.  However, according to the STM32CubeMX and after talked with Alexis, we will use for each controller a 8MHz external clock (for consumption questions) and rise the frequency using the PLL until 216 MHz for the STM32F7 and 72MHz for the STM32F103. According the oscillator design guide for STM32, we have 

with CL the load capacity of the clock wich is 18pF here and Cs the stray capacitance of the printed circuit board and connections wich is 10pF here. So, we have the construction for each controller : 

Also, we have a ESP32devKitC which don’t must to have an external clock because the ESP32 WROOM integrated has one.

XLR connection

We also work an the XLR connection but due to the phantom and the symetrisation we had some problem with the architerture, so we decided to use a jack connector. We talked about an architecture but we change again for RCA connectors which Pierre will talk about.   

DAC to LASER 

The drivers of the laser work with a balanced analog input ranging from 0 to 5V. Since the DAC of the MAX outputs a single-ended signal ranging from 0 to 3.3V , this is an issue we had to resolve. 

We basically had to convert an analog single-ended signal to a other one, and amplify it with a 5/3.3 ratio. We achieved this by using an ADA4500-2 amplifier with two resistances, as represented below.

This circuit is composed of a non-inverting amplifier (taking the out of the MAX5105 as entry), which, with the resistances of 1kΩ and 1.96 kΩ, multiplies the signal by 1+1/1.96 = 1.51 = 5/3.3 (approximately). Then an inverting amplifier with a gain of 1, create aa signal which is going to the input of the laser

After talking with Sam, we decided to delete the DAC_OUT signals from the MAX5101  to the F103 microcontroller because their are not essential. So, we configure the HREF of the MAX5101 at 5V, and not at 3.3 V. So, we don’t need this architecture for the lasers’ inputs.

Project architecture

We also decided about the architecture of our project and about the workflow. I put the configurations files of the STM32F4 controller that we use in TP in order to begin to code with the board that we have. Let’s begin !

[LASMO] SD card and galvanometers in the PCB design

Because finishing the design of the PCB is now the priority task, I’ve been working on several parts of it: namely, linking the SD card connector and the galvanometer drivers.

MicroSD connector

The microSD card connector we found in ExpeditionPCB is manufactured by JAE (Japan Aviation Electronics). The pins correspond to those of the microSD standard and are linked to one of the SPI interfaces available on the STM32F7. MicroSD cards can work on supply voltage from 2.7 to 3.3V, so we just use the same 3.3V supply as the F7.

Our SD card connector’s connections…
… and the pins it’s connected to on the F7 

Galvanometer drivers

The drivers of the galvanometer work with a balanced analog input ranging from 0 to 5V. Since the DAC of the F7 outputs a single-ended signal ranging from 0 to 3.1V (according to the datasheet), this is an issue we had to resolve.

We basically had to convert an analog single-ended signal to a balanced one, and amplify it with a 5/3.1 ratio. We achieved this by using an ADA4941-1 amplifier with two resistances, as represented below.

Signal adaptation circuit between the DAC’s single-ended output (GALVA_X signal) and the driver’s balanced input (GALVA_DRIVERX_IN – and +). The two resistors inside the ADA are of the same value.

This circuit is composed of a non-inverting amplifier (taking IN and FB as entry), which, with the resistances of 10kΩ and 6.2kΩ, multiplies the signal by 1+3.1/5 = 1.62 = 5/3.1 (approximately). Then a inverting amplifier with a gain of 1, create a signal symmetric to the OUTP signal with respect to the REF signal value. We set REF at 5V so that the signal can have a 5V range around the offset value of 5V. That’s also why we linked the REF signal to the GND port of the driver, so that the driver can see the signal as a balanced signal.

[LASMO] Started PCB design

This week, I start to draw the design of the PCB.
I start to add the main components of the PCB, and decide the exact references we need :

  • For the STM32F7, all references available on the ST website are suitable, so I choose the one that was already in the Xpedition PCB library, the STM32F767vit6
  • For the ESP32, Luc choose the ESP32-WROOM-32: it has an embedded Wi-Fi antenna, an RMII interface for the ethernet, and an SPI interface to communicate with the STM32F7
  • For the security microcontroller, I choose the STM32F103RE. This MCU has to integrate 5 ADCs, one GPIO and an SPI interface. So, a very small STM32 MCU is enough.
  • For the triple 8bits-DACs, I change the MAX512 to a MAX5105 because the MAX512 don’t integrate three equal DACs. Moreover, the MAX5105 has an asynchronous MUTE input, which is convenient for the stop of the LASERs by the security MCU

Then, I work on the Ethernet connection. I add a LAN8742A and an RJ45 connector to make the physical layer. I never made design PCB, so I spent a lot of time to find and understand the different components to add to the design.

After finishing the Ethernet design, I work on the MAX5105 connections. This part was easy to make, but I’m not sure about the direct connection (cf figure 1) between the DACs’ outputs and the inputs of LASER drivers. I don’t have the LASER documentation yet, so it’s confusing for me to know how correctly connect these two parts.

(figure 1) MAX5105 connections

This is the newest version of our main components implementation :