Page 1 of 1

mA meter tach

Posted: Wed Jan 07, 2015 7:41 pm
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?

Re: mA meter tach

Posted: Wed Jan 07, 2015 8:20 pm
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

Re: mA meter tach

Posted: Wed Jan 07, 2015 8:49 pm
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 .

Re: mA meter tach

Posted: Wed Jan 07, 2015 8:54 pm
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"

Re: mA meter tach

Posted: Wed Jan 07, 2015 9:18 pm
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.

Re: mA meter tach

Posted: Thu Jan 08, 2015 3:06 am
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.

Re: mA meter tach

Posted: Sat Jan 10, 2015 3:25 pm
by rus084
[video][/video]

but method getRPM() return "0" everytime .

Re: mA meter tach

Posted: Mon Jan 12, 2015 10:51 am
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 10027 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 )

Re: mA meter tach

Posted: Tue Jan 13, 2015 1:06 am
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

Re: mA meter tach

Posted: Wed Jan 14, 2015 3:17 am
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

Re: mA meter tach

Posted: Mon May 11, 2015 3:23 pm
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.

Re: mA meter tach

Posted: Mon May 11, 2015 3:54 pm
by rus084
you are right . but i have problems with setup FSIO

Re: mA meter tach

Posted: Mon May 11, 2015 8:57 pm
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 ?