Page 1 of 1

The motor turns in the opposite direction

Posted: Sun May 26, 2024 12:56 pm
by trataritatatata
Hi all. I bought your board, connected it and the motor spins in the opposite direction. I checked all connections 3 times and they are correct. Please help me with the setup.
The motor rotates in the opposite direction regardless of whether the mode is forward or reverse.
Sorry for the bad text. I am writing through Google Translator.

Motor Nissan EM57 2017 8700300056
Inverter Nissan Gen2
Firmware Version 5.14R-foc

My parameters
"curkp": 32,
"curki": 10000,
"curkifrqgain": 50,
"fwkp": -150,
"ffwstart": 200,
"syncofs": 0,
"syncadv": 10,
"polepairs": 4,
"sincosofs": 2048,
"fmax": 500,
"dirchrpm": 100,
"dirmode": 1,
"snsm": 14,
"pwmfrq": 1,
"deadtime": 78,
"ocurlim": 700,
"il1gain": 1.65,
"il2gain": 1.65,
"udcgain": 5.65,
"udcofs": 250,
"udclim": 540,
"potmin": 0,
"potmax": 4095,
"pot2min": 4095,
"pot2max": 4095,
"potmode": 2,
"throtramp": 4,
"throtramprpm": 20000,
"throtcur": 4.5,
"brknompedal": -35,
"regenramp": 0.25,
"brknom": 20,
"brkmax": -25,
"brkcruise": -20,
"brkrampstr": 10,
"brkout": -50,
"bmslimhigh": 50,
"bmslimlow": -1,
"udcmin": 250,
"udcmax": 520,
"idcmax": 5000,
"idcmin": -5000,
"idckp": 2,
"idcflt": 9,
"tmphsmax": 150,
"tmpmmax": 300,
"throtmax": 100,
"throtmin": -100,
"chargemode": 0,
"chargecur": 0,
"chargekp": 80,
"chargeki": 10,
"chargeflt": 8,
"chargepwmin": 0,
"chargepwmax": 83.5,
"idlespeed": -100,
"idlethrotlim": 50,
"idlemode": 3,
"speedkp": 0.25,
"speedflt": 5,
"cruisemode": 2,
"udcsw": 280,
"tripmode": 0,
"bootprec": 0,
"pwmfunc": 0,
"pwmgain": 100,
"pwmofs": 0,
"canspeed": 1,
"canperiod": 1,
"nodeid": 1,
"manualiq": 0,
"manualid": 0

Re: The motor turns in the opposite direction

Posted: Sun May 26, 2024 8:35 pm
by Zieg
Are you using original wiring to the resolver or did you wire that yourself? Sometimes it is easy to get wrong since the Nissan documentation isn't very good. That combined with the pinswap setting being wrong (see below) can make it turn backward.

If the board is old enough you might need to do the pinswap as described here: viewtopic.php?t=2760

Finally you will have to adjust your syncofs as described at the bottom here: https://openinverter.org/wiki/Parameters

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 8:34 am
by trataritatatata
Zieg wrote: Sun May 26, 2024 8:35 pm Are you using original wiring to the resolver or did you wire that yourself? Sometimes it is easy to get wrong since the Nissan documentation isn't very good. That combined with the pinswap setting being wrong (see below) can make it turn backward.

If the board is old enough you might need to do the pinswap as described here: viewtopic.php?t=2760

Finally you will have to adjust your syncofs as described at the bottom here: https://openinverter.org/wiki/Parameters
The wiring is factory and I double checked everything several times.
The board was purchased about 2 years ago.
If you set the syncofs parameter to 32768, the motor starts spinning correctly. But all the same, when reverse gear is engaged, the car goes forward.

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 9:28 am
by johu
Do not alter syncofs.

Just reverse your gear selection either per dirmode parameter or physically and be happy. Reverse=Forward

Also upgrade to the latest firmware for safe operation: https://github.com/jsphuebner/stm32-sine/releases (stm32_foc.bin)

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 10:48 am
by trataritatatata
I entered the command get pinswap and it returned 4
I changed it to pinswap 6 and the motor stopped turning and made a knocking noise in reverse gear.


