Wednesday, November 13, 2024

Enhanced Primary Gear Support

Added a support bearing to the primary gear to take some load off the motor.  The gear is mounted at the end of 7/8" shaft extension, which meant the tangential and longitudinal forces from the primary gear on the motor shaft were all being carried by the internal bearings in the motor, putting a large stress on the shaft near the point where it exits the motor. The images below show the primary helical gear which is positioned about 3 inches beyond the end of the motor shaft on a shaft extension, coupled through the shaft adapter the gear is attached to. I believe this is what caused the shaft to shear off just at the motor housing, many months ago.

 

Original Design - No Support

New Configuration with Support Bearing

Minor Configuration DCF Update

Noticed a slight hesitation around 3,000 RPM.  Changed D-axis current controller proportional gain  (0x4641_21) to 0 (uses Q axis value for Kp) and  D-axis current controller integral gain  (0x4641_22) to 0 (also use Q axis value for Ki). This seems to resolve the hesitation, which I suspected was simply the D-Axis control loop overshooting the target field-weakening FW Id value.




Friday, July 26, 2024

Cooling Fan Active and Sevcon Configuration

 Cooling Fan

A cooling fan from Thunderstruck (Full kit) was a quick way to assure the liquid cooling of the ME1616 motor was providing maximum benefit.   A liquid cooled heatsink was also installed under the Sevcon Gen 4 controller to protect it from thermal issues.  

Wiring

A standard 12V relay was installed on pins 7 & 8 on the Sevcon controller to switch the 12V (car 12v) supply for the fan.  The coolant pump was permanently wired to the 12V supply to run continuously while the ignition is on.  The theory is the fan does not need to run unless the motor is getting too warm.   I may install a DC Speed control on the fan to slow it down and reduce its sound level, but I'll have to see if the reduced cooling creates any issues.

Sevcon Configuration

As expected, the Sevcon settings took longer to figure out than the mechanical or electrical work.  Here are the settings to make the fan work.
  • Input/Output (tab in Helper) Local Contactor Outputs:  Contactor 2 = Not Mapped, even though there is an option for Traction Motor Cooling Fan.  If this is mapped, Pin 7/8 will be energized whenever the controller is in Operational mode, regardless of the Fan Settings.
  • External Heat Sink Fans 0x5A01 or 5A01h:  This is where the temperature set points are entered.  I ended up setting the Fan Temperature Source to Motor Temperature Sensor and raising the limits to 45C(on) & 35C (off)
  • Analog Output VPDO Mapping 0x3200 3200h:  Other documentation says that Output 2 should be 0x2421 (cooling fan status).  I found Output 2 should be 0x24ff.  0x2421 is read-only and always shows 0x0C00 as a value.
  • Analog Output (Contactor Drive) 0x6C11 6C11h:  Here you can change the output voltage of Pin 7/8 by changing the values for Analog Output 2.
  • Analog Output Current/Voltage Mode 0x46A1 46A1h:  This controls whether the pins are voltage or current controlled.  This is set to 0x0 to set all outputs to voltage mode.
  • Note: I attempted to measure the voltage across Pin 7 and Pin 8 before connecting the relay.  It showed almost battery voltage even though the controller was showing it outputting 12v on the Local IO Monitor on the Main tab of the Helper.  Once the relay was connected, it read 12.5v.  I suspect the voltage control circuit needs a small load to operate correctly.
After some initial testing, the controller turned the fan on at 45C and turned the fan off once the motor had cooled to 35C.

Here is the current working DCF (Sevcon Gen 4 Size 4 with Motenergy ME1616) file for reference.  LINK  This config also addressed many of the PMAC gain settings.  Seems to be very stable and drivable in 3rd gear.

Sunday, July 21, 2024

Gearbox Ratios

Gearbox Ratio - CV Joint  - Erratic Encoder

 Here is a handy calculator to help map between RPM and MPH.

Guessworks - Gearbox & Speedo Ratio Calculator (guess-works.com)

Settings: 165/70 x10 wheels; 1:1 Drop gear ratio, MKIII Cooper S gearbox, 3.444:1 Final Drive

For Jan, this is what it calculates which has been verified using a GPS speedometer.:

Given this, with the ME1616 motor, 45 MPH is easily hit at about 5,000 RPM, well within spec.   Field-weakening is active at these higher RPMs but the responsiveness is decent. from about 20 MPH up to 45 MPH.

Currently just staying in 2nd gear for most city driving, though 3rd gear is quite acceptable and allows speeds up to 60 mph.






Configuration learnings:

