Jump to content


Photo
- - - - -

Tdm-Duino (Midnight Project)


  • Please log in to reply
99 replies to this topic

#81 JBX

JBX

    full o shoite

  • RTT manager(RTT)
  • 2,206 posts
  • Location:South France
  • TDM model: 2002

Posted 18 April 2018 - 11:53 pm

Yes, I use the EEPROM to store the following data : trip distance, trip time, trip max speed, initial fuel level, current fuel tank distance.

The problem with the EEPROM is that memory positions "wear" with usage, so it's not possible to record data at each program loop (100ms).

To record this data you don't have many choices if you want the most recent data and not data recorded every minute : data should be stored only when the power goes off. This way you have precise data without EEPROM issue.

So a "power down" detection is required to detect the switched +12V, but the µC must be fed by +12V battery via a delayed relay.

I had a look at the several µC "sleep mode" some time ago but this is not very useful for this kind of project : just detect power-down, store data then shut down. Keeps things simple but it requires some external electronics.

Power-down is plain easy to detect as there is already code to get the battery voltage. i just added a trigger when battery voltage goes below 1V. Battery voltage means here the switched +12V.

 

Acceleration is rather easy to calculate : subtract previous loop speed from current loop speed then divide by loop time (actually multiply by 10 due to loop time). You get acceleration in m/s2 as speed is in m/s. Then for engine breaking detection it's a matter of some riding tests. Then adding an "emergency braking" detection is very easy. One could also imagine to get the higher negative acceleration to do some brake pads testing...

 

For the speed calculation, this is a digital sensor so averaging by storing some values inside an array is not very useful, this method is best for some noisy analog sensors, but even for this I prefer to use external filtering to avoid heavy coding and timing issues - this is a basic Arduino after all, clock speed is low and program ram is scarce.

Speed is derived from the speed sensor (this is actually a distance sensor) by measuring the time every six sensor pulses. This gives enough precision and timing stay fast.

 

Injection timing is done by measuring pulse time with rising/falling interruption. Injection signal frequency is low enough to use this method and precision is in the µs range. Being calculated by INT, injection timing (and rpm) is permanently available except during engine braking, which is detected by time-out.

 

You're very right about the expected fuel range. I actually have some doubts about this and about the fuel economy. On my car I already removed the fuel economy display, it makes me mad about always looking at it and felling guilty when accelerating hard ! So if it's already annoying in a car, I don't know if it's useful on a bike.

So at the moment, let's consider the fuel screen feature on my project as "experimental"...

 

The fuel sensor is more a resistor ladder than a real variable resistor so I doubt it'll give useful data.

THe fuel tank display on the dash is heavily integrated (like on every vehicle) by some capacitors. Time constant is there to avoid measuring fuel motion inside the tank when accelerating/braking but as the fuel level is not expected to go low very fast, it works ok.

 

'naf said for today ! 


top_640.png

 

 


#82 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 19 April 2018 - 05:28 am

You can still have a simple economy meter based on MAF. Back in the good old days people used to buy a vacuum guage and fir it to the car's dash, to read manifold pressure .... high vacuum=high economy.

I started making an injector based system , but then again I prrfer to 'just ride' usually

900 with better bits. Owes me nothing, Makes me smile


#83 Coxylaad

Coxylaad

    Knight of Postsalot

  • Member
  • PipPipPipPipPip
  • 509 posts
  • Location:North East England
  • TDM model: 2002

Posted 10 November 2018 - 05:51 pm

any update on this?



#84 dandywarhol

dandywarhol

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 5,324 posts
  • Location:Edinburgh, Scotland
  • TDM model: 2003

Posted 14 November 2018 - 01:29 pm

I just picked up on this thread and only understand a fraction of it but IMO an engine braking stoplight is utter madness (page 1). I'm convinced traffic holdups on motorways and fast flowing roads are due to arseholes driving too close to the vehicle in front AND folks using the brake pedal to cancel cruise control. This has a trigger effect for the following vehicle to apply their brakes and before you know it, traffic comes to a halt.

 

Surely an engine braking light would have the same effect? A rain splattered visor in poor light and constantly flickering brake lights? not for me.................


Edited by dandywarhol, 14 November 2018 - 01:30 pm.

1967 Yamaha TD1C 250, 2014 Kawasaki W800, 2011 Aprilia Tuono 1000 V4, 2020 Yamaha XSR900

"At the cutting edge of technophobia" Scotland_180-animated-flag-gifs.gif mccoy.gif
 


#85 Studley Ramrod

Studley Ramrod

    Monkey Boys Monkey

  • Root Admin(A)
  • PipPipPipPipPipPipPipPip
  • 19,214 posts
  • Location:HELLO ! I'm in the Library...Notts
  • TDM model: 1993

Posted 14 November 2018 - 01:56 pm

Some cars also have that maintaining distance to vehicle in front gizmo that automatically hits the brakes when the distance is too close.  Loada bollox imho. Drivers getting really idle about driving using this and not concentrating and brakes lights on/off all the time blah blah blah


Mk2a 2000 in Silver. Top end Refurb @ 41100 miles, Scottoiler, Renthal Road High Bars, Up & Back Bar Risers, Bellypan, DL650 Handguards, Capt. Picard Bar Ends, House of Henty SS Wheel spacers, New Seat Cover Fitted. 58 MPG !!  Now owned by chrisbee !   Studley's mk2a Bloggerydoodaah !  Photos of my first MK1  Photos of my MK2a  TPLQHCSRSFC No. 1 Fan


#86 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 14 November 2018 - 03:54 pm

Say what you want, i use the adaptive cruise control a lot....believe it or not, because it maintains a large gap to the car in front, keeping me safer....and if the guy behind me is using it he's usually further back from my rear bumper than the guys who don't....

 

Like you say, it's people traveling too close which cause the wave effect.  Traffic waves happen without cruise control, they're a well studied phenomenon.

 

Secret is - Back Off !, anticipate, look ahead of the vehicle in front of you.

 


900 with better bits. Owes me nothing, Makes me smile


#87 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 14 November 2018 - 03:59 pm

The other thing we get problems with is rubber necking...which really isn't so much about people slowing down to look at an accident, but the fact that there ar elots of blue and yellow flashing lights and a lot of traffic, it is unclear if there will be a pedestrian, a policeman or breakdown truck operator on your side of the road too. A lot of rubber necking often has little to do with people being nosy and more to do with people being bloody careful. The police wave people past the accident and want us to speed up, yet all the evidence on the approach tells us we should slow down.....The end result is that what appears to be rubber necking is very often the result people respecting the fact the police are manually controlling traffic

 

When I shut the throttle of my KTM it's like hitting the brakes...... I wouldn't mind it if the brake light came on to wake up the driver behind me, I know from experience you can't always rely on the driver behind being able to anticipate a change of speed


Edited by fixitsan, 14 November 2018 - 04:00 pm.

900 with better bits. Owes me nothing, Makes me smile


#88 Studley Ramrod

Studley Ramrod

    Monkey Boys Monkey

  • Root Admin(A)
  • PipPipPipPipPipPipPipPip
  • 19,214 posts
  • Location:HELLO ! I'm in the Library...Notts
  • TDM model: 1993

Posted 14 November 2018 - 06:37 pm

So, first car with ACC brakes to maintain correct distance, causing next car to brake, and repeat. Driver further back down the road sees loads of cars braking and brakes.  I've seen it happen a few times.  They all rely on the vehicle at the front maintaing a constant speed, which as we all know very rarely happens and you end up with car brake lights constantly lighting up.


Mk2a 2000 in Silver. Top end Refurb @ 41100 miles, Scottoiler, Renthal Road High Bars, Up & Back Bar Risers, Bellypan, DL650 Handguards, Capt. Picard Bar Ends, House of Henty SS Wheel spacers, New Seat Cover Fitted. 58 MPG !!  Now owned by chrisbee !   Studley's mk2a Bloggerydoodaah !  Photos of my first MK1  Photos of my MK2a  TPLQHCSRSFC No. 1 Fan


