suggestions for the next release 5.17 -> 5.18

Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: suggestions for the next release 5.17 -> 5.18

Post by Dusty4 »

No it wasn't regen, the motor was trying to accelerate 😳
390v at the moment
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: suggestions for the next release 5.17 -> 5.18

Post by geduxaz »

hi, i also tried this last version with idiqsplit at 50% and syncadv=0 and fwkp/ki=0.
i got to acceleration when coming off throttle at ~60-70kmh.
and did a first thing that came to mind- turned forward switch off. that made motor to stall immediately with big bang and i broke CV joint :D
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Christ, this firmware is evil!
So no neutral but hard stall?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: suggestions for the next release 5.17 -> 5.18

Post by Dusty4 »

Jeez! That must have given you a fright! The unintended acceleration startled me enough! I just stood on the brake pedal hard and after a couple of seconds the acceleration stopped.
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: suggestions for the next release 5.17 -> 5.18

Post by geduxaz »

johu wrote: Tue Apr 26, 2022 11:42 am Christ, this firmware is evil!
So no neutral but hard stall?
Yes. I have three possition switch. Forward/NC/backwards. So in the middle both forward and backwards pins are not connected to +12V. This should be Neutral?

I think i saw this also in earlier Firmware. But somehow forgot to mention and not to use it.
User avatar
geduxaz
Posts: 125
Joined: Wed Jun 23, 2021 7:00 am
Has thanked: 3 times

Re: suggestions for the next release 5.17 -> 5.18

Post by geduxaz »

Dusty4 wrote: Tue Apr 26, 2022 12:13 pm Jeez! That must have given you a fright!
No.. I was somehow funny. As i know that we should expect anything can happen on custom made stuff :)
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: suggestions for the next release 5.17 -> 5.18

Post by RetroZero »

I'll make sure I have brake booster working before any testing then. Trying to source pump and sensor at the moment.
Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: suggestions for the next release 5.17 -> 5.18

Post by Dusty4 »

Just to add further confusion, I've been driving with the 5.14 firmware with the attached parameters. If I very slowly release the accelerator pedal I don't get the over current trip above 7000rpm, I still get the unintended regen though even if I turn regen off. But I can control how much regen with how slowly I release the pedal.
Attachments
params (1).json
(1.38 KiB) Downloaded 69 times
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Thanks, all input helps!
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: suggestions for the next release 5.17 -> 5.18

Post by Romale »

new suggestion/question:
1) is it possible to work with ss41 hall sensors connected instead of an encoder? This would make it possible to control many factory motors, for example, a hub-motor for a motorcycle
2) Is it possible to make an economy mode button like in the original Nissan leaf ?

3) The other day I tested my buggy with a motor and inverter Leaf, settings list from Toyota gt.json, when I drove up to the traffic light, turned on the neutral (switch three positions, forward-neutral-backward) and it turned out a very hard regen with the controller off! I was even scared, the inverter burned out, but I turned off and re-turned on the power, it went. How do I make sure that in the neutral position there is a regen 0 or a configurable field (for example, use it when towing for a weak charge with a regen)?
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Did some more testdriving myself today using the "evil" firmware from above. Indeed as soon as field weakening is requested the car starts to accelerate on its own also not obeying the rev limiter. The torque it still produces at 8000 rpm and above (that's where my rev counter stops) is amazing. Unwanted though.

I then dialed down fwkp=10 and fwki=0 to make it less scary. The unwanted acceleration is still there but quite weak. Something strange can be noticed: as soon as FW kicks in ud reacts accordingly. But then the reaction to that is more iq! WTF
At that point I come completely off the throttle, id remains at its 40A set point but iq, which is supposed to be 0 is not 0. It slowly decreases with speed. What does this tell us? Behaviour seems similar with different values for syncadv.
Attachments
syncadv10.png
syncadv0.png
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Romale wrote: Sat May 21, 2022 5:34 pm new suggestion/question:
1) is it possible to work with ss41 hall sensors connected instead of an encoder? This would make it possible to control many factory motors, for example, a hub-motor for a motorcycle
2) Is it possible to make an economy mode button like in the original Nissan leaf ?