1. Low Speed Gains and Speed Mode Gains play a big role in low (below 150 rpm, which is adjustable) performance.  If these gains are too low, the motor is very sluggish starting out but once over the 150 rpm threshold, the primary gains Kp and Ki for iQ and iD become active.  With the Low Speed settings were low, it was taking ~2 seconds to go from 0 rpm to 150 rpm, which is a long time when the traffic light turns green.

2. Observing an electrical hum at low RPM which started once I increased Kp and Ki for iQ and iD.  No obvious side-effects, but audible.  - This is from Kp for iD being set to 8.  Lowered to 2 and hum resolved.

3. Added a cooling fan to the new radiator.  Wired to the same fuse as the one activating the high voltage power (not traction) feed to the Sevcon controller.  This created some noise, and the controller issued a parameter out of range fault, and the Find the Parameter feature identified the Temperate Map Setting #3 as being the issue - It was set to 110C and 0.5 cutback, which should have been well within range.  Disconnected the fan and the fault code resolved.

4. Controller was going in the Motor Temperature Cutback at 80C, though the mapping did not start until 100C.  Tried different mappings but no change.  Activated and deactivated the I2T motor temperature feature and this resolved the issue.  I2T is deactivated and now the motor thermal cutback is operating properly.

5. Receiving Encoder Errors (0x52C1) when coming to a stop and the car rolls backwards a little.  It seems like the error is set (requiring a restart) as soon as the throttle is pushed.  Added shielding to the encode lines to see if helps but did not.  Swapped the encoder with one from another motor I had, and it appears the encoder errors are resolved.    Drove about 6 miles with stops and starts and the motor up to about 80C and not a single encoder error

6. Inner CV Joint alignment.  When the new ME1616 was installed, its increased size shifted the transmission a bit.  Also, the new motor provided an opportunity to realign the transmission.  Well, the first attempt had the transmission about 1/2 inch to far forward.  To shift it back, the transmission had to be raised about 1/4 to allow the motor to avoid a bolt from the suspension tower.  This allowed the motor whole assembly to shift back the 1/2, resulting in a much better alignment of the left inner CV joint.  In looking at the CV joint, the ball bearings were not fully within the joint and under force (like pulling up a driveway), would push out of the joint, slipping, and causing a thump sound as they pushed back into the joint.  With the improved alignment, they now are more in the joint and unable to push out.

Thursday, March 28, 2024

New ME1616 Motor

 New Motenergy ME1616 Motor installed

After a lot of consideration, the old ME1306 has been upgraded to a ME1616 LINK.  This new water-cooled motor with Sin/Cos encoding brings a smoother, quieter drive, more power, and with water cooling, an elimination of over-heating concerns.  It was directly compatible with the existing Sevcon Gen 4 Size 4 80v controller.

Top modifications required:

- Small cut-out in the frame with subsequent reinforcement for 2-inch larger motor

- Adding a glycol/water cooling system for the motor and controller.  this included a radiator, fan, and coolant reservoir.  All straightforward, but required a range of brass fittings to adapt the different hose sizes to shoehorn the components into the constrained engine compartment.

- New Sevcon Configuration DCF settings - This has required extensive trial-and-error to dial-in the settings.  The system is working about 95% now.   Still needs more tuning for high-torque situations.  DCF file available here  LINK

Top teachings:

1) The inductance setting is important and the spec for this motor is very broad.

2) Gains require precise adjustments to avoid current errors under heavy acceleration.

3) Field weakening is important and produces a noticeable improvement in mid-RPM range torque.

4) Without a Dynamometer, tuning is a slow process.

Friday, March 3, 2023

New BMS Configuration and Testing

More Data

The new BMS setup is working very well and is a great simplification from the previous setup.  The new chargers (2 x 600w 48v chargers in series) deliver about 12A of charging which equates to approximately 7.5 miles of charge per hour.  Additionally, the Bluetooth connection from the BMS monitoring Arduino UNO is reliable and fast.

Currently, there are three levels of protection for the battery:

  1. Chargers - The chargers should terminate if the pack voltage exceeds about 115 (32 x 3.6v), but they do not monitor individual cells, so if there is a cell imbalance, it possible that some cells could be overcharged while others are low.
  2. BMS - The chargers are routed through the BMS which is set to 3.5 volts for the High Voltage Cutoff.  If a cell exceeds this threshold, the BMS will turn off the Charging FETS, disconnecting the chargers from the pack.
  3. BMS Monitor Arduino Uno - This Arduino communicates with the BMS over Bluetooth (HC-05), requesting every 2 seconds, a voltage level for all 32 cells.  If any cell reports greater than 3.495V, this Arduino will turn-off a contactor that physically disconnects the chargers.   Only a power cycle will permit the charger contactor to be reenergized.  The Arduino also has an 8-second watch-dog timer running along with a 30 second timeout timer for communications with the BMS.  If the BMS stops responding for 30 seconds, the Arduino will shut-down charging and turn on a buzzer.

