mA meter tach

It's all about the code!
Post Reply
User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol

mA meter tach

Post by rus084 »

i have scooter tachometer (was by oem) but controller chip has been broken .
Tachometr is mA meter , it can controlling with PWM help .
I want use it in multi modes . (you can see it in patch)
I wrote some code , but it doesn't work . (compiling without errors)
Andrey , can you help me?
Attachments
tachController.patch
(5.64 KiB) Downloaded 775 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

Code: Select all

	startSimplePwm(&displayPwm, "Display solenoid",
			DISPLAY_SWITCH , //GPIOB_10,
					[b]0[/b],
					DISPLAY_SOLENOID_PWM_FREQUENCY,
					applyPinState
					);
This zero is probably triggering https://sourceforge.net/p/rusefi/tickets/122/ known issue.

Try 0.2 a default duty cycle
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol

Re: mA meter tach

Post by rus084 »

i didn't know about 122nd ticket .
But i asked about another : i didn't defined "DISPLAY_SWITCH" and code doesn't know what is hw pin . where i can define it ?

Patch have all difference between "clear" code and my code .
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

rus084 wrote:i didn't know about 122nd ticket .
now you know about this defect which might be relevant
rus084 wrote: But i asked about another : i didn't defined "DISPLAY_SWITCH" and code doesn't know what is hw pin . where i can define it ?
No, you did not really ask about that. As far as I know, you've asked "I wrote some code , but it doesn't work" which is a typical case of http://rusefi.com/wiki/index.php?title=40
rus084 wrote: Patch have all difference between "clear" code and my code .
this is actually a problem. Your patch has too much stuff which has nothing to do with your question, this makes it harder to respond.

please google "how to ask a good question"
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

there is a bit of a mess around brain_pin enum, output_pin enum and OutputPin struct, I will now try to simplify this.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

russian wrote:there is a bit of a mess around brain_pin enum, output_pin enum and OutputPin struct, I will now try to simplify this.
Done. io_pin_e is not really needed any more, it would probably be eliminated pretty soon.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol

Re: mA meter tach

Post by rus084 »

[video][/video]

but method getRPM() return "0" everytime .
Attachments
tach2.patch
(5.6 KiB) Downloaded 750 times
User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol

Re: mA meter tach

Post by rus084 »

it's work !

Code: Select all

float rpm = getRpm() ;
return rpm/10000;
but i need https://sourceforge.net/p/rusefi/tickets/122/

else i have problem with power supply from laptop ( yersterday usb power in laptop was good ):
problem.png
problem.png (40 KiB) Viewed 9876 times
2.4V! but i didn't connect any devices to the discovery .
i hear beeping from laptop when discovery is connected . (hsdpa modem have more power consumption , but it work's good )
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

Would be nice if you try to fix it :)

The general idea - if PWM is below 0.01% or above 99.99% instead of doing the normal scheduling it should just pause PWM for same 10ms. So, somewhere it should set next event invocation to 10ms instead of 0.001% of period which breaks everything
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

Looks like this issue was resolved at some point in the past? I do not see any issues with zero or 100% PWM
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

I think this should be controlled via FSIO, not custom code.

FSIO would allow you define a formula which would translate your RPM into duty cycle, that's exactly what FSIO was designed for.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol

Re: mA meter tach

Post by rus084 »

you are right . but i have problems with setup FSIO
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: mA meter tach

Post by AndreyB »

rus084 wrote:i have problems with setup FSIO
please elaborate. have you seen http://rusefi.com/wiki/index.php?title=Manual:Flexible_Logic ?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply