Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 01-30-2017, 03:14 PM   #61 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Hi t vago
Quote:
Originally Posted by t vago View Post
I'll add it in, but it won't be a priority.
It's just a suggestion, I'm not in need of this, so is resets that are not practical either, perhaps when the menu is implemented, you can create a sub-menu for resets only.

Quote:
Originally Posted by t vago View Post
However, I do have some good news - My code now is able to use the TWI as an output interface. I have it using a SainSmart 2x16 LCD module for now for testing, but I hope to have that Adafruit RGB LCD shield fully functioning by the time the week is out. After that... a TFT interface? Why not?
I lifted the TWI code from the twi.c code that was part of the Arduino Wire library, and have cleaned up extensively and modified for use with the code. I hope to have it be able to support buffered output very soon. Yes, TWI is itself buffered, but it acts in practice as an extra digital input/output port, with all of the timing constraints and pin manipulation requirements, so I still have to do all of the port manipulations that I did with the original legacy 16x2 LCD module.
I also plan to try to implement LCD brightness over TWI that isn't either off or eyeball-scorching on.
This is not good news, it is excellent news.

Thanks
José Rodrigues

  Reply With Quote
The Following User Says Thank You to josemapiro For This Useful Post:
t vago (01-31-2017)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 02-01-2017, 12:13 AM   #62 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Coding goes slowly, but I am making progress.

I have convinced the code to use the display portion of the Adafruit LCD module, and that includes being able to display any of 7 separate colors for the backlighting. I've also further streamlined the TWI module. I figured out a really neat trick with regard to sending 4-bit values to LCD displays over TWI, and I'm actually surprised that it's not part of any of the TWI-compatible LiquidCrystal libraries I've seen so far.

Next, going to try to get the code to read the buttons every 15 ms, from within the timer0 overflow interrupt. This might cause some sort of performance degradation on the LCD display, so I might have to bump up the TWI base frequency from 100 kHz to 400 kHz. Unfortunately, the Adafruit LCD module contains no provision at all for having the button presses generate an interrupt, as the legacy 3-button interface does. The buttons on the RGB LCD unit must be polled.
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
josemapiro (02-01-2017)
Old 02-01-2017, 12:07 PM   #63 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Without a doubt, the work that you have been doing with MPGuino is fantastic.

Thanks
José Rodrigues
  Reply With Quote
Old 02-04-2017, 07:06 PM   #64 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
I just had a derp moment. I think it may easily possible to have MPGuino calculate the usec/gallon and the injector microsecond delay, given two separate fillups. The procedure to do so will be remarkably similar to how I will tackle coastdown.
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
Ardent (02-04-2017)
Old 02-04-2017, 07:23 PM   #65 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
That's be cool.
  Reply With Quote
Old 02-04-2017, 10:46 PM   #66 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by smonson View Post
Here are the results of my observations

The following maths treat all cylinders as a single measurement. Figures will be 4 times higher than the real value for a single injector.

WARNING: PEDANTIC GUY AHEAD

Tank 1 (country):
- predicted 28405mL
- actually 28360mL (error: 0.15%)
- PWM fired 332468 times for 2195.598 seconds
- average pulse width: 6603uS
- average fuel quantity injected: 85.301uL

Tank 2 (city):
- predicted 30954mL
- actually 30950mL (error: close enough)
- PWM fired 385078 times for 2403.540 seconds
- average pulse width: 6241uS
- average fuel quantity injected: 80.373uL

The difference in pulse widths is 362uS and the difference in fuel injected is 4.928uL. From this we can infer that the fuel pumping rate is 0.01361325 uL per uS. Converting units, that's 204cc per minute which is in the expected ballpark for a small car.

The total time to transmit the average injected fuel amount into the cylinder is then 6266uS (tank 1) or 5904uS (tank 2). This predicts the injector time delay at 337uS for both, depending on how inaccurate those particular fuel pumps were.

Thanks dcb and everyone else for all the advice!
I just verified that my idea for determining these numbers will work. Now I have even more reason to get off my dead butt and implement matrix math inside the MPGuino code.



Basically, I'm just solving a system of linear equations using matrix math. To be sure, since I'm only solving for two variables instead of three, I could just use elimination to crunch the numbers.

In any case, it will be much simpler to calibrate the MPGuino with this in place. All the driver would have to do is fill up two separate times to full, and press a few buttons in both cases.
Attached Thumbnails
Click image for larger version

Name:	s20170204-matrix-fuel.gif
Views:	343
Size:	12.9 KB
ID:	21276  
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
josemapiro (02-05-2017)
Old 02-05-2017, 05:31 PM   #67 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Spectacular
  Reply With Quote
Old 02-08-2017, 01:12 AM   #68 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
Finally got the bugs out of the interface to the Adafruit RGB LCD module. Now there is a 5-button/LCD solution for MPGuino that uses only two pins instead of 10.



Short demonstration of new idle timeout, EOC timeout, and park timeout. I think the Meelis code does something similar.

Idle timeout is engaged when MPGuino senses an idle condition, and activates an Idle screen after the idle timeout period elapses. The default setting is 15 seconds, but may be changed via stored parameter "Idle Timeout (s)"

EOC timeout is engaged when MPGuino senses an EOC condition, and activates a separate EOC screen after the EOC timeout period elapses. The default setting is 2 seconds, but may be changed via stored parameter "EOC Timeout (s)".

Both Idle and EOC timeouts can be temporarily overridden by pressing a button - this temporarily restores whatever screen was being displayed normally for a button-press timeout period. The normal screen is also displayed when the engine is running and the vehicle is moving, or if both the vehicle and engine are stopped. The default setting is 5 seconds, but may be changed via stored parameter "BtnPress T/O (s)".

The park timeout engages when MPGuino senses both the engine and the vehicle are stopped, and when the park timeout period elapses, the Current and Tank Trips are both saved to EEPROM (if configured). After this, the driver may safely remove power from the MPGuino. The default setting is 5 seconds, but may be changed via stored parameter "Park Timeout (s)".

After the park timeout period elapses, the traditional inactivity timeout engages. When the inactivity timeout elapses, MPGuino either enters deep sleep mode, or it shows a clock display. Either may be configured at compile-time. The default setting is 120 seconds, but may be changed via stored parameter "OFF Timeout (s)".

  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
josemapiro (02-08-2017)
Old 02-08-2017, 05:37 PM   #69 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
More one brilliant work like so many others.
One more step to implement the menu.

Thanks
José Rodrigues
  Reply With Quote
Old 02-10-2017, 12:17 PM   #70 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 828
Thanked 708 Times in 456 Posts
I found a rather serious bug related to one of the fuel injector validity monitors, which was in the 20170208 release. The bug has since been fixed, and is in the 20170210 release.

I also added a skybolt-related modification to the doOutputJSON routine, and corrected a very old bug related to displays on the LCD screen that I was finally able to track down.

  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
josemapiro (02-10-2017)
Reply  Post New Thread


Tags
mpguino, peak and hold

Thread Tools




Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com