|
Post by turboron on Jan 21, 2020 9:06:31 GMT -5
Chris, can you provide more detail on the Arduino Mega "bogged down"? KU used two Arduino Uno ICs to provide serial input to the Arduino Mega IC. One of the Unos provide oil pressure status and the other provided the throttle position. Perhaps they know of a Mega capacity limitation.
Thanks, Ron
|
|
Deleted
Joined: January 1970
Posts: 0
|
Post by Deleted on Jan 22, 2020 1:11:42 GMT -5
Chris, can you provide more detail on the Arduino Mega "bogged down"? KU used two Arduino Uno ICs to provide serial input to the Arduino Mega IC. One of the Unos provide oil pressure status and the other provided the throttle position. Perhaps they know of a Mega capacity limitation. Thanks, Ron Hi Ron what KU is doing is right ,using little boards ie UNO for smaller tasks I would even want to go further as I would want the data logging function of every point at 1 sec intervals My son had made a 'curing fridge' for sausages and cheese with the arduino doing the control of temp and humidty ,both could be rasised and lowered as required a small screen with touch capability was also installed we also added some data logging to the mix @1 second intevals (bit of overkill) and run the fridge for 10 days with no change to the setpoints we logged two temps (inside and out) and two humiditys and some digital in and outputs After 10 days we looked at the data and found that initially it recorded per second but over time (>10 min) this became more hit and miss ,sometimes every two or 3 sec or even up to every ten sec We tryed to fix this problem thinking it was some kind of 'buffer full' thing or even that the speed of the used SD card was impacting on the interval but in the end we started trying with the smaller cards (UNO) and 'reporting ' to the larger Mega via the serial input which seemed to work better we abandoned the arduino controller when we were given a Horner controller as a tryout This too has some lagging issues only with the data logging side though Once i switch of the engine I have to wait some minutes before all of the data is written to the SD card, this sort of tells us that this little controller with the data logging is at its max Because we want more data we are more than likely going to go back to the auduino (or simular) using mutiple smaller cards for the control and let the Mega play the boss and datalogger function Hoping that this will then be enough to run and collect reliable data More work for John to 'crunch the numbers' ,he does like his data!! Hope this explains the problem we had Cheers Chris
|
|
|
Post by turboron on Jan 22, 2020 5:39:38 GMT -5
Chris, thanks very much for your detailed reply to my question. I think it is important for the community to use the Arduino approach as a beginning Full Authority Control Digital Control(FADEC) due to its excellent Integrated Development Environment(IDE) and readily available cheap components.
Thanks again, Ron
|
|
slittlewing
Senior Member
Joined: November 2017
Posts: 458
|
Post by slittlewing on Jan 23, 2020 4:06:50 GMT -5
Hi Ron, Chris,
Thanks for your feedback! I have tried to make the ECU PCB pretty much universal, as all our engines have the same requirements (1 or 2 fuel pumps, oil pump, cooling fans, sensors for P2,TOT,Oil P,Fuel P,Oil T,Afterburn P). Hopefully anyone could put some code into an arduino and have it control their engine.
So far I have had no issues with the single arduino running slowly, except when circuit voltage was lower than 5v (i.e. if I powered both Arduino and TFT screen from one USB lead). If I did that, the arduino ran very noticeably slower. My PCB board therefore has one 5V regulator for the arduino (rated at 2A), and a separate 2A one for the TFT display.
My code has a reasonable amount going on (2 serial connections, 4 exponential moving average filters, 4 PID controllers, plus the actual calculations and logic for running the engine and handling all the inputs and outputs), and when I compile it the IDE tells me I am using 21% RAM and 8% memory on the Mega. This affirms my belief that I am nowhere near the computational limit of the single arduino. Bare in mind these boards can run conventional IC engines (search speeduino) which means doing the calculations for crank angle /spark/dwell/injector timing within milliseconds! That said.. the proof will be "in the pudding" haha
Cheers
Scott
|
|
|
Post by turboron on Jan 23, 2020 8:26:23 GMT -5
Scott, thanks for your detail response. We look forward to your future posts on your FADEC digital control.
Thanks again, Ron
|
|
|
Post by turboron on Jan 23, 2020 8:43:38 GMT -5
Scott, do your PIDs use integer or float(double) digits? Integer was used on the FADECs on the 90's industrial gas turbine digital controls I worked on. The PID I am considering from the Arduino library is float(double) digits.
Thanks, Ron
|
|
slittlewing
Senior Member
Joined: November 2017
Posts: 458
|
Post by slittlewing on Jan 23, 2020 16:51:50 GMT -5
Hi Ron, My code uses float/double throughout as I thought it too much hassle to interpret raw integer values (particularly as my analog sensors all have different gains per volt). I know float calculations are much slower compared to integer but the program isn’t that big so I think it should be fine. Here is the assembled PCB with arduino fitted upside down in the middle: [/a]Next I need to verify inputs and output functionality with the pcb. Cheers Scott
|
|
|
Post by turboron on Jan 23, 2020 19:56:18 GMT -5
Scott, thanks for the comments on the PID. Your PCB and display have me drooling.
Thanks again, Ron
|
|
slittlewing
Senior Member
Joined: November 2017
Posts: 458
|
Post by slittlewing on Jan 24, 2020 9:13:01 GMT -5
Scott, thanks for the comments on the PID. Your PCB and display have me drooling. Thanks again, Ron Haha Ron you are welcome to purchase a bare PCB once I know if it works! I will also upload my code to a file sharing site once I have tested it 🙂 Cheers Scott
|
|
Colin Heath
Junior Member
Joined: January 2020
Posts: 77
|
Post by Colin Heath on Jan 25, 2020 15:17:08 GMT -5
Interesting work on the controls Scott. I was heading down the route of a PLC to control my engine because I have software for it and its what we use in automation of our machines.
I have never done anything with Arduino but keep getting my curiosity tweaked with stuff like this. Maybe time to get a small starter kit and build something.
|
|
|
Post by turboron on Jan 26, 2020 9:51:40 GMT -5
Colin, Arduino is inexpensive, had a great IDE and has extensive information on the web. Arduino sells a starter kit that is cheap and will get you started on programing. The kit is readily available through Amazon and others for around $80.00. SparkFun and Adafruit also have a lot of Arduino components.
Thanks, Ron
|
|
slittlewing
Senior Member
Joined: November 2017
Posts: 458
|
Post by slittlewing on Jan 27, 2020 6:46:26 GMT -5
Interesting work on the controls Scott. I was heading down the route of a PLC to control my engine because I have software for it and its what we use in automation of our machines. I have never done anything with Arduino but keep getting my curiosity tweaked with stuff like this. Maybe time to get a small starter kit and build something. Cheers Colin, I have to admit I have not tried programming a PLC, but the arduino functionality is only really limited by your imagination so it’s easy to filter signals, change logic or algorithm in a few minutes. I bought a Mega from amazon for £12 and a breadboard kit on eBay for less than £10!
|
|
Colin Heath
Junior Member
Joined: January 2020
Posts: 77
|
Post by Colin Heath on Jan 27, 2020 18:06:41 GMT -5
Thanks Chaps. Our boy is keen to have a go so that made up my mind Will be watching with interest
|
|
slittlewing
Senior Member
Joined: November 2017
Posts: 458
|
Post by slittlewing on Feb 25, 2020 11:25:33 GMT -5
Its been a little while since my last update, I have had my busiest few weeks of the year at work and haven't been able to devote much time to the bike. Now though, I am able to get back into it! On the Arduino side, I tested my board/code a little further. The good news is that my code runs very quickly on the single Arduino Mega, easily quick enough to control the engine and do all the calculations/PI Controllers etc. The bad news is that I found the dash display was slowing things down. The "Nextion" display comes with a library and communicates via serial. I had my code updating all the gauges and values once every 40ms, however the Nextion "library" asks for confirmation after every transmission. This meant a big slowdown occurs once every 40ms. I will get around this by either reducing the update rate (maybe once every 150ms for example), or more likely updating a single gauge/value every 40ms but cycling through them sequentially. One other thing, I had one piece of wrong wiring on the PCB. I supplied 5V to the arduino on the "Vin" Pin, when it needs 7-12v. I reworked the PCB with some link wires to correct it. I decided I had to invest in a 3D printer to finish the bike, there are lots of small bits to make - an ECU enclosure, ignitor enclosures, dash etc. Here is the first major part - the ECU enclosure. This incorporates a hole for the wiring, cooling holes on one side, 2x 30mm fans on the opposite side, slots to feed wires around the PCB and upstands for the PCB. 50 sided dice rollerNow I have moved the bike into my kitchen as its dismally cold and damp in the garage, to begin wiring. (Thanks to the patience of my other half ) I have not yet tested the "high side drives" on my PCB, so hoping they work as the prototype did!
|
|
htevo80
Member
Joined: November 2018
Posts: 36
|
Post by htevo80 on Feb 25, 2020 12:02:38 GMT -5
Hi I use a simple serial write command for my nextion with !!! To end the string and I only update every 250ms with not really a noticable stutter I don't use their library to keep things fast. But great work on the ECU looks like production piece. Gavin
|
|