Page 1 of 1
Can I use spot value "TURNS" for km trip counter?
Posted: Fri Jun 12, 2020 9:24 am
by joromy
Now I use the RPM received from CAN, for kmh and km trip counter, with the display unit (Teensy 4)
But It's not accurate.
Could I use the TURNS value?
How high does it count, before rollover?
I would need it to go to about 300.0km (one decimal would be nice)
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Sun Jun 28, 2020 9:57 am
by Peter
Hello joromy. I use 'TURNS' for trip. So far no issues but only done a few miles as yet. To see if the max value of 'TURNS' was feasible I used number of 'TURNS' over a fully charged battery range (50 miles) based on my gear ratios and tyre revs per mile. Save trip value to EEPROM at power down or when value changes after maths to keep 'saves' down. Recall EEPROM value at power up and add to that to continue. Hope that helps. Peter
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Sun Jun 28, 2020 10:50 am
by joromy
Thanks for the info.
If I understand it correct, this would be the way to calculate it?
Wheel is 218cm (0,00218km) for one rotation
Gear ratio is 12.518:1
Code for km travel would be TURNS * 1.741492251158332e-4
Or for m travel TURNS * 0.174
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Sun Jun 28, 2020 4:56 pm
by Peter
Hi joromy Suggest you run motor at fixed rpm for a minute and check TURNS to see value first. In my setup TURNS were exactly half the rpm per minute. i.e. 1000rpm for 1 minute gave me a TURNS value of 500.
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Sun Jun 28, 2020 7:26 pm
by Isaac96
Peter wrote: ↑Sun Jun 28, 2020 4:56 pm
Hi joromy Suggest you run motor at fixed rpm for a minute and check TURNS to see value first. In my setup TURNS were exactly half the rpm per minute. i.e. 1000rpm for 1 minute gave me a TURNS value of 500.
That sounds strange... Is your 'numimp' for the encoder set correctly? I will do the same test (tomorrow) and see what I get...
-Isaac
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Mon Jun 29, 2020 5:42 am
by johu
Just checked, it takes "respolepairs" into account, even when using encoder. Set respolepairs to 1 and the weirdness will be gone.
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Mon Jun 29, 2020 9:05 am
by Peter
Hi Johannes. Thank you for your input with the weirdness. If we increase the respolepairs value higher to reduce the value of TURNS for our purpose will it affect anything else? Thanks in advance. Peter
Re: Can I use spot value "TURNS" for km trip counter?
Posted: Mon Jun 29, 2020 8:41 pm
by johu
Well there are. In fact respolepairs MUST be set to 1 in order to work with an encoder in firmware 4.85.R. Just realized that now! Good thing is, it defaults to 1