3) The other day I tested my buggy with a motor and inverter Leaf, settings list from Toyota gt.json, when I drove up to the traffic light, turned on the neutral (switch three positions, forward-neutral-backward) and it turned out a very hard regen with the controller off! I was even scared, the inverter burned out, but I turned off and re-turned on the power, it went. How do I make sure that in the neutral position there is a regen 0 or a configurable field (for example, use it when towing for a weak charge with a regen)?
1) answered elsewhere -> no
2) that would be a VCU task, it could reduce throtcur for example
3) which version is that? Should be fixed in 5.14.R
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: suggestions for the next release 5.17 -> 5.18

Post by Romale »

By the way, I think I've figured out the reason for the uncontrolled regen! In fact, it is controlled, yesterday riding a buggy with a low voltage, I noticed a 100% similarity with the behavior of the Kelly controller with block switching, the essence of this phenomenon is, for example, you drive 70 km / h, reset the gas a little, and then immediately add. But, if you quickly add to the throttle position for the current 70 km/ h, everything will be OK, and if you add to the position corresponding to, for example, 60 km / h, then the controller, instead of simply not controlling the motor, makes a sharp braking in order to very quickly slow down to those 60 km/ h. in Kelly's sine controllers, this has already been eliminated, where after resetting the throttle, no braking or accelerating control is created when it is pressed again until the throttle position reaches the position corresponding to the current speed. I hope I was able to explain my thought.
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: suggestions for the next release 5.17 -> 5.18

Post by Romale »

johu wrote: Tue May 24, 2022 6:13 pm
2) that would be a VCU task, it could reduce throtcur for example
3) which version is that? Should be fixed in 5.14.R
2)It's a pity, for this you need to connect and make a new setting, it would be much more convenient to close one switch from the outside in order to switch a less powerful version of the control.

3) 4.97.R
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Romale wrote: Wed May 25, 2022 12:19 pm 2)It's a pity, for this you need to connect and make a new setting, it would be much more convenient to close one switch from the outside in order to switch a less powerful version of the control.
It's not a pity, it's open source :D you don't need a motor control specialist to reprogram one of the digital inputs to another function ;)
Romale wrote: Wed May 25, 2022 12:19 pm 3) 4.97.R
Yes, please upgrade to 5.14.R that should solve the problem
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: suggestions for the next release 5.17 -> 5.18

Post by Romale »

johu wrote: Wed May 25, 2022 1:22 pm you don't need a motor control specialist to reprogram one of the digital inputs to another function ;)

I can do anything with a grinder, welding or fiberglass, I will assemble any electric car from ready-made things, but I am very weak in programming, and yet it would be convenient when you let an inexperienced driver just push the switch to lower the power by three, and use aggressive settings myself)) :D
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Just switch in an appropriate resistor into the throttle line, that will limit maximum throttle without any software change. Sorry, I don't currently have time for bells and whistles. Maybe somebody on the forum wants to quickly add that in and post it here.

EDIT: Wait a minute.... it actually exists! You can use the BMS input for that. You can set a throttle limit, both regen and acceleration when BMS input becomes high

Alright, back to the high speed topic.
I switched off FW and just set idiqsplit to 70%. I also added another filter to limit slew rate of throttle command.

It doesn't really help. You can see when I come off throttle suddenly id starts dropping down to the current limit. The regulator tries to counteract that by shooting up to maximum possible amplitude. Also uq drops off quickly, not sure if that's just normal. It's hard to say what causes what.

Isn't something fundamentally going wrong here?
Attachments
testfw.json
(242 Bytes) Downloaded 72 times
syncadv10.png
syncadv0.png
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: suggestions for the next release 5.17 -> 5.18

Post by Romale »

