Page 1 of 1

Behaviour in neutral

Posted: Thu Jun 30, 2022 11:27 pm
by catphish
As far as I can see, setting the inverter to neutral disables PWM output:

Code: Select all

      /* Shut down PWM on zero voltage request */
      if (0 == amp || 0 == dir)
      {
         timer_disable_break_main_output(PWM_TIMER);
      }
However there is a slightly alarming note on the wiki.
If they are both low, no current is fed to the motor making this essentially the neutral position.
Correction, this will not be a neutral position. Rather, it will be almost parking, if you turn on neutral at speed, there will be a very hard stop regen!
Please can someone confirm which is correct. I'm happy to update the wiki to remove the contradiction.

Re: Behaviour in neutral

Posted: Fri Jul 01, 2022 1:10 pm
by Peter
Hi Charlie. I will do a test this evening by selecting neutral when rolling with no throttle and again with a little throttle to see what happens.
For reference I have regen set up so it is only working when brake is pressed, so backing off throttle gives no regen, that way I can coast when off throttle.

Re: Behaviour in neutral

Posted: Fri Jul 01, 2022 2:37 pm
by johu
The behaviour is different in sine and FOC firmware. To be honest I never tested the FOC setup but I believe it is buggy due to what I see in the code and what you found on the wiki.
On the sine firmware it should work alright.

Re: Behaviour in neutral

Posted: Fri Jul 01, 2022 8:01 pm
by Peter
Tried selecting neutral whilst rolling with no throttle applied and did not regen, just coasted. Same with small amount of throttle. Hope that helps.

Re: Behaviour in neutral

Posted: Sat Jul 02, 2022 12:05 am
by catphish
Thanks both. I also had an opportunity to test this today for myself and it seems (at least with sine firmware) I also get coasting.

Re: Behaviour in neutral

Posted: Sat Jul 02, 2022 10:37 pm
by Romale
catphish wrote: Thu Jun 30, 2022 11:27 pm
Please can someone confirm which is correct. I'm happy to update the wiki to remove the contradiction.
fok firmware we get a hard stop

I would be very happy to have a roll on the neutral with the foc firmware, but I did not find what setting to apply so that this became possible.


Re: Behaviour in neutral

Posted: Mon Jul 04, 2022 9:22 pm
by geduxaz
What i have tested, with FOC it hits hard. i broke CV joint.

Re: Behaviour in neutral

Posted: Wed Jul 06, 2022 6:22 pm
by catphish
geduxaz wrote: Mon Jul 04, 2022 9:22 pm What i have tested, with FOC it hits hard. i broke CV joint.
Ouch! I'm very glad this works better in the sine version!

Re: Behaviour in neutral

Posted: Thu Jul 07, 2022 7:25 pm
by Romale
johu wrote: Fri Jul 01, 2022 2:37 pm The behaviour is different in sine and FOC firmware. To be honest I never tested the FOC setup but I believe it is buggy due to what I see in the code and what you found on the wiki.
On the sine firmware it should work alright.
what solution can be applied so that the neutral on the foc firmware also gives a free roll?

Re: Behaviour in neutral

Posted: Thu Jul 07, 2022 8:18 pm
by johu
Some rework in pwmgeneration_foc.cpp. For now, just avoid neutral

Re: Behaviour in neutral

Posted: Sun Jul 10, 2022 3:20 pm
by js1tr3
it looks like this also affects manual mode. which might explain why I can't get any PWM output when testing in manual mode. I will try connecting the forward signal and report back.

Re: Behaviour in neutral

Posted: Mon Jul 11, 2022 6:15 am
by johu
Oh indeed, in manual mode you also need to select a direction

Re: Behaviour in neutral

Posted: Wed Jul 13, 2022 6:19 pm
by johu
Here is a version you can try that should solve neutral behaviour.

I've replaced

Code: Select all

int dir = Param::GetInt(Param::dir);
with

Code: Select all

int dir = frqFiltered > FP_FROMINT(10) ? Encoder::GetRotorDirection() : Param::GetInt(Param::dir);
so when the rotor is moving it will use the actual rotor direction as direction, when stationary (frq < 10Hz) it will use the intended direction. Please check if it works.

Re: Behaviour in neutral

Posted: Thu Jul 28, 2022 11:14 am
by Romale
johu wrote: Wed Jul 13, 2022 6:19 pm Please check if it works.
It looks like I have the worst memory chip for wifi. it is constantly hanging at this stage
Screenshot_20220728-141019_1.png

please, can I have a .hex file?

Re: Behaviour in neutral

Posted: Sat Jul 30, 2022 5:21 pm
by johu
I have added it to the post above

Re: Behaviour in neutral

Posted: Sat Jul 30, 2022 7:39 pm
by Romale
johu wrote: Sat Jul 30, 2022 5:21 pm I have added it to the post above
thank you very much.
tomorrow I will definitely check on the buggy and report the results!

Re: Behaviour in neutral

Posted: Sun Jul 31, 2022 5:11 pm
by Romale
johu wrote: Sat Jul 30, 2022 5:21 pm I have added it to the post above
I have not tried high speed, but up to 35km/h turning on the neutral gives a free roll!
it works!
thank you so much for solving this problem.

if you turn it forward again in motion, it does not react to the gas pedal until I stop, then it can go again.

Re: Behaviour in neutral

Posted: Sun Jul 31, 2022 6:48 pm
by johu
Great!
Yes it is programmed like that. You can raise dirchangerpm to overcome. But it will allow you to switch to reverse at speed. Not quite sure what happens then

Re: Behaviour in neutral

Posted: Sun Jul 31, 2022 6:51 pm
by Romale
johu wrote: Sun Jul 31, 2022 6:48 pm You can raise dirchangerpm to overcome.
ok. I will definitely test it.


I tested 500 and 1000. it works great. also, if you turn on the neutral at speed and then "forward", the pedal control returns after the speed drops to the specified value. left 500rpm. I liked it very much.

Thanks for this fix.