suggestions for the next release 5.17 -> 5.18
-
- 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
No it wasn't regen, the motor was trying to accelerate
390v at the moment
390v at the moment
Re: suggestions for the next release 5.17 -> 5.18
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
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
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
Christ, this firmware is evil!
So no neutral but hard stall?
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
-
- 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
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.
Re: suggestions for the next release 5.17 -> 5.18
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.
Re: suggestions for the next release 5.17 -> 5.18
No.. I was somehow funny. As i know that we should expect anything can happen on custom made stuff
-
- Posts: 751
- Joined: Tue Oct 29, 2019 2:48 pm
- Location: France
- Has thanked: 352 times
- Been thanked: 44 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
I'll make sure I have brake booster working before any testing then. Trying to source pump and sensor at the moment.
-
- 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
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 74 times
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
Thanks, all input helps!
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Romale
- Posts: 452
- Joined: Fri May 20, 2022 4:16 pm
- Location: Romania
- Has thanked: 216 times
- Been thanked: 49 times
Re: suggestions for the next release 5.17 -> 5.18
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) 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
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
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.
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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
1) answered elsewhere -> noRomale 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)?
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
- Romale
- Posts: 452
- Joined: Fri May 20, 2022 4:16 pm
- Location: Romania
- Has thanked: 216 times
- Been thanked: 49 times
Re: suggestions for the next release 5.17 -> 5.18
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
- Romale
- Posts: 452
- Joined: Fri May 20, 2022 4:16 pm
- Location: Romania
- Has thanked: 216 times
- Been thanked: 49 times
Re: suggestions for the next release 5.17 -> 5.18
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
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
It's not a pity, it's open source you don't need a motor control specialist to reprogram one of the digital inputs to another function
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
- Romale
- Posts: 452
- Joined: Fri May 20, 2022 4:16 pm
- Location: Romania
- Has thanked: 216 times
- Been thanked: 49 times
Re: suggestions for the next release 5.17 -> 5.18
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))
evil neodymium
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
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?
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 78 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Romale
- Posts: 452
- Joined: Fri May 20, 2022 4:16 pm
- Location: Romania
- Has thanked: 216 times
- Been thanked: 49 times
Re: suggestions for the next release 5.17 -> 5.18
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
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
More testing today and one other culprit located.
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
Code: Select all
/* Short pulse suppression */
if (DutyCycles[i] < minPulse)
{
DutyCycles[i] = 0;
}
else if (DutyCycles[i] > maxPulse)
{
DutyCycles[i] = FP_FROMINT(2);
}
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 80 times
-
- stm32_foc.bin
- (47.43 KiB) Downloaded 62 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
And here's a backport of the amplitude fix to 5.17 with traditional FW controller
- Attachments
-
- stm32_foc.bin
- (47.42 KiB) Downloaded 74 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- 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
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?
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.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
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.
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
-
- 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
sounds promising Johannes! I'll try them both over the weekend.
Re: suggestions for the next release 5.17 -> 5.18
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.
- johu
- Site Admin
- Posts: 5842
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 164 times
- Been thanked: 1062 times
- Contact:
Re: suggestions for the next release 5.17 -> 5.18
Seems we're on to something 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