Jump to content


Photo
- - - - -

Drl Controller


  • Please log in to reply
95 replies to this topic

#1 fixitsan

fixitsan

    Carpe Citizen

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

Posted 04 November 2017 - 02:59 pm

I've just finished writing the software for a DRL controller. Although the combined handguard/DRLs I have direct the beam downwards to the ground to eliminate dazzling, it is only that way because I had to mount them that way, they are really very bright at night, too bright for direct forward facing applications.

 

By law, DRL's are supposed to dim to 50% when the headlight is on (an interpretation of the idea that they should be 50% at night), but as my TDM has it's headlight permanently on then in daytime 50% brightness DRL's won't be as effective. Any DRL located near to an indicator must also extinguish when it's own side's turn indicator comes on. I think these 'laws' are mainly directives, and also construction and use regulations for cars only, but they make good sense are good as a starting point.

 

My DRL controller extinguishes the DRL on the side which has an active indicator lamp. It also has a light sensor which automatically dims the DRLs at night, and has an input from the horn which, when triggered, flashes the DRL's rapidly ( you can often hear a horn in traffic but how do you know which vehicle gave the warning ? This is an optional feature)

 

There is a single pushbutton control which cycles operation through 4 modes. A single LED on the control box blinks the mode 'number' (The indicator LED also dims in response to ambient light levels, to prevent blinding the rider at night)

 

Mode 0 - all off

Mode 1 - automatic dimming with glimmering effect to enhance visibility. the depth of glimmering reduces as the ambient light reduces

mode 2 - DRL's fixed at 50% brightness (no dimming or glimmering)

Mode 3 - DRLs at 100% brightness

Mode 4 - High visibilty. a more obvious glimmering. A lead rider in a convoy may use this if they don't have hazard lights.

 

There's also an output to switch on a fog lamp (can be either LED or tungsten), which will also be flashed during very heavy braking as a 'rear end guard'

 

The glimmering effect is not just a flashing on-off effect. the brightness is switched subtly between two different levels, and is applied to each DRL in opposition, so it creates a movement from side to side. The night time glimmering switches between 55%-40%.

 

 

Next job is to finish building the circuit, fit it to my bike and then test it out and get some opinions.

 

 

A later addition is hopefully going to be motion detection, so that rapid changes in direction can cause a deeper glimmering effect, and also so that the glimmering can be disabled when the bike is stationary, so as not to cause annoyance when stopped.

 

 

At some point I would like to then look to getting some opinions, and I might even attempt to market it.

 

Watch this space !


Edited by fixitsan, 04 November 2017 - 04:20 pm.

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


#2 drewpy

drewpy

    has been here 4ever

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 1,753 posts
  • Location:Manchester UK
  • TDM model: 1996

Posted 04 November 2017 - 06:16 pm

sounds great, let us know how it goes


"As I Lay Rubber down to street, I pray for traction I can keep. But if I skid and begin to slide, please dear god protect my ride"

Mods; Oil pressure switch, neoprene rear inner mudguard, scottoiler, highway pegs,  fenda extenda, 1999 carbs and airbox, Kais suspension setup, later clutch springs, LED lamps, Metmachex swingarm, Hagon Shock, Oxford heated grips, 4 way fused accessory Bus, 17" 3CV front wheel, Michellin R6 tyres, GPS speedo, 5' ignition advance.


#3 Favs

Favs

    Sir Cumference

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,391 posts
  • Location:County Durham
  • TDM model: 2008

Posted 04 November 2017 - 08:03 pm

Paying attention here :good:


Single-handedly reviving the Wave.

 

2008 reg. Black TDM 900 ABS

 

 

 


#4 fixitsan

fixitsan

    Carpe Citizen

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

Posted 04 November 2017 - 10:06 pm

Paying attention here :good:

 

I saw you were interested previously Favs.....it's partly what spurred me on to finish it.

 

The motion detect and heavy braking fog light flashers will be added later, the other functions are all working now.

 

I'll get my act together and be serious now(for a change.... !)


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


#5 steves100uk

steves100uk

    Carpe fan

  • Member
  • Pip
  • 198 posts
  • Location:Cleethorpes N.E.Lincs
  • TDM model: 2002

Posted 05 November 2017 - 12:04 pm

Sounds great.

#6 dablik

dablik

    Master Intermediate Fettlin' Award 2018

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 10,735 posts
  • Location:Bootleshire
  • TDM model: 1992

Posted 05 November 2017 - 03:22 pm

Interesting, on a mk1 with standard 35w bulbs these are going to be brighter even at 50% i imagine :munching_out:


Bigred mk1 R1 Calipers- Braided lines- Givi wing rack-Crash bungs- Hi vis bullets-PR2's- and a hoot to ride.

Quad 900 Silver Laser duo tech pipes-Scott oiler-Engine crash bars- Radiator mounted see me ring LED's-Datatool system 3 alarm -Centre stand- Extender fender-Renthal bars-Handle bar risers-Mirror extenders-BMW GS Handgaurds-Acumen uprated horn & Nautilus-Stainless steel Radiator guard-Givi wing rack-OEM screen-Yammy touring screen-MRA Vario-MRA Double bubble cut down for fast as fk riding-Tiger screen-Tank protector-Stomp grip panels-Optimate lead   Gone to Heaven  :sorry: 

 

1991 MK1 in need of some TLC watch this space   :) Sorted and on the Road Mick  :P  :P it's the bike that Jack built  ;) Gone to Heaven  :wub: 

 


#7 dmmsta

dmmsta

    supporter of the "Anti-Dazzle" Club

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 3,627 posts
  • Location:Marden, Kent, UK.
  • TDM model: 2006

Posted 05 November 2017 - 06:11 pm

This should cool.

I saw your interest into JBX's TDMduino - are you using the same thing as the brain, or something different.

 

I was looking at LDRs that I could use to dim the DRL's I have (the ones I've got have a switched live for dimmed operation, so was thinking an LDR unit in line to the switch feed and mount it somewhere on the dash.

 

Be interested to see what you used for the light sensor - I'm happy with a binary switch for the dimming, but couldn't easily find something out the box that was weather proof to boot.


MY06 TDM 900 Blue over Silver 354906_45.png
-----
Fuel Pipes
Givi Top Box
Renthal 758's
Grip Puppies
MRA Bubble
Dip & Hi HIDs

To-Do:
LED DRLs
Loobman
Powercoat Wheels
Hand Guards

-----
MY04 TDM 900 Blue over Silver Parts Bin
MY02 TDM 900 Yellow over Black RIP
post-1-1150550733.gif...post-1-1150559830.gif...copilot_zpsgezqc0xz.jpg...hids.jpg...

#8 Favs

Favs

    Sir Cumference

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,391 posts
  • Location:County Durham
  • TDM model: 2008

Posted 05 November 2017 - 07:04 pm

Interesting, on a mk1 with standard 35w bulbs these are going to be brighter even at 50% i imagine :munching_out:

 

Needs LEDs in there - my Saturno has one headlight 35/35w incandescent and it's properly poor. On the list of jobs, but a long way down it.


Single-handedly reviving the Wave.

 

2008 reg. Black TDM 900 ABS

 

 

 


#9 fixitsan

fixitsan

    Carpe Citizen

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

Posted 05 November 2017 - 07:13 pm

This should cool.

I saw your interest into JBX's TDMduino - are you using the same thing as the brain, or something different.

 

I was looking at LDRs that I could use to dim the DRL's I have (the ones I've got have a switched live for dimmed operation, so was thinking an LDR unit in line to the switch feed and mount it somewhere on the dash.

 

Be interested to see what you used for the light sensor - I'm happy with a binary switch for the dimming, but couldn't easily find something out the box that was weather proof to boot.

 

 

I'm programming a 14-pin Microchip Pic 16F1824 > > > http://www.microchip...s/en/PIC16F1824

 

It has 4 PWM channels, three of which are used to control  the brightness of the DRLs independently, plus the operator mode indication LED has adjustable brightness.

 

An analogue A/D channel reads the  LDR. value, converting it to a value between 0-255

 

A couple of other pins are used for communicating with the yet to be added accelerometer, via an I2C type interface

 