Currently, the 220v charging power is on a wall-timer that is manually set based on the SOC of the pack (1-4 hours). 

The BMS Arduino is monitoring the cells for low-voltage events.  If any cell drops below 2.5v, the buzzer will sound and the IGN red indicator on the Dash will light, alerting the driver.  The digital dashboard display can also show the status of the back - High and Low cell number, and max delta voltage across the cells, total pack voltage, temperature of the BMS.  The BMS is set to not permit charging below 5℃ as an added protection measure.

The BMS enters into a balancing routine after the charging is complete, attempting to bring the cells to within 10mV of each other.  A series of LEDs on the BMS flash during the balancing phase.   So far, the pack reports below 10mV following charging, so the balancing appears to be working as expected.

Test Drive

With the system fully operational, I headed out around town to test the pack.  Running now in second gear, Jane accelerates great up to over 40MPH.  After 21 miles, it took right at 3 hours to charge at 1200W, equating to 3600Wh for 21 miles or about 170 Wh/mile efficiency.  The pack is now 26 x 60 AH cells & 6 72AH cells at 3.2v each --> 6.1 KWH (total), so using an 80% safe usable capacity, the theoretical range is 29 miles.  Another longer drive will be needed to confirm this.

The other benefit of being able to stay in 2nd gear for most roads around town, is the motor current draw is only high (>200A) for a few seconds during acceleration, resulting in a cooler running motor.  So far the motor has not risen about 70℃ and stays below the 5,000 RPM spec when driving around town.  Regenerative breaking is always very strong in 2nd.



Monday, February 20, 2023

 More Batteries

With the new Sevcon controller's ability to handle up to 120v, it was time to expand the battery pack to 32 cells.  The CALB 60Ah were discontinued and no longer available.  I was able to locate 6 CALB CAM72 (72AH) cells.  This new enhancement ended up motivating a complete rewire of the battery system.  The boot(trunk) is now much cleaner but still could use a few more minutes of straightening up.  

New BMS

The new ANT 32s 300A Bluetooth BMS from eBay is a nice upgrade from the previous serial port version.  This meant the Arduino Uno that monitors the pack needed a HC-05 serial Bluetooth board which is a better answer since it isolates the Arduino from the high-voltage pack.  The protocol (Github and Github) to monitor the Ant BMS over Bluetooth was straight forward and worked pretty much out of the box.  The Uno drives a buzzer, red (IGN) warning indicator on the dashboard, and will disconnect the charger from the battery pack if an alarm occurs or the BMS is not communicating with the Uno over Bluetooth.

The battery pack is now divided into two 16 cell modules, which are easier to manage, than the previous 27 cell single module.
The Pack is 3.3v x 32 = 105v when charged, with a charge limit about 3.45 x 32 = 110v.

The new BMS is wired between the charger and the pack and is providing charge termination along with individual cell voltage monitoring.

The BMS also attempts to balance the cells after charging completes, which seems to be working since the cells are withing 5mv of each other after charging.  While balancing, the BMS puts on a nice LED lightshow.

The ANT BMS Software is decent on an Android device and allows excellent customization.  Here are the settings in the BMS:




New Charger

The original charger would only go to 99V even though its label indicated it could drive up to 110V.   Attaching two 16s 58.4v LiFePO4 chargers in series worked out to be an easy solution and the lowest cost option for a 15A 115v charger.  About $160 each versus a single 115v-15a charger which was closer to $500.    The chargers are powered directly from the 220VAC power connection.

The chargers are self-terminating, shutting off the charge before any cell reaches 3.5V, which is where the BMS and Arduino are set to terminate the charge.  This means there are three different systems monitoring the pack to assure cells are not over-charged.  The Uno also monitors and provides an alarm if a cell drops too low, below 2.5V.

Bluetooth Configuration

The HC-05 need to be setup as a Master Serial device and binded to the Ant BMS.  Here are the commands that setup the module.  Once setup, it quickly connects to the ANT BMS when power is applied.

