Posts

Custom Mountain Bike Suspension Yoke

Image
Custom Mountain Bike Suspension Yoke Project Goal Test CNC capabilities and quality of JLC PCB's CNC machining service The part I decided to design is a replacement suspension yoke for my YT Capra Core 2, here is the final result mounted on the bike: The Process Took off existing suspension yoke from mountain bike Re-model it in Solidworks 3D print to test fitting on bike Generate engineering drawings for tolerances and threads Upload to JLCPCB for quote - it was ~$60 USD Wait 1.5 weeks for it to arrive Results The machined yoke from JLC PCB (left), the existing yoke from factory (right) The original yoke was made from Aluminium, not sure the specific alloy so I requested 6061 as most bike manufactures use that The mass is ~50g lighter than the original yoke - due to a slightly modified design I have been riding it and so far no issues. Simulation indicated all experiences loads are within the capabilities of 6061 Al.  CAD Model

Pseudo-FOC Controller - Simulations and Inital

Image
As a part of my FOC controller, I am developing an intermediate project - the  Pseudo-FOC Controller. This post will introduce the theory, simulations, and an initial prototype of the project. At its core, this controller uses sinusoidal commutation, which is being implemented through the inverse Park and Clarke transforms. Project Goals The goals of this project are listed below: Control torque, speed, and position of a PMSM - specifically for gimbal and drone grade motors Develop a PCB for the controller Develop auto-tuning algorithms for controller gains Develop an auto-calibration sequence for the rotor position sensor BLDC vs PMSM A key point of confusion is motor classification of permanent magnet machines - specifically between Brushless DC Motors  (BLDCs) and Permanent Magnet Synchronous Motors (PMSMs). In my experience/readings, the differing factors is in their back-emf profile: BLDCs having a trapezoidal BEMF and PMSMs having a sinusoidal BEMF. It is also important to note t

Completion of the VFD - PCB and Demo

Image
  This past week the PCB order was delivered from JLCPCB. The traces came out great: The VFD PCBs I used THT components since I was not familiar with JLC's SMT service and I had plenty of the required components stocked. From the image below, the modulation index (MOD INDEX) potentiometer is not being used since I decided manual amplitude adjustment is not required. The assembled PCB with component The VFD uses open loop volts/frequency (V/Hz) control. In a nutshell, V/Hz control works to keep the ratio between applied voltage and frequency constant such that the flux in the rotor is constant. This means that across different speeds a constant torque is applied: $$\phi = \frac{V}{4.44 f K T}$$ For this motor the V/Hz ratio is $120 V / 60 Hz = 2$. This means that is the frequency is increased by 1 Hz, the voltage is increased by 2 V.  Induction motor speed vs voltage characteristic From the graph above, in the linear region, this V/Hz ratio can be seen as the slope of the line. For

VFD Updates - More Prototyping and PCB Design

Image
Several things have been done since the initial prototype: the prototype has been further tested, the motor has been validated, and the PCB has been designed and sent to the FAB. Here is an image of the rendered board: The PCB render Prototype Validation The prototype has been changed - specifically gate and pull-down resistors were added. A big change is that the inverter generates a 12 V peak to peak signal which is then boosted up to 120 V RMS by a transformer and powers the motor. This was done instead of having a 120 V sine wave be generated as an isolated power supply would be needed for the logic components, however the current being drawn at the inverter stage is significantly higher. Here are some key waveforms generated by the inverter. The switching voltage between inverter legs A and B The filtered output voltage The firmware is running a 100% modulation index, thus showing that the output wave has peaks of $\pm V_{dc}$ or $\pm 12 V$. The frequency can also be modulated to

VFD Inverter Prototyping

Image
I began prototyping the VFD circuit discussed in the previous post, specifically the inverter stage. I modified it to be a single-phase full bridge inverter instead of the three-phase simulated. This is due to me using a single-phase shaded pole induction motor for testing down the line - 120 V, 60 Hz on the nameplate. Here is an image of the circuit: Full-bridge inverter circuited Before making the circuit, I simulated the inverter in LTSpice. Similar to the PSIM simulation, a bipolar switching scheme is being generated for the SPWM signal. Inverter legs and gate driver ICs Bipolar PWM generation and output filter For the spice simulation, LTC7061 half-bridge MOSFET drivers are being used. In the actual circuit I sourced IR2104 gate drivers however they both do the same thing so I opted to use the default Analog Devices IC in LTSpice.  Picking Bootstrap Capacitors The gate driver ICs require a bootstrap capacitor and diode. For the diode I picked a standard 1N4148/1N4007. However, to

Variable Frequency Drive for Induction Motors - Overview and Design

Image
I began a new project to design and construct a Variable Frequency Drive (VFD) for AC induction motors. The purpose of this project is for me to apply some of my power electronics knowledge of inverter design and also aid me in my FOC project since the power stage of this drive is similar (FOC just has more complex control algorithms). This post will cover some the high level design considerations and some preliminary simulation of the VFD. Background - Induction Motors To me motor drives are super interesting as AC motors are used everywhere and they are the basis of many machines. More specifically, AC induction motors (invented by Nikola Tesla) are the most popular motor kind - 90% of motors used in industrial and commercial applications are induction type.  To see how a VFD works it is important to know how an induction motor works. At a high level, the induction motor, like many AC motors, is made up of a stator and a rotor. The stator is made up of windings - for a three-phase mo

AS5048A Magnetic Encoder and STM32

Image
This past week I began to write the controller firmware - mainly playing with the AS5048A angular position sensor from AMS. Here is the datasheet .  This sensor will be used to get the rotor position and then compute the resulting electrical angle for the Clarke/Park transforms and also it will be used to find rotor speed for the out loop.  I will be using an STM32F446 board to run the loop as it has a high clock speed. The AS5048A sends its measurements over SPI. Below is the read package sent from the sensor: We get 14 bits of position data - aka 16384 ticks per revolution, or a resolution of 0.0219 degrees. I wrote this read() function that sends the SPI command package and reads the resulting response: uint16_t read(uint16_t registerAddress) { uint16_t command = 0x4000; // PAR=0 R/W=R uint8_t RxBuff[2]; uint8_t TxBuff[2]; command = command | registerAddress; command |= (uint16_t) (spiCalcEvenParity(command) << 0xF); TxBuff[0] = command >> 8; TxBuff[1] = co