Could there be a problem with the resolver? The inverter is 2nd generation and the motor is from 3rd generation? Number on the engine 8700300056

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 11:14 am
by johu
Like said, don't mess with any parameters, just accept that the label reverse means forward and vice versa.

It runs fine apart from spinning in the opposite direction, right?

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 12:20 pm
by trataritatatata
johu wrote: Mon May 27, 2024 11:14 am Like said, don't mess with any parameters, just accept that the label reverse means forward and vice versa.

It runs fine apart from spinning in the opposite direction, right?
Everything seems to be working fine except that the motor is spinning in the opposite direction.
My back almost knocked down the garage door, I turned off the ignition in time.

If syncofs is 0
I checked the rotation in all modes of the dirmode parameter and in all modes and regardless of the gear shift switch, the motor always spins backwards.

photo of my board

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 12:25 pm
by uhi22
There is confusion, maybe due to the translation. Which of the statements is true?
(A) The motor is spinning in the opposite direction. You select forward, and it moves backwards. You select backward, and it moves forward.
(B) The car always moves backwards. You select forward, it moves backwards. You select backward, it moves backward.

Re: The motor turns in the opposite direction

Posted: Mon May 27, 2024 12:27 pm
by trataritatatata
uhi22 wrote: Mon May 27, 2024 12:25 pm There is confusion, maybe due to the translation. Which of the statements is true?
(A) The motor is spinning in the opposite direction. You select forward, and it moves backwards. You select backward, and it moves forward.
(B) The car always moves backwards. You select forward, it moves backwards. You select backward, it moves backward.
option B

Re: The motor turns in the opposite direction

Posted: Tue May 28, 2024 9:22 am
by trataritatatata
Guys, help me make the car move forward.
Only if you change the syncofs parameter to 32768 the car moves forward.

Re: The motor turns in the opposite direction

Posted: Tue May 28, 2024 10:34 am
by uhi22
In the description of the parameters and spot values https://openinverter.org/wiki/Parameters
we find "dir", with the explanation Rotation direction. -1=REV, 0=Neutral, 1=FWD
This could help, to split the search range into two two smaller search ranges. There are two possibilies:
(C): The dir follows your direction switch. This means, the switch is correctly configured, but the software does not consider dir for the motor actuation.
(D) The dir always shows the same direction. This means, your direction switch is not correctly evaluated.

Which case do you see?

Re: The motor turns in the opposite direction

Posted: Tue May 28, 2024 11:10 am
by trataritatatata
uhi22 wrote: Tue May 28, 2024 10:34 am In the description of the parameters and spot values https://openinverter.org/wiki/Parameters
we find "dir", with the explanation Rotation direction. -1=REV, 0=Neutral, 1=FWD
This could help, to split the search range into two two smaller search ranges. There are two possibilies:
(C): The dir follows your direction switch. This means, the switch is correctly configured, but the software does not consider dir for the motor actuation.
(D) The dir always shows the same direction. This means, your direction switch is not correctly evaluated.

Which case do you see?
C

When you switch the 3-position toggle switch, the parameters change.

Re: The motor turns in the opposite direction

Posted: Tue May 28, 2024 2:06 pm
by trataritatatata
I turned the shaft by hand and looked at the angle parameter. During one revolution of the shaft, it changed 4 times 0-360 degrees.
If you look at the shaft, I turned it counterclockwise and the readings increased. If you turn it clockwise, the readings decrease.

Re: The motor turns in the opposite direction

Posted: Tue May 28, 2024 3:26 pm
by uhi22
This leads to the next question. Which is the expected behavior?

(E) It is normal, that the angle spot value changes multiple times from 0 to 360°. Because the angle is a "virtual angle" which counts per (resolver?) pole pair, not per physical revolution.
(F) During one physical revolution of the motor, the "angle" spot value shall ramp exactly once from 0 to 360°. No matter how many pole pairs the motor has.

[Edit] My guess would be (F), but I do not know.
[Edit2] There is also the spot value "turns", for which I would assume that it increases once per physical revolution, and decreases in the other direction. Does forward mean increasing and backwards decreasing? Or I'm totally on the wrong path?

