Digital dash build log

Started by Extent, June 13, 2011, 10:09:09 PM

Previous topic - Next topic

Extent

Testing the input

Have it displaying live data now, hooked up to a tone generator to stand it for a tach signal.  Still just slowly pulling components together so the current feed is over filtered and less than accurate  :-\ but baby steps.

I had forgotten how annoying it is to do graphics on a display without a back buffer.  The video doesn't show it but the screen flickers like crazy.  Clearing the entire display and drawing each new frame is far too slow, so the only viable option is to erase each section of the screen just before you draw it (ie: practically 1 letter at a time)
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

Lucky

1982/3 XZ550 Touring Vison, Gold on Black

Extent

Ya funny story.  Tuxford is a developer on Eve Online.  One day he was working on his code and was logged in to their test server when he issued the shutdown command to deploy a new version.  Except he wasn't logged into their test server but the live public server during peak hours with somewhere between 45 and 50k people online.  Thankfully the 60 second emergency reboot was canceled before it went through, but he still managed to become a meme in the community used any time that the servers crash or otherwise go down out of their regular maintenance schedule.

Progress slowly continues.  Power regulation I have breadboarded according to National Semiconductor reference designs.  I also started playing with Eagle to do get a board layout.  I'm a little concerned about ripple, but the microcontroller doesn't appear to be bothered by any that is there, and I'll have to buy an oscilloscope and build a printed board before I can really test what's there.


Powerdown control is also tested, using a 1F capacitor I can shut down the screen and still get an extra 6 seconds of runtime out of the processor once main power is cut.  This is important to prevent powering down the dash from damaging the OLED screen (needs minimum 100ms to execute a shutdown) and to write changed data like the odometer out to EEPROM.
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

Lucky

you speekee mumbo jumbo, but the picture has pretty colors!
1982/3 XZ550 Touring Vison, Gold on Black

lexx790

Quote from: Lucky on June 22, 2011, 07:04:44 AM
you speekee mumbo jumbo, but the picture has pretty colors!

Yes but it's interesting Mumbo jumbo.
Keep plodding on and keeping us informed, don't be afraid to baffle us with your science.

spectre

Quote from: lexx790 on June 22, 2011, 07:53:54 AM
Yes but it's interesting Mumbo jumbo.
Keep plodding on and keeping us informed, don't be afraid to baffle us with your witchcraft.
Fixed it for ya.  ;D
Seriously though, it looks cool, I can't wait to see the finished product! :)
1982 yamaha vision xz550- a work in progress

Extent

had some time off work to push forward a little bit more, actually tested the proto board hooked up to the bike.  Power regulation works perfectly, and the wheel sensor works alright as well, although it looks like I'm going to need to do some debouncing on the input to prevent multiple triggers each time the magnet passes by the sensor from effecting the count.

RPM input is a no go at this point, it's working fine in the test bench but I'm getting all kinds of wild readings when it's hooked up to the tach input, it seems to be triggering so much noise that it triggers the wheel sensor reading even when that's tied directly to ground :/  I ordered a little hobby oscilloscope just so I can see what's really going on there.

Code wise more things are in place now.  Startup and shutdown code is blocked in to save system settings and odeometer values, basic speedo is hooked up, and odometer is working.  I still have a lot of floating point math to try and get rid of, and more intelligent handling of slow speeds. 
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

Extent

#27
Wheel sensor debouncing is worked out now.  The ATmega microcontroller is supposed to have built in schmidtt triggers on it's inputs, but a slowly ramping input value still gets into an undefined state somehow and will fire off dozens of interrupts for a single trigger  :-\  Dropping a 7414 in line cleans that right up so we're back in business.  I'll probably experiment with the proper CMOS version of that chip when I finally get down to actually assembling a board.

Knocked out some gremlins in the power regulation as well (note to self, a switching regulator hates being built on a protoboard)  It seemed to be running fine but it was causing the processor to trigger spurious interrupts and randomly crash.  I soldered the reference design together on a clean board and it's all running stable again.  This is probably what was causing the problems with reading the tach signal, but I'm gonna just wait the two days for the oscope to come before testing that again.  In the meantime I'll update the schematic work more on the software side of things.
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

Hartless

Quote from: Lucky on June 22, 2011, 07:04:44 AM
you speekee mumbo jumbo, but the picture has pretty colors!
i was wondering.if i was the only one that didnt understand any of this hahaha
Ride Hartless or stay home


"strive for perfection , settle for excellence"

QBS

Extent, I love your reports.  They make me stretch and learn.  I mean, who knew that dropping a 7414 in line would fix malfunctioning schmidt triggers?  I feel your pain about switching regulators.  They really do hate being built on protoboards.  That's always a good thing to avoid if possible,....like chain drive on a motorcycle.

Seriously, your writing has led me to see electronic design in a whole new light.  Kinda like very complex, high pressure fluid flow.  Thank you and keep up the excellent work.  Cheers.

YellowJacket!

Quote from: Extent on July 02, 2011, 04:58:16 AM
had some time off work to push forward a little bit more, actually tested the proto board hooked up to the bike.  Power regulation works perfectly, and the wheel sensor works alright as well, although it looks like I'm going to need to do some debouncing on the input to prevent multiple triggers each time the magnet passes by the sensor from effecting the count.

