+ Reply to Thread
Page 3 of 9
First 1 2 3 4 5 6 7 ... Last
Results 31 to 45 of 132

Thread: Speedometer

  1. #31
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by danci1973
    I think your problem is in the ground - what ground did you use when you measured the voltages? I think you should use the black/white wire on the gear position switch connector, not just any ground on the bike.

    Attached is a picture of how I think the Suzuki gear position switch is wired.

    D.
    I'm taking the ground from somewhere in the instrument cluster.

    I'll try to change the ground...

    See attached the bike's diagram

    Thank you
    Attached Images


  2. #32
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    Quote Originally Posted by Kiko
    How did you find the constants assigned below?

    Symbol _1_Min = 1.243
    Symbol _1_Max = 2.355

    Symbol _2_Min = 2.356
    Symbol _2_Max = 3.194

    Symbol _3_Min = 3.195
    Symbol _3_Max = 3.709

    Symbol _4_Min = 3.710
    Symbol _4_Max = 4.307

    Symbol _5_Min = 4.308
    Symbol _5_Max = 4.674

    Symbol _6_Min = 4.675
    Symbol _6_Max = 4.810

    Symbol _N_Min = 4.811
    Symbol _N_Max = 5.245
    Heres your real life data:
    1st gear = 1.243v to 2.586v
    2nd gear = 2.124v to 3.210v
    3rd gear = 3.178v to 3.486v
    4th gear = 3.633v to 4.400v
    5th gear = 4.215v to 4.887v
    6th gear = 4.461v to 4.942v
    Neutral = 4.678v to 5.245v
    As they overlap, I had to find the "Middle" between each set. Take the First Gear for example:

    1st 1.243v - 2.586v
    2nd 2.124v - 3.210v

    Now the "Overlap" from 1st too 2nd is 2.586 minus 2.124 = 0.462V

    As I now know how much they overlap by, I simply divide this by 2 so I can split the overlap evenly 0.462 / 2 = 0.231

    And now add that value to the lower voltage 2.124 + 0.231 = 2.355

    There you have it - the "Middle" point for the overlap between gears

    I did however modify the gap between 2nd to 1st as it was not the same (too small) and figured it was a miss read

  3. #33
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by gramo
    Heres your real life data:


    As they overlap, I had to find the "Middle" between each set. Take the First Gear for example:

    1st 1.243v - 2.586v
    2nd 2.124v - 3.210v

    Now the "Overlap" from 1st too 2nd is 2.586 minus 2.124 = 0.462V

    As I now know how much they overlap by, I simply divide this by 2 so I can split the overlap evenly 0.462 / 2 = 0.231

    And now add that value to the lower voltage 2.124 + 0.231 = 2.355

    There you have it - the "Middle" point for the overlap between gears

    I did however modify the gap between 2nd to 1st as it was not the same (too small) and figured it was a miss read

    Allright, thank you

  4. #34
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    I said i modified 2nd to 1st, I meant 2nd to 3rd

  5. #35
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by gramo
    I said i modified 2nd to 1st, I meant 2nd to 3rd
    Ok I understood, but one more question my friend, in your simulation you told the voltages (sine wave) for each gear are 10khz from min to max, Why? and don't you think it's better to put a little delay between the readings for speed because as it's a digital reading any little change on the speed will be displayed on LCD but not on the original speedometer?

    Rgds

  6. #36
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    Quote Originally Posted by Kiko
    Ok I understood, but one more question my friend, in your simulation you told the voltages (sine wave) for each gear are 10khz from min to max, Why? and don't you think it's better to put a little delay between the readings for speed because as it's a digital reading any little change on the speed will be displayed on LCD but not on the original speedometer?

    Rgds
    I chose a frequency of 10K as a random "out there" number, to simulate noise from other devices on motorbikes circuits, it could be much less that.

    There is no delay in the routine - as I 'average' multiple samples with the following code


    Code:
    	Result = 0
    	Total = 0
    	X = 0
    	
    	Repeat
    	
    		  Result = ADIN 0
    		  Result = Result * 2
    		  Total = Total + Result
    		  
    		  Inc X
    	
    	Until X = 15
    	
    	Total = Total / 15
    	
    	Total = Total * 5 / 1023
    
    This way, I can average out and slew noise from my final result. Lets say for example my 15 readings were the following (The bike is in 1st gear):


    1.25, 1.0, 2.3, 2.7, 1.1, 1.5, 1.7, 1.77, 1.79, 1.2, 2.4, 2.45, 1.5, 1.6, 2.8

    The samples in bold were "out of range" and could have been produced from noise/spikes from else where in the motorbikes circrtry.

    But as I have taken 15 samples, I can now find the average.

    So all those numbers added together gives: 27.06
    The average is 27.06 / 15 = 1.804 Volts

    And this 'filters' out the noise - no need for a delay persay - the time that 15 samples takes is the delay. If you find that this speed is too fast, then put a simple delay in the repeat loop, eg

    Code:
    	Result = 0
    	Total = 0
    	X = 0
    	
    	Repeat
    
    		  DelaymS 1
    	
    		  Result = ADIN 0
    		  Result = Result * 2
    		  Total = Total + Result
    		  
    		  Inc X
    	
    	Until X = 15
    	
    	Total = Total / 15
    	
    	Total = Total * 5 / 1023
    
    And that will help generate a broader time scale for your samples

  7. #37
    danci1973 Newbie
    Join Date
    Nov 2006
    Posts
    5

    Default

    Quote Originally Posted by Kiko
    I'm taking the ground from somewhere in the instrument cluster.

    I'll try to change the ground...

    See attached the bike's diagram

    Thank you
    Looks similar to my bike's diagram. Does your bike have three wires to GPS (gear position switch)?

    The voltages from the gear position switch should be 'stable' and pretty much spot on as the ECU is using those to choose different ignition and/or fuel maps for first three gears (to prevent 'accidental' wheelies, I guess) and to enforce a speed limit in the top gear (on the GSXR-1000 and Hayabusa).

    D.

  8. #38
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by gramo
    I chose a frequency of 10K as a random "out there" number, to simulate noise from other devices on motorbikes circuits, it could be much less that.

    There is no delay in the routine - as I 'average' multiple samples with the following code


    Code:
    	Result = 0
    	Total = 0
    	X = 0
    	
    	Repeat
    	
    		  Result = ADIN 0
    		  Result = Result * 2
    		  Total = Total + Result
    		  
    		  Inc X
    	
    	Until X = 15
    	
    	Total = Total / 15
    	
    	Total = Total * 5 / 1023
    
    This way, I can average out and slew noise from my final result. Lets say for example my 15 readings were the following (The bike is in 1st gear):


    1.25, 1.0, 2.3, 2.7, 1.1, 1.5, 1.7, 1.77, 1.79, 1.2, 2.4, 2.45, 1.5, 1.6, 2.8

    The samples in bold were "out of range" and could have been produced from noise/spikes from else where in the motorbikes circrtry.

    But as I have taken 15 samples, I can now find the average.

    So all those numbers added together gives: 27.06
    The average is 27.06 / 15 = 1.804 Volts

    And this 'filters' out the noise - no need for a delay persay - the time that 15 samples takes is the delay. If you find that this speed is too fast, then put a simple delay in the repeat loop, eg

    Code:
    	Result = 0
    	Total = 0
    	X = 0
    	
    	Repeat
    
    		  DelaymS 1
    	
    		  Result = ADIN 0
    		  Result = Result * 2
    		  Total = Total + Result
    		  
    		  Inc X
    	
    	Until X = 15
    	
    	Total = Total / 15
    	
    	Total = Total * 5 / 1023
    
    And that will help generate a broader time scale for your samples
    OK as we say down here in Brazil "living and learning", so can I do the same with speed code below (your code)?

    KMHT=Counter PORTC.7, 500 ' I increased the value of period from 250 to 500 but the reading still too sensitive
    If KMHT=0 Then Goto Display_speed
    Temp_Float=KMHT
    Temp_Float=(Temp_Float*2)*8 ' I round 7.2 to 8 which gave me a more accurate speed reading
    KMH=Temp_Float/10
    KMHT=KMH

    Display_speed:
    If KMH_Last<>KMHT Then
    Print At 1, 1, DEC3 KMHT
    KMH_Last=KMHT
    EndIf
    GoTo Start

    Thank you again for your valuable help

  9. #39
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by danci1973
    Looks similar to my bike's diagram. Does your bike have three wires to GPS (gear position switch)?

    The voltages from the gear position switch should be 'stable' and pretty much spot on as the ECU is using those to choose different ignition and/or fuel maps for first three gears (to prevent 'accidental' wheelies, I guess) and to enforce a speed limit in the top gear (on the GSXR-1000 and Hayabusa).

    D.

    Yes sir, it has 3 wires and I took the signal from "P" wire near the ECU connector as you can see on the diagram. And as I post before I'm almost sure I have a GPS or generator or regulator problem, first because the voltages overlaps and second because on the bench the circuit works very nice and the only thing I can see strange on this bike is that it drinks a lot of fuel and it's fast, so it may be a indicative of GPS problem and because of that the ECU chose a higher gear (5th) to deal with. I don't know...

    I don't think the Suzuki TL1000 has a speed limit but I'm sure it has a RPM limit above 10500 RPM with load.

    Thank you

  10. #40
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by danci1973
    Looks similar to my bike's diagram. Does your bike have three wires to GPS (gear position switch)?

    The voltages from the gear position switch should be 'stable' and pretty much spot on as the ECU is using those to choose different ignition and/or fuel maps for first three gears (to prevent 'accidental' wheelies, I guess) and to enforce a speed limit in the top gear (on the GSXR-1000 and Hayabusa).

    D.
    Just for information, I changed the ground of the circuit that I took from somewhere of the instrument cluster and now the circuit is very stable, so the problem was GROUND. The Gear indicator is working perfect... But not the speedometer that when I turn the ignition ON it shows me 10 Km/hr and in 30Km/h shows 60Km/hr and so on, with more speed the difference between analog and digital increase.

    I had to change the resistors of the voltage divider from 1k to 10k because with 1K the voltage on the lcd indicator drop about 1.5 Volts.

  11. #41
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    Code:
    	Result = 0
    	Total = 0
    	X = 0
    	
    	Repeat
    
    		  DelaymS 1
    	
    		  Result = ADIN 0
    		  Result = Result * 2
    		  Total = Total + Result
    		  
    		  Inc X
    	
    	Until X = 100
    	
    	Total = Total / 15
    	
    	Total = Total * 5 / 1023
    
    Change the number of samples too 100 like I did above, you could even go higher, but it will slow down your program. This should help smooth the Speedo

    Leave 7.2 in this part, dont round it

    Code:
    	Temp_Float = KMHT
    	Temp_Float = Temp_Float * 4 * 7.2
            KMH =  Temp_Float / 1000
    	KMHT = KMH
    
    The issue with the miss reading could be the impedance is too high for the ADC circuitry in the PIC. The datasheet specifies 2.5K Max impedance. This is to allow the internal capacitors on the PIC to charge and discharge properly, try use 2.2K resistors on the voltage divider.

    Let me know if that helps

  12. #42
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Quote Originally Posted by gramo
    Code:
    	Result = 0
    	Total = 0
    	X = 0
    	
    	Repeat
    
    		  DelaymS 1
    	
    		  Result = ADIN 0
    		  Result = Result * 2
    		  Total = Total + Result
    		  
    		  Inc X
    	
    	Until X = 100
    	
    	Total = Total / 15
    	
    	Total = Total * 5 / 1023
    
    Change the number of samples too 100 like I did above, you could even go higher, but it will slow down your program. This should help smooth the Speedo

    Leave 7.2 in this part, dont round it

    Code:
    	Temp_Float = KMHT
    	Temp_Float = Temp_Float * 4 * 7.2
            KMH =  Temp_Float / 1000
    	KMHT = KMH
    
    The issue with the miss reading could be the impedance is too high for the ADC circuitry in the PIC. The datasheet specifies 2.5K Max impedance. This is to allow the internal capacitors on the PIC to charge and discharge properly, try use 2.2K resistors on the voltage divider.

    Let me know if that helps
    OK so let me try to explain what the problem is now:

    I'm not having anymore problems with the gear indicator so when I changed the ground the problem has been fixed. The gear indicator is working perfect.

    When I power the circuit installed in the bike the speed indicator is zero as the bike is stoped (no speed).

    When I start the engine the speed indicator shows 10km/hr but it's not smooth and with the increase of the speed it shows incorrect readings like I posted before.

    The speed sensor this bike uses is attached as reference, please see if I took the signal from the correct wire.
    Attached Images

  13. #43
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    Did you change the voltage divider to use 2.5K resistors?

    Perhaps it’s meant to be the voltage difference between the two wires, or just the one on the right, I have no idea as I don’t have your manual.

  14. #44
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,805

    Default

    Am I right in thinking that the ADC part is working correctly and the problem is with the pulsed speed input?

    Assuming I'm correct on the above assumption, it sounds like you are getting noise interference. Try connecting a 1K resistor from the sensor to the pic and a 0.1uF capacitor from pic to ground. If you still get noise then increase the capacitor , if you get no reading then reduce it. If it only works at certain speeds then post back.

    Mike.

  15. #45
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    Default

    Yes Mike you're right... I'll try to do the following (attached) see if you agree.

    What's the max signal amplitude that the PIC can deal with? Because the signal from speed sensor is 0 to about 300 hz 12 Volts pulsed and I think the circuit attached is going to lower the pulsed voltage to 5 V.


    Thanks
    Attached Images

+ Reply to Thread
Page 3 of 9
First 1 2 3 4 5 6 7 ... Last

Similar Threads

  1. digital speedometer using AT90S2313
    By fever in forum Micro Controllers
    Replies: 57
    Latest: 29th January 2008, 06:45 PM
  2. Speedometer Project Help
    By ADAM117 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 2
    Latest: 8th December 2006, 05:00 PM
  3. Pulse divider for a Speedometer
    By spestis in forum Electronic Projects Design/Ideas/Reviews
    Replies: 3
    Latest: 25th July 2006, 02:17 AM
  4. Tachometer and Speedometer replies
    By Kiko in forum Micro Controllers
    Replies: 0
    Latest: 26th April 2004, 12:57 AM
  5. Electronic Speedometer using stepper motor
    By roryp in forum General Electronics Chat
    Replies: 6
    Latest: 10th April 2003, 12:06 PM

Tags for this Thread