Behaviour in neutral

Post Reply
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Behaviour in neutral

Post 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.
User avatar
Peter
Posts: 310
Joined: Fri Dec 14, 2018 9:07 pm
Location: North West Lancs, UK
Been thanked: 8 times

Re: Behaviour in neutral

Post 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.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Behaviour in neutral

Post 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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Peter
Posts: 310
Joined: Fri Dec 14, 2018 9:07 pm
Location: North West Lancs, UK
Been thanked: 8 times

Re: Behaviour in neutral

Post 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.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: Behaviour in neutral

Post 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.
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Behaviour in neutral

Post 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.

evil neodymium :twisted:
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: Behaviour in neutral

Post by geduxaz »

What i have tested, with FOC it hits hard. i broke CV joint.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: Behaviour in neutral

Post 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!
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Behaviour in neutral

Post 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?
evil neodymium :twisted:
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Behaviour in neutral

Post by johu »

Some rework in pwmgeneration_foc.cpp. For now, just avoid neutral
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
js1tr3
Posts: 42
Joined: Thu Jun 13, 2019 11:28 am
Location: A2 usa
Contact:

Re: Behaviour in neutral

Post 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.
Attachments
Screen Shot 2022-07-10 at 11.15.46 AM.png
1988 Porsche 911 targa with warp11 motor. Soon to be Tesla SDU.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Behaviour in neutral

Post by johu »

Oh indeed, in manual mode you also need to select a direction
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Behaviour in neutral

Post 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.
Attachments
stm32_foc.hex
(133.76 KiB) Downloaded 44 times
stm32_foc.bin
(47.54 KiB) Downloaded 58 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Behaviour in neutral

Post 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?
evil neodymium :twisted:
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Behaviour in neutral

Post by johu »

I have added it to the post above
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Behaviour in neutral

Post 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!
evil neodymium :twisted:
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Behaviour in neutral

Post 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.
evil neodymium :twisted:
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Behaviour in neutral

Post 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
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Behaviour in neutral

Post 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.
evil neodymium :twisted:
Post Reply