I code the time critical stuff in assembly language, using timer based interrupts, and do all the structure and looping in PicBasic Pro just because it saves a lot of time (at the expense of using a bit more space than if I programmed it all in assembly. It's a worthwhile tradeoff in my opinion

 

Using an Arduino is a good way to sanity test ideas, but a production device would need to use the same chip as is in the Arduino.

 

I've used just about 1k of the device's 7k of program space, and about 20 of the available 256 bytes of ram....running at 4MHz , the same speed as the original Apollo space mission flight guidance computer !

 

It's no indication of the cost of the final device, but the 16F1824 is available for 88p in singles, 77p in hundreds.... cheaper than an arduino, but there are a few interfacing components plus other hardware to add.

 

The three output channels utilise 3 x BD139 transistors... 20p each and capable of 3Amps maximum..... way OTT but reliable for prototyping.

 

The accelerometer will be an MPU6050....3 axis accelerometers and 3 axis gyroscopes... they're just £1 each.... the mobile phone industry has done us a favour in bringing down the price of small sensing devices !


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


#10 fixitsan

fixitsan

    Carpe Citizen

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

Posted 05 November 2017 - 07:24 pm

I think I can use the last unused input pin to connect to the high beam circuit, then whenever you switch to high beam the DRL's go on to 100% too with high beam.... need to check this out !


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


#11 dablik

dablik

    Master Intermediate Fettlin' Award 2018

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 10,735 posts
  • Location:Bootleshire
  • TDM model: 1992

Posted 05 November 2017 - 07:57 pm

 

Needs LEDs in there - my Saturno has one headlight 35/35w incandescent and it's properly poor. On the list of jobs, but a long way down it.

 

Not to impressed with attempts on the 850 to date ie aircooled and stud's measurements, aircooled reported a loose wobbly bulb when fitted and stud's measured up to close call space wise, however found a kit shorter but twice the price...no rush just yet though.


I think I can use the last unused input pin to connect to the high beam circuit, then whenever you switch to high beam the DRL's go on to 100% too with high beam.... need to check this out !

 

That could be the icing on the cake really :good:


Bigred mk1 R1 Calipers- Braided lines- Givi wing rack-Crash bungs- Hi vis bullets-PR2's- and a hoot to ride.

Quad 900 Silver Laser duo tech pipes-Scott oiler-Engine crash bars- Radiator mounted see me ring LED's-Datatool system 3 alarm -Centre stand- Extender fender-Renthal bars-Handle bar risers-Mirror extenders-BMW GS Handgaurds-Acumen uprated horn & Nautilus-Stainless steel Radiator guard-Givi wing rack-OEM screen-Yammy touring screen-MRA Vario-MRA Double bubble cut down for fast as fk riding-Tiger screen-Tank protector-Stomp grip panels-Optimate lead   Gone to Heaven  :sorry: 

 

1991 MK1 in need of some TLC watch this space   :) Sorted and on the Road Mick  :P  :P it's the bike that Jack built  ;) Gone to Heaven  :wub: 

 


#12 dmmsta

dmmsta

    supporter of the "Anti-Dazzle" Club

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 3,627 posts
  • Location:Marden, Kent, UK.
  • TDM model: 2006

Posted 05 November 2017 - 08:26 pm

 

 

I'm programming a 14-pin Microchip Pic 16F1824 > > > http://www.microchip...s/en/PIC16F1824

 

It has 4 PWM channels, three of which are used to control  the brightness of the DRLs independently, plus the operator mode indication LED has adjustable brightness.

 

An analogue A/D channel reads the  LDR. value, converting it to a value between 0-255

 

A couple of other pins are used for communicating with the yet to be added accelerometer, via an I2C type interface

 

I code the time critical stuff in assembly language, using timer based interrupts, and do all the structure and looping in PicBasic Pro just because it saves a lot of time (at the expense of using a bit more space than if I programmed it all in assembly. It's a worthwhile tradeoff in my opinion

 

Using an Arduino is a good way to sanity test ideas, but a production device would need to use the same chip as is in the Arduino.

 

I've used just about 1k of the device's 7k of program space, and about 20 of the available 256 bytes of ram....running at 4MHz , the same speed as the original Apollo space mission flight guidance computer !

 

It's no indication of the cost of the final device, but the 16F1824 is available for 88p in singles, 77p in hundreds.... cheaper than an arduino, but there are a few interfacing components plus other hardware to add.

 

The three output channels utilise 3 x BD139 transistors... 20p each and capable of 3Amps maximum..... way OTT but reliable for prototyping.

 

The accelerometer will be an MPU6050....3 axis accelerometers and 3 axis gyroscopes... they're just £1 each.... the mobile phone industry has done us a favour in bringing down the price of small sensing devices !

I understand about 50% of this.

 

I left my circuit board knowledge (behind at school in exchange for beer girls & cake), so have a very basic grasp of what you're doing - but I'm properly intrigued with the potential end goal.


MY06 TDM 900 Blue over Silver 354906_45.png
-----
Fuel Pipes
Givi Top Box
Renthal 758's
Grip Puppies
MRA Bubble
Dip & Hi HIDs

To-Do:
LED DRLs
Loobman
Powercoat Wheels
Hand Guards

-----
MY04 TDM 900 Blue over Silver Parts Bin
MY02 TDM 900 Yellow over Black RIP
post-1-1150550733.gif...post-1-1150559830.gif...copilot_zpsgezqc0xz.jpg...hids.jpg...

#13 fixitsan

fixitsan

    Carpe Citizen

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

Posted 05 November 2017 - 10:12 pm

 

 

I left my circuit board knowledge (behind at school in exchange for beer girls & cake),

 

 

 

 

I started late for the very same reasons :)


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