The required AT commands to set the configuration:  Instructables

  1. AT+RMAAD (To clear any paired devices)
  2. AT+ROLE=1 (To set it as master)
  3. AT+CMODE=0 (To connect the module to the specified Bluetooth address and this Bluetooth address can be specified by the binding command)
  4. AT+BIND=32E3,2E,012345 (Note the commas instead of colons given by the slave module.  This is the BT address of the BMS, discovered using a BT scanning app.
  5. AT+UART=38400,0,0 (To fix the baud rate at 38400)

The HC-05 is put into AT comms mode by holding the button at power-on and running at serial comms passthrough program on the Uno.

Results

The first few drives with the new pack indicate it is working as expected.  The controller is driving higher RPMs without field-weakening (FW).  In second gear, the acceleration is excellent and 3rd gear easily achieved 58MPH while the motor stayed fairly cool.  More testing is still needed to see if the higher voltages results in better watt-hours/mile efficiency measurement.  The added cells should add about 5 miles of range but that is still to be tested.


Sunday, August 21, 2022

Moving from Kelly to Sevcon controller

 Time for an Upgrade

The Kelly KLS72601 controller burned up while pulling out of my driveway, something done successfully hundreds of times previously.  It was about several years old with a few thousand miles on it.



This was the trigger to move to a new controller, which has cascaded a series of changes.

New Controller:  Sevcon Gen 4 Size 4 80v unit Part #634A83207  (420A RMS motor current (10s), 350A (2 min), 140A (continuous))

The installation of the new controller required a rewire of most of the motor controls since Sevcon is not an isolated controller and handles pre-charge/startup and sensors differently.    This meant adding another contactor to control the battery voltage from the normal key switch.  Also, the reverse and forward switches are independent, so a relay was needed to support the SPST reverse switch on the dash.

Driving in 3rd gear is reasonable and very similar to the performance of the Kelly controller, though quieter, the Canbus is reliable and does not drop out, and the regenerative braking is super smooth.  However, 2nd gear performs much better with quicker acceleration.  With field-weakening, the motor easily his 4,000 RPM (or about 40 MPH) under load, something the Kelly controller could not do.  The Kelly would top out at around 35 MPH.

With the help of several versions of wiring diagrams and a lot of trial and error, this is the current setup.

1) UVW wiring (5V UVW encoder and phase connections):   See Schematic


A few Sevcon settings to tweak the operations. 

2) Disable sequence (startup) checking of the forward switch, since the default mode is forward for the reverse-relay.  The controller will set an error if the powered-on with the reverse switch on and it will not energize the motor, until the reverse switch is put into forward.

3) Throttle and Brake sensor settings - 5V power & response curves.  Braking torque turned up to 70% and will generate in excess of 5KW when braking.  This is considerably higher than the Kelly and smooth already down to a full stop.

DCF Configuration

It took several days to land on reasonable Sevcon Gen 4 settings using the DVT software from Thunderstruck  The last one that was limiting iQ Max was the temperature cutback.  Here is what I learned:

0) Sevcon firmware version:  0705_gen4_IMPM_7050013.dld - Sevcon support sent this to me.

1) Gains

2) Motor Parameters



Contactor:


Inputs




3) Cutbacks and Limits - still tuning voltage, torque, and temp curves

4) Footbrake settings based on the output from the inline brake pressure sensor.  Getting 3-4 KW of regen at low speeds with light brake pedal pressure.

Digital Dashboard and Canbus Interface

The Teensy 4.1 is speaking with the Sevcon controller very well.  The Sevcon sends 5 TPDO packets out every 20 milliseconds which is more than fast enough.  With the screen updates, the Teensy is unable to keep up but the FIFO canbus buffer just rolls over so there is no negative impact.  Did add 4 reads per update loop to make sure a reasonable number of packets are processed every cycle.  The RPM display is updating more than quick enough.  A new Canbus screen is also available with a touch of the touch-screen.

What I've learned

1) PI Controller - Sevcon is inconsistent with naming conventions.

Both Current (Q-Axis. torque) and Speed proportional gains are used in Torque/Speed mode.  Setting speed & current (Q & D) Ki integral gains to zero causes strange behavior.  D-Axis (Field Weakening, FW) Kp and Ki are important since controller driving id to zero will throw-off iq currents.  This best explanation  of the iQ & iD relationships I can draw:  




Target iq determined by target torque (throttle and limits (battery, temperature)), motor inductance, iq-max, current limits (motor) and Target id.  The gains are used to adjust the voltages being applied in an effort to get actual iQ and iD to approach the Target iQ and Target iD.

Small changes in the Kp gains can have large changes (runaway and oscillations).  Ki values seem to force convergence over time, especially the speed Ki integral gain.

2) Key equations

Max iQ - dependent on cutbacks (voltage & temperature) - when all is correct, this should match 420a (RMS), the controller's limit.  Cutback values shown on Motor Status page.

Motor Inductance LS - This changes the maximum flux current, which appears to be a limiter for iD, which may have its biggest impact on field weakening which I have not really tested.  The controller is reporting a measured LS of 54 microhenries which is less than the datasheet value of 100-200 µH (.1 or .2 mH).  More testing is needed.

Ke also impact impact Max Flux Current but changes cause problems with the PI control loop, so I could not experiment too much with changes to this value.