Developing Simulink Device Drivers for ARM Cortex

Simulink Embedded Coder offers an ARM Cortex-M support toolbox, which includes code optimisation for the MCU and QEMU emulation but lacks any S-Block drivers for the device. The lack of drivers limits the Simulink development to merely number crunching. You can create cevel blocks that execute external C functions but this requires separate source files with a shared header and pre-defined initialisation, leaving the model without full control of the hardware. In this post, I go over the process of creating hardware driver S-Blocks.

Continue reading Developing Simulink Device Drivers for ARM Cortex

MATLAB Finite Difference Time Domain Acoustic Modelling

As part of MACH Acoustics’ open window research, they wanted a FDTD model to visualise sound waves moving through various window opening scenarios. I created a FDTD function, that would create an impulse wave at a specified position then calculate discrete pressure points across a defined grid size and time step. Geometry (boundary conditions) could be loaded loaded into the function using scripts for different objects (opening, top/bottom swing window, baffle, etc), video saved and pressure, mic, time step data saved for repeat plotting (the solver took a few minutes to run so being able to plot existing data saved time). There is no currently no absorption so the sound does not decay, reflecting 100%. For short periods however this does not hinder the visualisation too drastically.

A GUI I created to control the simulation settings.
A GUI I created to control the simulation settings.

The videos below show it in action.

Opening with internal baffle plotted in isometric using surf

Opening with internal baffle plotted in isometric using surf

Modelling a Double Pendulum in Simulink

One module I took during the final year of my degree was ‘System Modelling and Simulation’. A well taught and great module, one of the tasks was to model a double pendulum.

The approach involved deriving the equations of from the highest order of motion for each mass then working backwards through Simulink blocks to generate each term, which could then be to solve the equation – a bit of a chicken and egg problem! It was a an excellent task as the idea seems a little backwards at first and gave me a fresh approach to problem solving a model.

Below is the method extract from my report as the YouTube demo has generated some interest in the solution.

Continue reading Modelling a Double Pendulum in Simulink

FYP: MATLAB A* Based Path Planner for Autonomous Off-Road Vehicle

A picture says 1000 words

Synopsis

A new venture for the University of Bath and a collaboration with Mechanical and Electrical Engineering, the autonomous quad project aims to convert an ’off the shelf’ miniature quad bike to a driverless one. Generation of a least cost path to a pre-defined goal is required, which avoids known obstacles and will update for new obstacles detected during driving. The A* search algorithm is chosen and a comprehensive planner developed within MATLAB.
Continue reading FYP: MATLAB A* Based Path Planner for Autonomous Off-Road Vehicle