#89 Andy25

Andy25

    Carpe Addict

  • Member
  • PipPipPip
  • 335 posts
  • Location:Dundee
  • TDM model: 2000

Posted 14 November 2018 - 08:11 pm

The biggest issue that I'm seeing a lot recently
is cars etc leaving too much space at Traffic lights / Roundabouts etc sometime's as much as 50m a few of those and everything grinds to a Halt

I'm seeing this almost daily now as soon as I leave work it's a choice of Filtering for 3/4 mile or Back road with almost useless Headlights

But the Biggest cause of accidents are Maureen`s and Honda Jazz driver's
they may not be involved in them but they're Driving certainly cause them.

#90 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 15 November 2018 - 12:23 am

So, first car with ACC brakes to maintain correct distance, causing next car to brake, and repeat. Driver further back down the road sees loads of cars braking and brakes.  I've seen it happen a few times.  They all rely on the vehicle at the front maintaing a constant speed, which as we all know very rarely happens and you end up with car brake lights constantly lighting up.



Mine don't work like that. If the car in front slows suddenly the throttle is cut and engine braking without brake light takes over, exactly the same as if i were driving. Then after a short period if extra brakung is required the brakes come on, exactly as I would do.

It has some good throttle control and is a bit more high tech than acting like a switch for the brakes

900 with better bits. Owes me nothing, Makes me smile


#91 Nog

Nog

    Knight of Postsalot

  • Member
  • PipPipPipPipPip
  • 514 posts
  • Location:Sarf East Innit
  • TDM model: 2007

Posted 15 November 2018 - 09:02 am

So, first car with ACC brakes to maintain correct distance, causing next car to brake, and repeat. 

 

If the car with ACC brakes, then it's not the first car.  It's braking due to the car in front which would be the problem in this case.

 

The problems with these systems is they need either all cars to have them or none at all.  In the video above of the cars going round, if they all engage ACC at an appropriate distance then the circle would endlessly go on with no issue.

 

That said I'm not a fan of ACC because there has been evidence of it not 'seeing' motorbikes unless they are directly in front, which is worrying as most bikes travel on either side of centre.



#92 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 15 November 2018 - 10:57 am

The one time which convinced me ACC was more than a novelty was when I passed a vehicle in the hard shoulder thinking it was on fire, and I turned to look in my left mirror, almost as soon as I did that my car started braking by itself because it had detected that the car at least 30m ahead had touched his brakes.....had I of continued to look in the left mirror for even a second longer, by the time I looked forward again I might have closed the gap between me and the car in front quite a bit. OK it wasn't dangerously close in the first place....but the fact that even though i was paying full attention, in the moment I looked at the mirror the ACC took over the speed control for me was a good thing.

 

In the latest Golf the ACC seems to be speed sensitive, when it comes to the size of the gap it leaves to the car in front. When set for a minimum gap it is almost a 2 second gap at 70mph....at it's longest gap setting 3 to 4 seconds. Which I find is way better than you see people normally driving at.

 

The issue of not seeing a motorbike would be a concern for me, I haven't experienced that particular problem, but if others have then it should be properly addressed

 

I've used a couple of cars with lane assist and have to say that I'm much less impressed with that than i am ACC


Edited by fixitsan, 15 November 2018 - 10:58 am.

900 with better bits. Owes me nothing, Makes me smile


#93 Coxylaad

Coxylaad

    Knight of Postsalot

  • Member
  • PipPipPipPipPip
  • 509 posts
  • Location:North East England
  • TDM model: 2002

Posted 15 November 2018 - 02:26 pm

bring on driverless cars. make us bikers safer.  Most road users are utterly clueless, whats more they don't care. for most driving is an inconvenience that has to be tolerated by people when they need to be somewhere else.


Edited by Coxylaad, 21 November 2018 - 03:17 pm.


#94 JBX

JBX

    full o shoite

  • RTT manager(RTT)
  • 2,206 posts
  • Location:South France
  • TDM model: 2002

Posted 20 November 2018 - 12:59 am

any update on this?

 

Sorry, too busy these weeks to update a lot.

Anyway, these are the latest improvements :

- Code optimization to reduce memory footprint and improve cpu timing by using int instead of float. 

- Also realize the fuel level sensor it a piece of crap unable to give reliable data and therefore unable to assume the "fuel economy" part. This part will be discarded in the future.

- Added some code to give a shutdown memory save, based on a proper power supply and power voltage sensing.

- Added some code for anti-theft function at start-up.

- Added support for bar-graph display.

- Optimized display code.

- Optimized I/O pin usage to fit on an Arduino Nano board.

- Optimized interrupts code.

- Use digital input (3 pins) to get the gearbox position info instead of analog input using a resistor ladder.

- Drop atmospheric pressure sensor reading.

- Code for engine-breaking detection is commented out. 

- some code commented-out for testing purposes.

- plus some other things I already forgot...

 

Latest code is available here : http://jbx9.free.fr/...ino/GearPos.ino

 

:)


Edited by JBX, 21 November 2018 - 01:41 am.

top_640.png

 

 


#95 Coxylaad

Coxylaad

    Knight of Postsalot

  • Member
  • PipPipPipPipPip
  • 509 posts
  • Location:North East England
  • TDM model: 2002

Posted 21 November 2018 - 03:20 pm

cool, at some point I will jump and try and help you with this.

 

- Also realize the fuel level sensor it a piece of crap unable to give reliable data and therefore unable to assume the "fuel economy" part. This part will be discarded in the future.

I thought fuel economy calcs were based on injector pulse not the fuel level sender? 

The level sender would be used to calculate the remaining range in the tank



#96 JBX

JBX

    full o shoite

  • RTT manager(RTT)
  • 2,206 posts
  • Location:South France
  • TDM model: 2002

Posted 21 November 2018 - 04:19 pm

You're right, I meant to say "fuel range", not "fuel economy".

Hard times lower my english level !  ;)


Edited by JBX, 21 November 2018 - 04:20 pm.

top_640.png

 

 


#97 dapleb

dapleb

    Monkey Boy

  • Root Admin(A)
  • PipPipPipPipPipPipPipPip
  • 18,117 posts
  • Location:The home of morris dancin
  • TDM model: 1990

Posted 21 November 2018 - 04:57 pm

(French) kisses for the crazy Frenchman xx
"Whats up", "Piston Broke", "Yeah me too...hic"

If you want to mark your location on the Carpe map: http://www.carpe-tdm...opic.php?t=5117

Doin valve clearances? Use dappers valve shim exchange program and the job will be carroty - Free (other than you postin me yer shims) for sporting members.

Active member of TPLQHCSRSFC and TSRMCMAS (even though a year off) and avid fan of PM not sent.

#98 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 21 November 2018 - 05:20 pm

cool, at some point I will jump and try and help you with this.

 

 

 

I thought fuel economy calcs were based on injector pulse not the fuel level sender? 

The level sender would be used to calculate the remaining range in the tank

 

 

I always wonder about the usefulness of that feature, I have it on the car too.....it assumes that the next half a tank will be driven in the same way as the first half was


900 with better bits. Owes me nothing, Makes me smile


#99 Coxylaad

Coxylaad

    Knight of Postsalot

  • Member
  • PipPipPipPipPip
  • 509 posts
  • Location:North East England
  • TDM model: 2002

Posted 21 November 2018 - 11:31 pm

Especially when it gets to zero and you manage to do another 30 miles!

#100 fixitsan

fixitsan

    Carpe Citizen

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,676 posts
  • Location:West Lothian
  • TDM model: 2003

Posted 22 November 2018 - 11:13 am

Especially when it gets to zero and you manage to do another 30 miles!

 

:good:

 

Better than the fuel gauge itself perhaps though ?

 

Mine goes from full - still almost full - used a bit now -  4 bars remaining - 2 bars - empty


900 with better bits. Owes me nothing, Makes me smile



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users