RPM input is a no go at this point, it's working fine in the test bench but I'm getting all kinds of wild readings when it's hooked up to the tach input, it seems to be triggering so much noise that it triggers the wheel sensor reading even when that's tied directly to ground :/  I ordered a little hobby oscilloscope just so I can see what's really going on there.

Code wise more things are in place now.  Startup and shutdown code is blocked in to save system settings and odeometer values, basic speedo is hooked up, and odometer is working.  I still have a lot of floating point math to try and get rid of, and more intelligent handling of slow speeds. 

I had the same problem with the tach on my electrosport tach.  Soldering a 56k resistor inline on the sensor wire fixed it for me.

David


Living the dream - I am now a Physician Assistant!!   :-)

Extent

Quote from: Hartless on July 06, 2011, 01:45:41 PM
i was wondering.if i was the only one that didnt understand any of this hahaha

You and me both, I am quite literally learning this all as I go along  ;D

I'm already running the tach signal thru a voltage divider to bring it down to a safe input level for the micro, but I may have left too much headroom for it (20v to 5v) and I think that the positive signal may be too low to be properly seen.
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

Extent

The meter was delivered early so I did that instead today, and quite lad I did too, the results have been enlightening!

The following shots are all of the tach signal read straight off the back of the instrument cluster.  The green horizontal line is the trigger level (Tr 10.4V) that's the level that's used to detect the frequency of the pulses.  The two white horizontal lines (hard to make out, but there is a small white arrow on either side of the screen to highlight them) are user set lines.  Those are what are showing the delta V of 13.2V on the bottom of the display, the bottom line I had roughly at .4V I think.

The signal is basically 13.5V that drops low on each ignition pulse.
1k rpm


2.5k rpm


That graph is starting to look a little small so let's zoom in 4x to get a better view of the individual pulses



Wow, that is a crap ton of bounce!  You'll notice how when the signal is returning to its high value that it overshoots very high, and then back down very low.  Those little glitches are still enough to trigger the computer to count, even though it's just noise!  Not to mention the tiny high peaks are nearly at 50V every pulse, with an occasional one all the way up to 74V, I've definitely got to do some extra filtering to protect the electronics here.  I'm thinking a 15v zenner diode to cap off the peaks, and then a similar debounce circuit to what I'm using for the wheel sensor running into the hex inverter to get a nice pristine square wave again.

Here I zoomed in on the pulses while letting the bike idle.



In the last image I moved the two time markers (white vertical lines with arrow markers) to approximately cover the time the bounce starts to when it ends, you can see that at idle it doesn't return to a clean flat pulse for about 15ms at worst.
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

Brian Moffet

If you're looking at just the voltage, perhaps a capacitor to remove the high-frequency bounce?  Or possibly a 555 timer set to one-shot mode to get rid of the bounce?

Brian

Extent

Ya that's basically what I'm doing, a 555 is an option, but I've still got 5 inverters on the 7414, so if I can make use of those without adding another 8 pin IC I'd like to.

Here's the current schematic.  The new RPM filter circuit is bench tested but still needs to be proven, my biggest worry is that the pulse width at high RPM may get too short (<2ms) and be eaten by the filter.  I'm pretty sure I'll be able to remove one resistor and one diode from the circuit as well if I can get a value close enough to 3k ohm for the top side of the voltage divider, but this is done with parts I've got immediately on hand.



This is actually getting pretty close to done hardware wise, just needs a couple of buttons and the SD card socket and I'll be ready to finish boarding the rest of the on bike prototype.
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

YellowJacket!

This is an absolutely cool build project!  Thanks Extent.   ;D

David


Living the dream - I am now a Physician Assistant!!   :-)

The Prophet of Doom

Cool indeed - I am saving my pennies so I can buy one of your boards

Extent

#37
Updated schematic, assuming that the provisional sections actually check out when tested on the protoboard this is now "feature complete" for the hardware on the initial feature set.  I'm left with 4 digital I/O pins, and 4 digital/analog I/O pins unused.

Now what's left is a lot of software.

--edit--
an automated bill of materials from this schematic comes out to just about 20$ so far, figure another 10 bucks for the PCB and there's still plenty of wiggle room.

Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.

JohnAMcG

This all sounds and looks very cool and is very interesting.  All these graphs and charts and PCB diagrams make me think one thing.  I can't afford it.  I do hope you are planning on making several, I am sure you will make the money back and then some.  I just hope it's not too out of reach for us common folk.  I'll need to have my girl read this thread around my birthday.  That gives you a few months to start production.    ;)
-JM

Extent

Mostly frustration tonight, spent a bit of time tuning the RPM input circuitry, had it to a point where I thought it was ready to all get wired up and test it above 6k rpm.  Went to turn on the processor and... zip.  Chip is dead >:(.  Now I've got extras, but I didn't have the foresight to program them beforehand so now I've got no programmer and a bunch of blank chips.  So a few more days waiting time now on FedEx :p

doing a 555 oneshot is looking more and more like what I'll need to do.  I found resistor values that work fine at idle, but as I get near 5-6k rpm it looks like they start eating into the signal.  I can still try some more aggressive values that will bounce more but still stay above the threshold.

In progress news input button code is done, so I now have software to support all of the hardware.  So I just have to see how much code I can work on while I don't have a working test unit for the next few days (and hope that the chip was killed while I was poking around with the circuit, and not due to my design somehow)
Rider1>No wonder, the Daytona has very sharp steering and aggressive geometry.  It's a very difficult bike for a new rider.
Rider2>Well it has different geometry now.