#14 fixitsan

fixitsan

    Carpe Citizen

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

Posted 05 November 2017 - 10:36 pm

 

 


 

That could be the icing on the cake really :good:

 

 

The cake is now iced,

High beam switches DRL's to full brightness. (this takes precedence over all functions except the horn enhancement)

Horn gives a high visibilty pattern during and for 5 seconds after horn is released (Takes precedence over all functions)

Indicators turn off the adjacent DRL (If neither of the above apply)

 

 

A Very long button press, > 5 seconds, disables the unit ( for MOT/TUV etc)

A medium press, 2 - 5 seconds, toggles the fog light, on and off

 

A brief button press cycles  between - fully auto glimmering > 50% steady > 100% steady

 

 

The prototype is going to be built into a handlebar mounted box,  2.5" x 1" x 0.5"

 

Fingers crossed


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


#15 Favs

Favs

    Sir Cumference

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 4,391 posts
  • Location:County Durham
  • TDM model: 2008

Posted 05 November 2017 - 10:40 pm

Lemmy no when ya want some (contributory £) alpha testing :good:


Single-handedly reviving the Wave.

 

2008 reg. Black TDM 900 ABS

 

 

 


#16 fixitsan

fixitsan

    Carpe Citizen

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

Posted 05 November 2017 - 10:53 pm

Lemmy no when ya want some (contributory £) alpha testing :good:

 

 

I shall do :)

 

It would be nice to think I could drum up some interest from a reseller like Oxford, but then again it isn't too hard to launch your own project these days, there are a lot of companies who provide the necessary hardware production facilities....or maybe this is the excuse I've been waiting for to buy or build a 3D printer  !


Edited by fixitsan, 05 November 2017 - 11:31 pm.

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


#17 dablik

dablik

    Master Intermediate Fettlin' Award 2018

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 10,735 posts
  • Location:Bootleshire
  • TDM model: 1992

Posted 05 November 2017 - 10:54 pm

Cor blimey, sounds good.


Bigred mk1 R1 Calipers- Braided lines- Givi wing rack-Crash bungs- Hi vis bullets-PR2's- and a hoot to ride.

Quad 900 Silver Laser duo tech pipes-Scott oiler-Engine crash bars- Radiator mounted see me ring LED's-Datatool system 3 alarm -Centre stand- Extender fender-Renthal bars-Handle bar risers-Mirror extenders-BMW GS Handgaurds-Acumen uprated horn & Nautilus-Stainless steel Radiator guard-Givi wing rack-OEM screen-Yammy touring screen-MRA Vario-MRA Double bubble cut down for fast as fk riding-Tiger screen-Tank protector-Stomp grip panels-Optimate lead   Gone to Heaven  :sorry: 

 

1991 MK1 in need of some TLC watch this space   :) Sorted and on the Road Mick  :P  :P it's the bike that Jack built  ;) Gone to Heaven  :wub: 

 


#18 Swarf

Swarf

    Carpe Addict

  • Member
  • PipPipPip
  • 314 posts
  • Location:East Devonshire, by t'sea.....
  • TDM model: 1993

Posted 06 November 2017 - 11:31 am

This sounds interesting, will it work with any drl or will it need a certain spec?

#19 fixitsan

fixitsan

    Carpe Citizen

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

Posted 06 November 2017 - 11:44 am

This sounds interesting, will it work with any drl or will it need a certain spec?



Any DRL from single compact leds, upto multiple high brightness Cree units.

Although leds have a long lifespan anyway, switching their brightness this way extends their life even more

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


#20 dmmsta

dmmsta

    supporter of the "Anti-Dazzle" Club

  • Supporting Member(thanks)
  • PipPipPipPipPipPipPipPip
  • 3,627 posts
  • Location:Marden, Kent, UK.
  • TDM model: 2006

Posted 07 November 2017 - 11:43 am

Wondering if this unit would work with the DRL's i've yet to fit, as they have a "control box" inline...

 

I really like the whole setup you've put together here!!!


MY06 TDM 900 Blue over Silver 354906_45.png
-----
Fuel Pipes
Givi Top Box
Renthal 758's
Grip Puppies
MRA Bubble
Dip & Hi HIDs

To-Do:
LED DRLs
Loobman
Powercoat Wheels
Hand Guards

-----
MY04 TDM 900 Blue over Silver Parts Bin
MY02 TDM 900 Yellow over Black RIP
post-1-1150550733.gif...post-1-1150559830.gif...copilot_zpsgezqc0xz.jpg...hids.jpg...


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users