aot93 wrote: ↑Sun Sep 04, 2022 10:04 am
To add some more to the above:
HV voltage at the inverter is only sent until a torque request is made to the inverter, so it's useful only for pre-charging.
Once a torque request has been made it looks like the byte order changes, I've not worked that out yet to get voltage reading from the inverter whilst it's running. The BMS take care of voltage limit and the charger reports HV from the other side of the contactors
Ah that might be why it's being a bit odd then. I am only intending to use it for precharging, but in my setup the pedal read and torque requests are also active during the precharge cycle, even if it's requesting 0 torque.
I'll rewrite the code to precharge in setup before I get to normal running mode and see if that changes things.
The rewrite worked. Before you start sending the first torque requests the inverter does send the correct voltage information. After that it does change.
Now using it successfully to aid with precharge.
On to getting it spinning now. I think my issues could be one of two things.
RSDN. This is pulled low from what I have seen. How have people done that? I saw one post that said it needed 8v, so I gave it 8v via resistor in series from 12v, I also tried just grounding it.
My S1 and S2 resistance readings from the motor are within spec, but also at a reading a measurement that they could be either. I have swapped them once to no avail. Does the inverter spit out any canbus error messages if it doesn't get the information it wants or needs?
LRBen wrote: ↑Thu Sep 08, 2022 8:35 pm
On to getting it spinning now. I think my issues could be one of two things.
RSDN.
I have got builds and test rigs running with this floating. Can anyone confirm what this signal does, does the inverter contain a bleed resistor on the HV bus that gets activated using this signal or can?
Please share your code somewhere so others can review it. Spinning using the Rear inverter is quite straight forward if you know what canbus its looking for.
tom91 wrote: ↑Thu Sep 08, 2022 8:55 pm
I have got builds and test rigs running with this floating. Can anyone confirm what this signal does, does the inverter contain a bleed resistor on the HV bus that gets activated using this signal or can?
Please share your code somewhere so others can review it. Spinning using the Rear inverter is quite straight forward if you know what canbus its looking for.
I'll try just leaving floating then. My initial thought based on information here is that giving it 12v acts as a shut down signal for the inverter, so that how I initially had it setup with it floating as default.
My code I'm running is here, it's rather messy with a few currently unused parts, and I still need to add in credit to aot since I've copy pasted a good chunk of your code.: https://github.com/SomersetEV/MG-F-E-VC ... _F_VCU.ino
The relevant canbus part is this. ChargerEVSE.check is a 100ms timer. I have confirmed all this data is getting onto the canbus today via savvycan.
I would check:
Physical connection between the motor and inverter, if it's not 100% it won't work
DC HV is it over 200v?
I'ts been a while since i did tests on the RSDN, mine is switched to ground in normal operation, otherwise it's pulled to 12v.
Did a quick scan of your code and not seeing anything obvious, something to try is a dedicated metro timer for the inverter comms I seem to recall some inconsistency when sharing timers
aot93 wrote: ↑Thu Sep 08, 2022 9:25 pm
I would check:
Physical connection between the motor and inverter, if it's not 100% it won't work
DC HV is it over 200v?
I'ts been a while since i did tests on the RSDN, mine is switched to ground in normal operation, otherwise it's pulled to 12v.
Did a quick scan of your code and not seeing anything obvious, something to try is a dedicated metro timer for the inverter comms I seem to recall some inconsistency when sharing timers
The physical connection is kind of what I am thinking at the moment, I'll double check the resolver connector all sit properly tomorrow.
DC HV is 334v.
I'll try a dedicated timer for comms as well. Glad to hear it's not thing silly in my code.
Actually a closer look at your code and it looks like your torqueRequest is not scaled correctly.
It looks like throtlepot should be *10
and you are missing the torqueRequest += 10000 offset.
Worth checking what you are sending via savycan, a 1nm request should have 0x27 on b2 and 0x1a on b3 of 0x287 which is decimal 10010
Formula is (a*256+b-10000)/10
aot93 wrote: ↑Fri Sep 09, 2022 12:47 am
Actually a closer look at your code and it looks like your torqueRequest is not scaled correctly.
It looks like throtlepot should be *10
and you are missing the torqueRequest += 10000 offset.
Worth checking what you are sending via savycan, a 1nm request should have 0x27 on b2 and 0x1a on b3 of 0x287 which is decimal 10010
Formula is (a*256+b-10000)/10
Yeah I definitely have that wrong. I'm just sending torque request as an actual decimal from 0 to 200. I did notice that I was only using the LSB even for max torque request. Will change this today and update.
LRBen wrote: ↑Fri Sep 09, 2022 3:02 pm
It's all good now! Have spinning wheels. Thanks for the assistance! I think I see how that throttle map works now as well.
To confirm RSDN, when floating or tied to 8v, inverter works. When tied to 12v, inverter shuts down. As per the wiki.
Could you do the following, measure HV voltage decay (so precharge then close contactors as normal, then open contactors after reaching full votlage) when leaving RSDN floating and with RSDN tied to 12V.
As the decay on the inverter without toggling RSDN is a long time, then again the outlander probally uses the DCDC or PTC to get rid of the HV voltage in caps.
tom91 wrote: ↑Fri Sep 09, 2022 3:40 pm
Could you do the following, measure HV voltage decay (so precharge then close contactors as normal, then open contactors after reaching full votlage) when leaving RSDN floating and with RSDN tied to 12V.
As the decay on the inverter without toggling RSDN is a long time, then again the outlander probally uses the DCDC or PTC to get rid of the HV voltage in caps.
So with RSDN floating, Decay is almost instant, within 12 frames of canbus messages from the charger to 0v. With RSDN tied to 12v, decay is very slow, probably well over 30 seconds.
My setup has the charger/dc-dc connected to the inverter, but no water heater.
I have the wheels spinning backwards, not sure if this is the default forward direction of the inverter. Spinning clock wise if you are looking at the motor output.
I thought initially it was just the resolver wires mixed up. But that didn't work. I'm pretty sure the phase wires are correct as they were still attached to the inverter when I got it and you can only attach them one way up on the motor and the original connector to the motor was intact on this loom. Since I get good performance I'm guessing this is just the default direction of motor spin, or if not it's good enough and not worth the hassle of changing around phase and resolver wires.
So I thought it best just to run the motor in reverse via the canbus commands. But this is proving trickier to do in practice. I tried just multiplying the torque request by -1 and also at a few different stages such as throttlePot etc. I'm thinking it's a programming thing with ints and negative numbers. If use float then the lowbyte/highbyte function doesn't work.
I can't see anything obvious in any code published.
tom91 wrote: ↑Sat Sep 10, 2022 3:57 pm
I wrote my code so I can flip it. Yes the torque commands flip when spinning the other way. Multiply by -1 before you apply the 10000 offset.
I've tried a few variations on this with no affect. Such as torqueRequest = torqueRequest *-1;. Then decided to add torqueRequest1 as a different int to do the negative multiplication.
I also tried torqueRequest = torqueRequest - (torqueRequest*2). As a round about way of flipping it.
aot93 wrote: ↑Sat Sep 10, 2022 5:30 pm
Are you casting that throttlePosition float to int later?
If not that can cause you problems, mixing floats and ints is often problematic.
Not sure why I had throttlePosition as a float. Changed to int and it still works, but still in reverse. Keyboard then died on my workshop computer so I'll try again on Thursday when I am back there and get some canbus logs.
Does the inverter care if the motor runs forward or backwards? I'm aksing because i mounted one motor forward (rear) and one backward (front) in my car. Will they both behave the same regarding max RPM, Regen etc...