Maybe @johu could shed some light into the dark. And when it is clearified, we should put it to the spot value description in the wiki.

Re: The motor turns in the opposite direction

Posted: Tue May 28, 2024 3:55 pm
by trataritatatata
With one rotation of the motor shaft, the angle changes 4 times from 0-360 degrees.
0-360 0-360 0-360 0-360

What if you try to move the resolver from another motor?

Re: The motor turns in the opposite direction

Posted: Wed May 29, 2024 8:40 pm
by johu
The behaviour is expected, both motor and resolver have 4 polepairs so one physical turn is 4 electrical turns.
I'm also puzzled that pinswap=6 stops the motor because the pins are swapped on the mini mainboard (viewtopic.php?t=2760)

Can you post the output of http://192.168.4.1/cmd?cmd=json%20hidden

That includes the hidden parameters. Maybe one is off

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 9:48 am
by trataritatatata
I updated the firmware to the latest version. The motor has stopped turning completely and is just making noise. I think I need to configure something.
{
"iqkp": {"unit":"","id":107,"value":32.00,"isparam":true,"minimum":0.00,"maximum":20000.00,"default":32.00,"category":"Motor","i":0},
"idkp": {"unit":"","id":149,"value":32.00,"isparam":true,"minimum":0.00,"maximum":20000.00,"default":32.00,"category":"Motor","i":1},
"curki": {"unit":"","id":108,"value":10000.00,"isparam":true,"minimum":0.00,"maximum":100000.00,"default":20000.00,"category":"Motor","i":2},
"vlimflt": {"unit":"","id":145,"value":10.00,"isparam":true,"minimum":0.00,"maximum":16.00,"default":10.00,"category":"Motor","i":3},
"vlimmargin": {"unit":"dig","id":141,"value":2500.00,"isparam":true,"minimum":0.00,"maximum":10000.00,"default":2500.00,"category":"Motor","i":4},
"fwcurmax": {"unit":"A","id":144,"value":-100.00,"isparam":true,"minimum":-1000.00,"maximum":0.00,"default":-100.00,"category":"Motor","i":5},
"syncofs": {"unit":"dig","id":70,"value":0.00,"isparam":true,"minimum":0.00,"maximum":65535.00,"default":0.00,"category":"Motor","i":6},
"lqminusld": {"unit":"mH","id":139,"value":0.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":0.00,"category":"Motor","i":7},
"fluxlinkage": {"unit":"mWeber","id":140,"value":90.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":90.00,"category":"Motor","i":8},
"syncadv": {"unit":"dig/Hz","id":133,"value":10.00,"isparam":true,"minimum":0.00,"maximum":65535.00,"default":10.00,"category":"Motor","i":9},
"polepairs": {"unit":"","id":32,"value":4.00,"isparam":true,"minimum":1.00,"maximum":16.00,"default":2.00,"category":"Motor","i":10},
"respolepairs": {"unit":"","id":93,"value":4.00,"isparam":true,"minimum":1.00,"maximum":16.00,"default":1.00,"category":"Motor","i":11},
"sincosofs": {"unit":"dig","id":131,"value":2048.00,"isparam":true,"minimum":1.00,"maximum":4096.00,"default":2048.00,"category":"Motor","i":12},
"encmode": {"unit":"0=Single, 1=AB, 2=ABZ, 3=SPI, 4=Resolver, 5=SinCos","id":75,"value":4.00,"isparam":true,"minimum":0.00,"maximum":5.00,"default":0.00,"category":"Motor","i":13},
"fmax": {"unit":"Hz","id":9,"value":500.00,"isparam":true,"minimum":21.00,"maximum":1000.00,"default":200.00,"category":"Motor","i":14},
"numimp": {"unit":"ppr","id":15,"value":60.00,"isparam":true,"minimum":8.00,"maximum":8192.00,"default":60.00,"category":"Motor","i":15},
"dirchrpm": {"unit":"rpm","id":87,"value":100.00,"isparam":true,"minimum":0.00,"maximum":20000.00,"default":100.00,"category":"Motor","i":16},
"dirmode": {"unit":"0=Button, 1=Switch, 2=ButtonReversed, 3=SwitchReversed, 4=DefaultForward","id":95,"value":1.00,"isparam":true,"minimum":0.00,"maximum":4.00,"default":1.00,"category":"Motor","i":17},
"snsm": {"unit":"12=KTY83-110, 13=KTY84-130, 14=Leaf, 15=KTY81-110, 16=Toyota, 21=OutlanderFront, 22=EpcosB57861-S, 23=ToyotaGen2","id":46,"value":14.00,"isparam":true,"minimum":12.00,"maximum":23.00,"default":12.00,"category":"Motor","i":18},
"pwmfrq": {"unit":"0=17.6kHz, 1=8.8kHz, 2=4.4KHz","id":13,"value":1.00,"isparam":true,"minimum":0.00,"maximum":2.00,"default":1.00,"category":"Inverter","i":19},
"pwmpol": {"unit":"0=ActHigh, 1=ActLow","id":52,"value":1.00,"isparam":true,"minimum":0.00,"maximum":1.00,"default":0.00,"category":"Inverter","i":20},
"deadtime": {"unit":"dig","id":14,"value":78.00,"isparam":true,"minimum":0.00,"maximum":255.00,"default":63.00,"category":"Inverter","i":21},
"ocurlim": {"unit":"A","id":22,"value":700.00,"isparam":true,"minimum":-65536.00,"maximum":65536.00,"default":100.00,"category":"Inverter","i":22},
"il1gain": {"unit":"dig/A","id":27,"value":1.65,"isparam":true,"minimum":-100.00,"maximum":100.00,"default":4.68,"category":"Inverter","i":23},
"il2gain": {"unit":"dig/A","id":28,"value":1.65,"isparam":true,"minimum":-100.00,"maximum":100.00,"default":4.68,"category":"Inverter","i":24},
"udcgain": {"unit":"dig/V","id":29,"value":6.25,"isparam":true,"minimum":0.00,"maximum":4095.00,"default":6.15,"category":"Inverter","i":25},
"udcofs": {"unit":"dig","id":77,"value":271.00,"isparam":true,"minimum":0.00,"maximum":4095.00,"default":0.00,"category":"Inverter","i":26},
"udclim": {"unit":"V","id":48,"value":540.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":540.00,"category":"Inverter","i":27},
"snshs": {"unit":"0=JCurve, 1=Semikron, 2=MBB600, 3=KTY81, 4=PT1000, 5=NTCK45_2k2, 6=Leaf, 7=BMW-i3","id":45,"value":6.00,"isparam":true,"minimum":0.00,"maximum":7.00,"default":0.00,"category":"Inverter","i":28},
"pinswap": {"unit":"0=None, 1=Currents12, 2=SinCos, 4=PWMOutput13, 8=PWMOutput23","id":109,"value":4.00,"isparam":true,"minimum":0.00,"maximum":15.00,"default":0.00,"category":"Inverter","i":29},
"modmax": {"unit":"dig","id":148,"value":37836.00,"isparam":true,"minimum":37000.00,"maximum":45000.00,"default":37836.00,"category":"Inverter","i":30},
"potmin": {"unit":"dig","id":17,"value":550.00,"isparam":true,"minimum":0.00,"maximum":4095.00,"default":0.00,"category":"Throttle","i":31},
"potmax": {"unit":"dig","id":18,"value":3000.00,"isparam":true,"minimum":0.00,"maximum":4095.00,"default":4095.00,"category":"Throttle","i":32},
"pot2min": {"unit":"dig","id":63,"value":300.00,"isparam":true,"minimum":0.00,"maximum":4095.00,"default":4095.00,"category":"Throttle","i":33},
"pot2max": {"unit":"dig","id":64,"value":1500.00,"isparam":true,"minimum":0.00,"maximum":4095.00,"default":4095.00,"category":"Throttle","i":34},
"potmode": {"unit":"0=SingleRegen, 1=DualChannel, 2=CAN, 3=CANDual, 4=BiDir, 6=CANBiDir","id":82,"value":1.00,"isparam":true,"minimum":0.00,"maximum":6.00,"default":0.00,"category":"Throttle","i":35},
"throtramp": {"unit":"%/10ms","id":81,"value":4.00,"isparam":true,"minimum":0.09,"maximum":100.00,"default":100.00,"category":"Throttle","i":36},
"throtramprpm": {"unit":"rpm","id":85,"value":20000.00,"isparam":true,"minimum":0.00,"maximum":20000.00,"default":20000.00,"category":"Throttle","i":37},
"throtcur": {"unit":"A/%","id":105,"value":4.50,"isparam":true,"minimum":0.00,"maximum":10.00,"default":1.00,"category":"Throttle","i":38},
"brakeregen": {"unit":"%","id":38,"value":-35.00,"isparam":true,"minimum":-100.00,"maximum":0.00,"default":-50.00,"category":"Regen","i":39},
"regenramp": {"unit":"%/10ms","id":68,"value":0.25,"isparam":true,"minimum":0.09,"maximum":100.00,"default":100.00,"category":"Regen","i":40},
"regentravel": {"unit":"%","id":19,"value":20.00,"isparam":true,"minimum":0.00,"maximum":100.00,"default":30.00,"category":"Regen","i":41},
"offthrotregen": {"unit":"%","id":49,"value":-25.00,"isparam":true,"minimum":-100.00,"maximum":0.00,"default":-30.00,"category":"Regen","i":42},
"cruiseregen": {"unit":"%","id":124,"value":-20.00,"isparam":true,"minimum":-100.00,"maximum":0.00,"default":-30.00,"category":"Regen","i":43},
"regenrampstr": {"unit":"Hz","id":39,"value":10.00,"isparam":true,"minimum":0.00,"maximum":400.00,"default":10.00,"category":"Regen","i":44},
"brklightout": {"unit":"%","id":67,"value":-50.00,"isparam":true,"minimum":-100.00,"maximum":-1.00,"default":-50.00,"category":"Regen","i":45},
"bmslimhigh": {"unit":"%","id":55,"value":50.00,"isparam":true,"minimum":0.00,"maximum":100.00,"default":50.00,"category":"Derating","i":46},
"bmslimlow": {"unit":"%","id":56,"value":-1.00,"isparam":true,"minimum":-100.00,"maximum":0.00,"default":-1.00,"category":"Derating","i":47},
"udcmin": {"unit":"V","id":42,"value":250.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":450.00,"category":"Derating","i":48},
"udcmax": {"unit":"V","id":43,"value":520.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":520.00,"category":"Derating","i":49},
"idcmax": {"unit":"A","id":96,"value":5000.00,"isparam":true,"minimum":0.00,"maximum":5000.00,"default":5000.00,"category":"Derating","i":50},
"idcmin": {"unit":"A","id":98,"value":-5000.00,"isparam":true,"minimum":-5000.00,"maximum":0.00,"default":-5000.00,"category":"Derating","i":51},
"idckp": {"unit":"dig","id":130,"value":2.00,"isparam":true,"minimum":0.09,"maximum":20.00,"default":2.00,"category":"Derating","i":52},
"idcflt": {"unit":"dig","id":132,"value":9.00,"isparam":true,"minimum":0.00,"maximum":11.00,"default":9.00,"category":"Derating","i":53},
"tmphsmax": {"unit":"°C","id":125,"value":150.00,"isparam":true,"minimum":50.00,"maximum":150.00,"default":85.00,"category":"Derating","i":54},
"tmpmmax": {"unit":"°C","id":127,"value":300.00,"isparam":true,"minimum":70.00,"maximum":300.00,"default":300.00,"category":"Derating","i":55},
"throtmax": {"unit":"%","id":97,"value":100.00,"isparam":true,"minimum":0.00,"maximum":100.00,"default":100.00,"category":"Derating","i":56},
"throtmin": {"unit":"%","id":119,"value":-100.00,"isparam":true,"minimum":-100.00,"maximum":0.00,"default":-100.00,"category":"Derating","i":57},
"accelmax": {"unit":"rpm/10ms","id":153,"value":1000.00,"isparam":true,"minimum":1.00,"maximum":1000.00,"default":1000.00,"category":"Derating","i":58},
"accelflt": {"unit":"dig","id":154,"value":3.00,"isparam":true,"minimum":1.00,"maximum":5.00,"default":3.00,"category":"Derating","i":59},
"chargemode": {"unit":"0=Off, 3=Boost, 4=Buck","id":74,"value":0.00,"isparam":true,"minimum":0.00,"maximum":4.00,"default":0.00,"category":"Charger","i":60},
"chargecur": {"unit":"A","id":71,"value":0.00,"isparam":true,"minimum":0.00,"maximum":50.00,"default":0.00,"category":"Charger","i":61},
"chargekp": {"unit":"dig","id":72,"value":80.00,"isparam":true,"minimum":-100.00,"maximum":100.00,"default":80.00,"category":"Charger","i":62},
"chargeki": {"unit":"dig","id":126,"value":10.00,"isparam":true,"minimum":-100.00,"maximum":100.00,"default":10.00,"category":"Charger","i":63},
"chargeflt": {"unit":"dig","id":73,"value":8.00,"isparam":true,"minimum":0.00,"maximum":10.00,"default":8.00,"category":"Charger","i":64},
"chargepwmin": {"unit":"%","id":128,"value":0.00,"isparam":true,"minimum":0.00,"maximum":99.00,"default":0.00,"category":"Charger","i":65},
"chargepwmax": {"unit":"%","id":79,"value":83.50,"isparam":true,"minimum":0.00,"maximum":99.00,"default":90.00,"category":"Charger","i":66},
"idlespeed": {"unit":"rpm","id":54,"value":-100.00,"isparam":true,"minimum":-100.00,"maximum":10000.00,"default":-100.00,"category":"Automation","i":67},
"idlethrotlim": {"unit":"%","id":65,"value":50.00,"isparam":true,"minimum":0.00,"maximum":100.00,"default":50.00,"category":"Automation","i":68},
"idlemode": {"unit":"0=Always, 1=NoBrake, 2=Cruise, 3=Off, 4=HillHold","id":66,"value":3.00,"isparam":true,"minimum":0.00,"maximum":4.00,"default":3.00,"category":"Automation","i":69},
"holdkp": {"unit":"","id":138,"value":-0.25,"isparam":true,"minimum":-100.00,"maximum":0.00,"default":-0.25,"category":"Automation","i":70},
"speedkp": {"unit":"","id":53,"value":0.25,"isparam":true,"minimum":0.00,"maximum":100.00,"default":0.25,"category":"Automation","i":71},
"speedflt": {"unit":"","id":57,"value":5.00,"isparam":true,"minimum":0.00,"maximum":16.00,"default":5.00,"category":"Automation","i":72},
"cruisemode": {"unit":"0=Off, 1=Switch, 2=CAN, 3=ThrottlePot","id":62,"value":0.00,"isparam":true,"minimum":0.00,"maximum":3.00,"default":0.00,"category":"Automation","i":73},
"cruisethrotlim": {"unit":"%","id":155,"value":50.00,"isparam":true,"minimum":0.00,"maximum":100.00,"default":50.00,"category":"Automation","i":74},
"udcsw": {"unit":"V","id":20,"value":280.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":330.00,"category":"Contactor Control","i":75},
"udcswbuck": {"unit":"V","id":80,"value":220.00,"isparam":true,"minimum":0.00,"maximum":1000.00,"default":540.00,"category":"Contactor Control","i":76},
"tripmode": {"unit":"0=AllOff, 1=DcSwOn, 2=PrechargeOn, 3=AutoResume","id":86,"value":1.00,"isparam":true,"minimum":0.00,"maximum":3.00,"default":0.00,"category":"Contactor Control","i":77},
"bootprec": {"unit":"0=Off, 1=On, 2=na","id":135,"value":0.00,"isparam":true,"minimum":0.00,"maximum":1.00,"default":0.00,"category":"Contactor Control","i":78},
"pwmfunc": {"unit":"0=tmpm, 1=tmphs, 2=speed, 3=speedfrq","id":58,"value":0.00,"isparam":true,"minimum":0.00,"maximum":3.00,"default":0.00,"category":"Aux PWM","i":79},
"pwmgain": {"unit":"","id":40,"value":100.00,"isparam":true,"minimum":-100000.00,"maximum":100000.00,"default":100.00,"category":"Aux PWM","i":80},
"pwmofs": {"unit":"dig","id":41,"value":0.00,"isparam":true,"minimum":-65535.00,"maximum":65535.00,"default":0.00,"category":"Aux PWM","i":81},
"canspeed": {"unit":"0=125k, 1=250k, 2=500k, 3=800k, 4=1M","id":83,"value":1.00,"isparam":true,"minimum":0.00,"maximum":4.00,"default":2.00,"category":"Communication","i":82},
"canperiod": {"unit":"0=100ms, 1=10ms","id":88,"value":1.00,"isparam":true,"minimum":0.00,"maximum":1.00,"default":0.00,"category":"Communication","i":83},
"nodeid": {"unit":"","id":129,"value":1.00,"isparam":true,"minimum":1.00,"maximum":63.00,"default":1.00,"category":"Communication","i":84},
"controlid": {"unit":"","id":156,"value":63.00,"isparam":true,"minimum":1.00,"maximum":2047.00,"default":63.00,"category":"Communication","i":85},
"controlcheck": {"unit":"0=CounterOnly, 1=StmCrc8","id":157,"value":1.00,"isparam":true,"minimum":0.00,"maximum":1.00,"default":1.00,"category":"Communication","i":86},
"manualstart": {"unit":"0=Off, 1=On, 2=na","id":150,"value":0.00,"isparam":true,"minimum":0.00,"maximum":1.00,"default":0.00,"category":"Testing","i":87},
"manualiq": {"unit":"A","id":151,"value":0.00,"isparam":true,"minimum":-400.00,"maximum":400.00,"default":0.00,"category":"Testing","i":88},
"manualid": {"unit":"A","id":152,"value":0.00,"isparam":true,"minimum":-400.00,"maximum":400.00,"default":0.00,"category":"Testing","i":89},
"version": {"unit":"4=5.32.R-foc","id":2039,"value":4.00,"isparam":false},
"hwver": {"unit":"0=Rev1, 1=Rev2, 2=Rev3, 3=Tesla, 4=BluePill, 5=Prius","id":2036,"value":2.00,"isparam":false},
"opmode": {"unit":"0=Off, 1=Run, 2=ManualRun, 3=Boost, 4=Buck, 5=Sine, 6=AcHeat","id":2000,"value":1.00,"isparam":false},
"lasterr": {"unit":"0=NONE, 1=OVERCURRENT, 2=THROTTLE1, 3=THROTTLE2, 4=CANTIMEOUT, 5=EMCYSTOP, 6=MPROT, 7=DESAT, 8=OVERVOLTAGE, 9=ENCODER, 10=PRECHARGE, 11=TMPHSMAX, 12=CURRENTLIMIT, 13=PWMSTUCK, 14=HICUROFS1, 15=HICUROFS2, 16=HIRESOFS, 17=LORESAMP, 18=TMPMMAX, 19=CANCRC, 20=CANCOUNTER,","id":2038,"value":0.00,"isparam":false},
"status": {"unit":"0=None, 1=UdcLow, 2=UdcHigh, 4=UdcBelowUdcSw, 8=UdcLim, 16=EmcyStop, 32=MProt, 64=PotPressed, 128=TmpHs, 256=WaitStart, 512=BrakeCheck","id":2044,"value":0.00,"isparam":false},
"udc": {"unit":"V","id":2001,"value":403.81,"isparam":false},
"idc": {"unit":"A","id":2002,"value":-0.09,"isparam":false},
"il1": {"unit":"A","id":2003,"value":1.78,"isparam":false},
"il2": {"unit":"A","id":2004,"value":0.59,"isparam":false},
"id": {"unit":"A","id":2049,"value":-0.34,"isparam":false},
"iq": {"unit":"A","id":2050,"value":-0.81,"isparam":false},
"ifw": {"unit":"A","id":2048,"value":0.00,"isparam":false},
"ud": {"unit":"dig","id":2046,"value":-2.00,"isparam":false},
"uq": {"unit":"dig","id":2047,"value":79.00,"isparam":false},
"fstat": {"unit":"Hz","id":2011,"value":0.00,"isparam":false},
"speed": {"unit":"rpm","id":2012,"value":0.00,"isparam":false},
"cruisespeed": {"unit":"rpm","id":2041,"value":-1.00,"isparam":false},
"turns": {"unit":"","id":2037,"value":0.00,"isparam":false},
"amp": {"unit":"dig","id":2013,"value":57.00,"isparam":false},
"angle": {"unit":"°","id":2014,"value":135.15,"isparam":false},
"pot": {"unit":"dig","id":2015,"value":505.00,"isparam":false},
"pot2": {"unit":"dig","id":2016,"value":251.00,"isparam":false},
"regenpreset": {"unit":"%","id":2051,"value":100.00,"isparam":false},
"potnom": {"unit":"%","id":2017,"value":-25.09,"isparam":false},
"seldir": {"unit":"-1=Reverse, 0=Neutral, 1=Forward","id":2018,"value":1.00,"isparam":false},
"rotordir": {"unit":"-1=Reverse, 0=Neutral, 1=Forward","id":2053,"value":0.00,"isparam":false},
"tmphs": {"unit":"°C","id":2019,"value":28.50,"isparam":false},
"tmpm": {"unit":"°C","id":2020,"value":28.25,"isparam":false},
"uaux": {"unit":"V","id":2021,"value":14.34,"isparam":false},
"pwmio": {"unit":"","id":2045,"value":59136.00,"isparam":false},
"canio": {"unit":"1=Cruise, 2=Start, 4=Brake, 8=Fwd, 16=Rev, 32=Bms","id":2022,"value":0.00,"isparam":false},
"din_cruise": {"unit":"0=Off, 1=On, 2=na","id":2023,"value":0.00,"isparam":false},
"din_start": {"unit":"0=Off, 1=On, 2=na","id":2024,"value":0.00,"isparam":false},
"din_brake": {"unit":"0=Off, 1=On, 2=na","id":2025,"value":0.00,"isparam":false},
"din_mprot": {"unit":"0=Error, 1=Ok, 2=na","id":2026,"value":1.00,"isparam":false},
"din_forward": {"unit":"0=Off, 1=On, 2=na","id":2027,"value":1.00,"isparam":false},
"din_reverse": {"unit":"0=Off, 1=On, 2=na","id":2028,"value":0.00,"isparam":false},
"din_emcystop": {"unit":"0=Error, 1=Ok, 2=na","id":2029,"value":1.00,"isparam":false},
"din_ocur": {"unit":"0=Error, 1=Ok, 2=na","id":2030,"value":1.00,"isparam":false},
"din_desat": {"unit":"0=Error, 1=Ok, 2=na","id":2031,"value":1.00,"isparam":false}

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 12:25 pm
by MattsAwesomeStuff
Just unbolt the seat and turn it around backwards. Problem solved!

</helping>

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 2:01 pm
by uhi22
Maybe watch Damiens video where he and Johannes explain the connection and parametrization of resolver, syncoffs, and so on, also manual mode.

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 3:34 pm
by johu
And here are my parameters, Gen2 Leaf inverter, Em57 motor, control board with Mini Mainboard, so same as your setup I believe

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 4:24 pm
by trataritatatata
I learned through experience that with syncofs 2000 the motor began to spin in the right direction and now the toggle switch switches forward and reverse. At syncofs 16000 the motor rotates more or less normally in both directions.

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 7:06 pm
by uhi22
Did you follow the syncofs calibration process that Damien explained?

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 9:03 pm
by johu
Great :)

Also surprised about the offset though.

Re: The motor turns in the opposite direction

Posted: Thu May 30, 2024 11:57 pm
by Zieg
Yeah, I hadn't expected the EM57 motors to vary so much from one to the next. I know the motors all have their offset engraved on the case but I still thought they would be within a few thousand digits. I also learned after pushing my car out of an intersection that being off by a few thousand is enough to cause real problems, haha.