johu wrote: Wed May 25, 2022 3:28 pm Wait a minute.... it actually exists! You can use the BMS input for that. You can set a throttle limit, both regen and acceleration when BMS input becomes high
This is really a super solution! Thanks, I'll try to change the settings.

By the way, I recently installed a new firmware 5.17.R foc, and checked the action when in motion to turn on neutral. nothing has changed, with the blow of the cruel regen.

at the same time , I did not change any regen settings , but the throttle reset began to slow down more gently

Also included checked the hill hold function, he tries to hold but still rolls back. I think it's because I have 125 volts instead of 380.
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

More testing today and one other culprit located.

Code: Select all

      /* Short pulse suppression */
      if (DutyCycles[i] < minPulse)
      {
         DutyCycles[i] = 0;
      }
      else if (DutyCycles[i] > maxPulse)
      {
         DutyCycles[i] = FP_FROMINT(2);
      }
It's the part that maps very large or very small duty cycles to full on or full off. Works great with the simple sine code but with current control loops that kind of non-linearity is deadly. With that removed and maximum amplitude restricted I can at least spin up to around 6500 rpm with FW disabled and no weird oscillations.

I have also moved the FW controller to the slower 10ms task to make it less springy.

I was kind of tired to test FW again, could someone please take that over? Parameters also attached. They lower ocurlim to 400A to make things less harsh. Be prepared that the FW algorithm makes the car take off by itself as soon as it steps into action. It needs a well tuned syncadv to not do that. I guess I should also back-port the duty cycle change to the "old" FW controller and see what it does.
So whoever tests this should first tune syncadv until the FW controller no longer causes unwanted acceleration and then tune fwkp/fwki for good high speed operation

Source: https://github.com/jsphuebner/stm32-sin ... fw-control
Attachments
testfw.json
(195 Bytes) Downloaded 74 times
stm32_foc.bin
(47.43 KiB) Downloaded 56 times
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

And here's a backport of the amplitude fix to 5.17 with traditional FW controller
Attachments
stm32_foc.bin
(47.42 KiB) Downloaded 66 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: suggestions for the next release 5.17 -> 5.18

Post by EV_Builder »

Trying to help here but you complain that some kind of PID loop tries to reach a target setpoint by going to maximum amplification.

But why is this target setpoint set and at which value?

If there are multiple levels/loops stacked on each other we need check them one for one.

Is there a design schema somewhere of what you do in the firmware? And then I mean with the focus on control strategy?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

It's just the very generic FOC control scheme. So one PI controller for d current, one for q current.

The controller receive a current setpoint that we can assume constant for now and the actual current measured on the motor. From that it outputs a voltage value to maintain that current. As expected the higher the rotor speed the higher this voltage value will be until it tops out. With extra d current this point can be stretched out, thats what field weakening is.

Anyway, operating at high modulation suffered from non-linearity because, say 98% voltage value is mapped to 100% to avoid very short duty cycles. Actually, if we didn't do this in software, hardware would eventually do it "for us" with the various delay times caused by drivers and the IGBT itself. So it is advisable to stay away from the extremes.

That's what I hadn't done and therefor even without the challenging field weakening the control loop started oscillating when approaching full amplitude.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: suggestions for the next release 5.17 -> 5.18

Post by Dusty4 »

sounds promising Johannes! I'll try them both over the weekend.
LeonB
Posts: 55
Joined: Fri Mar 26, 2021 12:19 am
Location: Germany

Re: suggestions for the next release 5.17 -> 5.18

Post by LeonB »

I tried out the new FW at fwkp=10 and fwki=0 with my Gen 3 Prius drivetrain. It created some amazing torque and when I tried to slow the car down, the inverter pulled twice as many amps from the battery than I have ever been able to. Then something tripped out and contactors started to rattle. Everything went back to normal after restarting the car, yet this was way too violent for me to continue trying to tune it.
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: suggestions for the next release 5.17 -> 5.18

Post by johu »

Seems we're on to something :D thanks for trying. I think I should also implement ocurlim in software for those variants that don't have the hardware comparator on board. What had you set syncadv to?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply