Alight sin/cos encoder of motenergy motor with SEVCON

General Discussion about large electric scooters and motorcycles and other things with no pedals.

Alight sin/cos encoder of motenergy motor with SEVCON

Postby sanfox » Thu Jun 01, 2017 8:14 am

I try to make instruction “How to alight sin/cos encoder of motenergy motor with of without SEVCON”.
Information collected from different sources. Guys, who have deal with it, please confirm this information or correct it.
At the picture below you can see encoder location inside of the ME1302 motor.
motor.JPG (76.52 KiB) Viewed 150 times

So to tune the encoder we must go thru several steps.

1. Mechanical alignment by measuring values with oscilloscope.

Note from motenergy drawing below.
“Sensor timing: with BEMF oscilloscope probe attached to M1 and ground probe attached to M2, the BEMF rising edge zero cross should lead the sin wave (sensor pin A to sensor pin C gnd) zero cross by 20 electrical degrees of the BEMF waveform.”

As the rotor has 8 magnets (4 pole pares) by one rotation of rotor we have four electrical rotations of BEMF. So the 20 electrical degrees of the BEMF equal to 5 degrees of rotor rotation. That is not so simple to hit this value. At the graphs below you can see waves comparison in two scales of x – axis.
(64.77 KiB) Downloaded 3 times

(66.68 KiB) Downloaded 3 times

Using home made oscilloscope attached to soundcard line in measuring waves looks like this.
(93.45 KiB) Downloaded 3 times

Connection of soundcard oscilloscope to the motor showed below.
connection to motor.jpg
(153.35 KiB) Downloaded 3 times

2. PMAC encoder commission by Sevcon DVT macros.

a) Set peak torque to 0.0 Nm – this should prevent torque being applied to the motor during testing and alignment. This is only necessary if your setup allows you to rotate your motor by another means i.e dynamometer. If this is not possible and you will use the Gen 4 to spin up the motor then leave this set to its current value.
Peak torque.JPG
(27.37 KiB) Downloaded 3 times

b) Commission Sin Cos Encoder (Check of sinusoidal curve amlitudes )

1). Turn the controller off then on again.
2). Spin the motor with manual power (hand spin the motor).
3). After spinning – use the helper and bring up “pmac encoder”
encoder commision.JPG
(49.29 KiB) Downloaded 3 times

4). Click “commission sincos encoder”.
5). Turn the controller off then on again.
6). Check sine and cosine peak and trough voltages:
- Peak voltages should not exceed 4.5 Volts.
- Trough voltages should not descend below 500 mV.
- Peak to trough swing on sine and cosine should exceed 1.0 Volts.
3. Adjusting the encoder offset

Note from motenergy drawing:
“If timing the sensor using a Sevcon controller, the encoder position should be within +/-3 degrees of zero.”
1). Verify that peak torque is still set to zero.
2). Ensure that Ud and Uq values are being monitored via a TPDO.
(53.36 KiB) Downloaded 3 times

3). If the previous steps were performed correctly, you should now see the Ud and Uq items being monitored
UdUq_log.JPG (73.67 KiB) Viewed 150 times

You can now specify a “Filename” (bottom right of the screen capture), while preserving the .csv extension and you are ready to take a trace using the control buttons at the top of the window. Press the “Reset” button (looks like a rewind button), followed by the “Start trace” button (looks like a play button) to start a new trace.
2) In order to be able to read the Ud and Uq values accurately, you need to turn the electric motor externally (using a power drill for example, or the vehicle’s own inertia). If possible to use some external power to turn the motor, then you can start a trace as explained above and collect the information (use the “Stop trace” button – looks more like a pause button). If that is not possible, then you can drive the motor using our Gen4 controller and when reaching full speed, select neutral or remove motoring torque to the Gen4 controller and start a trace as the motor starts to decelerate. Note: You must have 0 neutral braking set and the bridge still enabled to successfully trace this,
3) Once the trace was stopped (it is automatically saved in the “C:\C6944\DVT\veh_if_log” folder), you can use the built in utility (“PMAC Encoder” button on the main page of the DVT Helper) to look at the offset angle.
Graph voltage vector.JPG
(75.2 KiB) Downloaded 3 times

4) Click on the “Graph Voltage Vectors” button in the “PMAC Encoder Alignment” window and you will be prompted to select the trace file you collected in the previous steps. Once you select the appropriate file, you will see a new window that shows the encoder alignment. In the screen capture above, the encoder is slightly misaligned (you see the graph points form a bar tilted slightly to the left of the Y axis). To correct the encoder alignment, pick a point in the middle of that bar made of multiple points and click the mouse on it). You will see an alignment value display in the textbox below the graph. Press the “Subtract Calculated Angle from Offset” button to commit the new alignment value to the Gen4 controller.
5) Recycle power to the Gen4 controller key switch and repeat the test to verify that the encoder is properly aligned. If the motor is spinning in the forward direction, a well aligned encoder will produce a bar that is positive and along the Y axis in the graph above.
User avatar
1 µW
1 µW
Posts: 4
Joined: Fri Mar 27, 2015 12:14 am

Re: Alight sin/cos encoder of motenergy motor with SEVCON

Postby methods » Thu Jun 01, 2017 10:13 am

OMG... this is solid gold.

Thank you for taking the time to post this!
This is very valuable information for those attempting to get up and running. I am going to cross-link it with some other Sevcon related material.

Oil companies and Alkaline Battery companies are peas in a pod... find a way to put your foot in their ass
Protected 1S, 2S, 3S, and 4S rechargeable lithium packs should be on every store shelf in the world
It is not technology holdings us back... it is greedy profiteers holding us back. Point me in the right direction
User avatar
10 GW
10 GW
Posts: 4903
Joined: Fri Aug 08, 2008 12:08 pm
Location: Santa Cruz CA

Re: Alight sin/cos encoder of motenergy motor with SEVCON

Postby sanfox » Fri Jun 02, 2017 1:51 am

Encoder angle from voltage vectors
During forward rotation, points without field weakening must locates on the Ud axis or a little to the left of it. When the field weakening starts, points begin moving further to the left.
So a properly configured encoder will prevent voltage in quadrant 1!
Ud Uq axes.JPG
Ud Uq axes.JPG (34.07 KiB) Viewed 137 times

Maximising the Output Efficiency

Making small changes to the offset angle of only one degree at a time is a good way to see how the alignment of the encoder affects the efficiency of the motor. The above method does not provide an exact encoder offset value. This is due to a cross coupling effect where it is normal for some q-axis current to be seen on the d-axis and vice versa, even for a perfectly aligned motor. However, by keeping a constant torque demand and monitoring the motor speed instead, you can get a better idea of what adjustments should be made to the offset.
Remember, the main objective here is to get maximum motor output for a given input. Keep the torque demand constant and perform more adjustments to the offset angle. You should find that for different offsets, the motor speed will stabilize at different values. It may take a while for the speed to level out, but with some experimentation you should be able to find a more accurate offset value.
You can graph the voltage vectors to double check the encoder angle after using this technique.

This process slightly reminds for me an ignition distributor tuning at idling speed alignment on internal combustion engine.
User avatar
1 µW
1 µW
Posts: 4
Joined: Fri Mar 27, 2015 12:14 am

Return to E-Scooter and Motorcycle General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests