It’s working! As far as I can find, this is the first example of an MCP2515 CAN SPI module working with an ESP8266.
Previous post on my setup with ESP8266 and MCP2515
I have just bought another ESP8266/NodeMCU development board cheapy from eBay (this one) with an ESP-12E chip on board. I’ve also bought an SPI-CAN bus interface with the common Microchip MCP2515 CAN controller to try and create a CAN-Wifi gateway.
I have been busy over the last few weeks with various things, but have now completed most of the practical work on my project and am now at the stage of writing up the report/dissertation. I have successfully managed to achieve closed loop ignition timing control by using the Stellaris Launchpad development board to directly interface with the optical encoder on the engine and the pressure sensor charge amplifier (this replaces the AVL IndiSet 620 in my system).
Just a quick one on what I’ve been up to the last few days. I now have the engine set up inside so that I don’t have to keep pushing it outside or waiting for the rain to stop. I’ve also set up an optical encoder, in-cylinder pressure sensor, and AVL IndiSet high speed data acquisition unit to capture data on a 0.25 degree crank angle resolution.
More progress made today, I connected up the alternator to the engine to begin testing it under load. This was pretty successful, and the ECU all performed as expected, with only a few tweaks to the PID controller parameters to improve the AFR control. I restricted the range of fuelling down to as restricted as possible to prevent the system setting wildly large or small fuelling amounts under certain conditions. I finally managed to get the PID to maintain the AFR slightly rich within a few percent under steady state conditions.
I have now managed to run the engine with electronic fuel injection (EFI) and electronic ignition, both controlled from my ECU. I’ve also managed to run in closed loop lambda control to maintain the correct air to fuel ratio.
Success! I have started and run the engine on my own electronic ignition. The problem was in the end quite simple, it turns out that the missing tooth wheel on the crank was aligned differently to what I expected. I thought that the missing tooth occurred 240 degrees after TDC, but in fact it appears to be aligned almost exactly at TDC. This meant that my spark was happening around Bottom Dead Centre, which is no use at all!
Having thought I’d almost nailed my ignition timing problems, I tried testing at higher engine speeds (up to 6000 RPM) only to find that the ignition timing began to become erratic again.
From my couple of brief tests, I’ve identified a few problems which are preventing the engine from starting up and running for more than a few seconds.
I have now managed to successfully map my engine simulator for the fuel injection timings across all loads and engine speeds. I have set up a two dimensional array, of speed and throttle position, and inside each element is the time in microseconds (us) that the fuel injector should be open for. I’ve also added closed loop lambda feedback.