Wednesday, October 22, 2025

After a short break....

 A few minor updates have been made after not touching the car for a few months while another project was taking priority and blocking the driveway.  It came right to life with the only issue being the coin-cell battery that maintains the dashboard clock needed replacing.  The rest of the systems woke right up.

Heater + Brake setting

Discovered that when the heater is on, it introduces about 0.3v rise (0.5v-->0.8v) in the analog brake signal going to the Sevcon controller from the brake-line presssure sensor.  This was enough to exceed the starting voltage for braking and thus when the heater was on, the controller would not engage the traction motor from a stop.  Raising the start voltage for the regenerative braking to 1V was sufficient margin to avoid this issue without impacting the brake responsiveness.

Front Driving Lights and Turn Indicators

After 10 years of use, one of the front turn lights stopped working.  Easy to replace both and the LED bulbs have improved significantly in 10 years.  Selected Phinlion White Amber Dual Color 1157 bulbs with projector.  Very bright now!

Hazard Switch

As reported elsewhere, the Classic Mini Hazard switch is a maintenance item, and I guess after 50 years, the original's time finally came up.  One of the tab connectors broke spontaneously, leaving hazards inoperable.  After attempting re-attach the wire, the switch is still inconsistent.  Since this switch also controls the turn-indicators, it is a critical component.   There does not seem to be replacements available with the tabs,only barrels, since this switch was primarily used in Canada during the early 1970's.  I am attempting to "refurbish" the switch to nurse a few more years out of it.  

Other tweaks

Notice a subtle oscillation when starting out from a stop-sign.  Lowering the proportional gain Kp from 2.5 to 2.2 to see if that will eliminate the oscillation.

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

OGearbox 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 too 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.

Wednesday, April 28, 2021

Digital Dashboard Do-over

 New Digital Dashboard

After several years of using an Arduino DUE (32-bit, 64Mhz) as a digital dashboard controller, it was time to modernize the system.  The Teensy 4.1 was released in 2020 and brings 600 Mhz, a floating point unit (FPU), and a lot of I/O.

Interfacing this to the existing systems required some new code development.

SAINSMART 7" SSD1963 LCD - A custom wiring interface had to be created to connect this display to the Teensy.  It is a 16-bit interface so having the extra I/O on the Teensy 4.1 was a benefit.  Also, the timing of initializing the display created additional development.  The 600 MHz processor start-up is quite fast and prior to the LCD initialization, special timing delays (100ms) needed to be introduced.  The MCUFriend_KBV LCD driver library worked great and a custom Teensy 4.1 SSD1963 interface was posted on GitHub.

The RF24 (radio, comms to the BMS and battery charge monitor), XPT2046 (touchscreen, used to switch display modes), and SD (storage of startup bitmap image) libraries worked as expected.  The Teensy version within the Teensyduino package from PRJC Version 1.54 Beta 9.

The Flexcan_T4 Canbus interface did not work on the CAN3 integrated interface in the Teensy 4.1 but worked well on CAN1 with a 3.3v Canbus transceiver from LC.

The built in Real Time Clock (RTC) of the Teensy only requires a coin-cell battery (2032), but that was simple.

A separate 12V-5V (25w) supply has been added to power a USB hub and the TFT LCD backlight.  This hub now provides a single USB connection to the dashboard, timing advance controller (Teensey 4.0), and the Kelly KLS controller serial-USB interface for configuration.  The hub also provides power to these devices.

The simplest step was the analog drivers (with FET drivers) for the original Mini gas gauge and motor temperature gauge which require 10v to operate.  A dedicated adjustable power supply is in place to provide a constant 10v supply from the car's 12v.

With the new design, new mounting brackets for the LCD to the dashboard were created and 3D printed.


The new processor is fast enough to provide are faster interface for the driver and better gradation of the graphics, improving the overall look for the dashboard.

Tuesday, March 30, 2021

Timing Advance finally works

 With enough power, anything is possible

I decided to attempt the phase timing advance system again, to compensate for the lack of flux-weakening, timing advance in the Kelly KLS controllers.  With BLDC motors, there is real benefit to dynamic phase timing to both gain additional torque in the lower RPMs and a bit more speed at the top-end.  The trade off is more power going into the motor which can increase the motor temperature, but that is reasonable given the increase in power.  A fixed (rotate the timing sensor on the motor) would provide incremental benefit in the forward direction, but with electronic reverse, this permanent advanced angle would make reverse rotation difficult and maybe unusable. This is what contributes to the need to have dynamic timing adjustment.  The motor (Motenergy ME1306) comes from the factory set to neutral timing.

Using a Teensy 4.0, which is an impressive platform, combined with a bidirectional 5V-3.3V level shifter CYT1082 for the 6 signals (3 from the motor, 3 to the controller), the timing shifter's HW was rather easy to integrate.

A number of key teachings came from developing the phase timing shifter code.

  1. Give the motor a full revolution to stabilize before starting any timing shifts.  This means a full 24 phase changes (6 phase for 4 e-revolutions).  
  2. Having a floating point processor simplifies the process.  The phase times for the motor go from about 30,000 microseconds (at low RPM) to less than 500 microseconds when spinning at 5000 RPM.  Phase shift is typically referenced as a angular shift (independent of speed, so the algorithm selects a desired angle of shift and then computes the amount of shift time (timing advance... The time the next shift should occur) necessary to achieve that angular shift.  Floating point math just makes this easier to program.  Each phase is 60 e-degrees so the shift time = phase time x (shift angle / 60).
  3. A 600 MHz processor means that the system can loop through the state-machine many times per e-phase, minimizing the chance of a missed or delayed signal.
  4. A basic state-machine worked well with the following paths.
    1. Bypass->Forward->Advance Timing-> Bypass
    2. Bypass->Reverse->Bypass
    3. Bypass: a pass through mode when the timing signals pass through unaltered.
    4. Forward: Forward rotation is detected.
    5. Advance Timing: After a number of forward cycles, timing shifting can begin.  This includes a linear slew rate for how fast the timing is changed and a timing advancement curve that sets the target degrees of advancement based on the current RPM.
    6. Reverse - Reverse rotation is detected.  Currently the system just passes through the signals in reverse since no timing changes are needed.
  5. Using timer-driven interrupts to drive the signal change is simple, but managing two timers simultaneously is necessary since the "next" cycle may begin either before or after the previous cycle has ended depending on if the motor is accelerating or decelerating.  Also, assuring the timers have completed their cycle before the state machine transitions to another state is key to avoid unexpected signal changes.
After all of this, there is a noticeable low-RPM torque boost from the timing advance and an increase in the top-end RPMs when in neutral.  The motor now hits around 5,000 RPM in neutral where before the timing advance, it was closer to 4,500.  This was the evidence that the timing is advancing.  I have not tested to see if this will result in higher road speed.

Just a note, when the timing shifter is not functioning properly, the motor can behave quite poorly, resulting in unexpected phase changes or changes that are not aligned with the physical coils/magnets of the motor.  This resulted in some loud thunks, sudden vibrations, or other undesirable motor actions.  There is still some empirical work to do to see what the optimum timing advancement curve should be. 

Currently the timing advance curve looks like this.
 RPMs                  25k    5k   3333   2500  1250   833   625   416   357     156  
angleOut[] =   {      35,   45,    45,    45,     35,     35,     30,     25,   25,      20}

Tuesday, January 19, 2021

Idler Gear Bearing

Well after a little close listening, I suspected the idler gear bearing (13H7848  I.D.(shaft diameter) .750", O.D.-1.063"., equivalent to the SCH1212) was a source of some of the whining sound generated while the motor is under load.

Pulling off the gear cover and examining the gear, the pins looked OK but all on-line guidance indicated replacing it should help.   There are two identical bearings, one in the block and one in the cover.  The gears all look OK so there are only a few things that could cause the whine.  

Removing the bearing from the block was easy but the one in the cover took heating the cover with a heat gun to 75C and then strong repeated pulls with a slide-hammer + blind bearing puller rented from my local auto supply.  The new bearings installed easily.  This did allow me to check the end-float on the idler bearing and it measured with feelers at 0.004 inches.  Right in the desired range.  Everything spins easily and upon reassembly, the whole motor sounds quieter though the whine still exists under load.

This tear-down project did permit some additional cable clean-up, a lowering of the controller and the replacement of a piece of sheet metal along the side of the engine compartment.  This now simplifies motor access.

After some additional research, I replaced the oil with 20w50w given the age of the gearbox and the fact it never operates at a temperature above ambient.

Monday, March 2, 2020

One thing leads to another

Lots of grease

During a recent commute, a thumping sound was audible between about 10 mph and 20 mph.  The sounds was speed dependent and seem to be correlated to wheel rotation.

Looking underneath, two things were seen - A torn outer CV boot (driver side) and a torn steering rack boot (driver side).  Also, the oil drip from the main shaft seal seemed to be getting worse, so it was time for a major enhancement session (3 weeks on the jack-stands).  Here is a summary of the latest updates.


  • New Rear Main Seal (LUF10005).  Previously, the bolt holding the primary gear to the shaft adapter for the motor would not easily slide through the seal and onto the motor shaft.  Some light grinding and thinning of the bolt head resulted in it not tearing the seal when attaching it to the shaft.  The old seal had an obvious gash.

  • Idler gear float - confirmed the idler gear float is 0.004 inches (right in spec).  Verified the torque on the bolts holding the flywheel housing/transfer gear cover.  The gears all turn very easily by hand when in neutral.  This was part of an effort to reduce gear noise.
  • New gasket for gear-box cover.  Removed the RTV "make-a-gasket" material and installed a custom gasket, making it easier to service in the future.
  • CV Boot replacement (GDG0233) - This required disassembling the driver side wheel hub - 2 ball joints.  Then the drive shaft could be removed, repacked both CV joints and reassembled.  Replaced ball-joint dust covers (BTA0377) since they were destroyed in the disassembly process.  Needed to apply some crowbar pressure to get the stud to seat into the knuckle so that the nut could be tightened.  The old boot had a plastic zip-tie on the large end, sitting inside the wheel hub, and it may have snagged on the hug causing the boot to tear.    Used the metal band that came with the new boot.   It has a much smaller head.
  • Steering Boot replacement (BHM7113) - Removed the tie-rod end ball joint.  The ball-joint seal was not installed with the upper clip so the joint was frozen.  This is a non-greaseable joint.  After some freeze-all and lots of wiggling of the stud, the joint freed up. Then a good application of silicon grease and standard grease had the joint twisting very smoothly.  The cap was installed with zip-ties on both the top and bottom to prevent water incursion.    Greased up the steering rack as best possible and installed the new boot.  It is hard to tell whether the steering is easier now but this certainly did not hurt.
  • Brake cylinder rebuild (BHM7068) - one of the brake cylinders had a significant leak so a quick replacement of the inner and outer seals resolved it.  Also, replaced the broken water ring for the inner front hub seal (GHS0173).


Electrical Updates

As an experiment, I inserted a spare CA60FI LiFePO4 battery in series with the existing 26 cells.  This raised the resting pack voltage to approximately 87V.  The Kelly controller shuts off at 90V, so there is not much margin but the pack should never exceed this during driving.  Charging voltage goes higher, but the Kelly controller is not operating during charging.  Regenerative braking does not produce enough boost to raise the pack voltage above about 88V.

This resolved:

  • The DC-DC converter would shut down if the Pack voltage dropped below about 72V.  During heavy acceleration (300A-400A), the pack could drop to this level, especially, if it was below 50% charge, resulting in the 12V system dropping down and relying on the small starter battery.  Lights would dim but nothing else noticeable, just annoying.  The extra 3.2 volts made the difference and now the DC-DC converter never drops out.

Now however, the 27 cells means two things - a new BMS since the current (Green Bike Kit GBK) unit is customized to 26 cells, and a new mechanical arrangement.  The 13 x 2 rack will have to be redone to a 9 x 3 setup, if that will fit in the boot.  This is a good reason to re-engineer the battery setup anyway.  Just need to order a new BMS.

Second benefit - About a 4% increase in battery capacity - not a lot, but every bit helps.

New Digital Dashboard

New Dashboard

It was time to upgrade the Digital Dashboard.  Here is a quick summary and a few fixes

1) New DUE Arduino controller
2) New Serial CANBUS from Longan Labs  http://docs.longan-labs.cc/can_bus/ 
3) Sainsmart 7 inch TFT LCD with CTE Shield (uses SSD1963 controller)
4) Using the UTFT and URTouch library for the display

Setup

1) UTFT myGLCD(20, 25, 26, 27, 28);  //Setup for display  This is CTE70=20
2) URTouch  myTouch( 6, 5, 32, 3, 2);  // the 32 was a change from the default 4
     - Touch Calibration worked with #define TOUCH_ORIENTATION  LANDSCAPE
3) Serial CANBUS connected to Serial 3 on the DUE  (tx-rx rx-tx)
4) 12V DC supply to the DUE (see below for 3.3v fix)

Fixes

  • TFT display would not consistently initialize after being powered off for longer than a few seconds
    1.  Added a 9K resistor as shown in http://www.dimdim.gr/2016/03/fixing-startup-issues-with-arduino-dues/
    2.  Used the latest UTFT library and un-commented out all of the unused configs in the memorysaver.h - 
    3. Removed the 3.3v supply from the DUE to the TFT Shield by bending header pin outward.  This solved the cold-start startup problem.  It seems like the 3.3v suppliers (one on the TFT shield and the one on the DUE may have been fighting each-other.

Now the system consistently boots in less than 1 second.

  •  Serial Can Bus Library - Since Serial Can Arduino Master relied on SoftSerial, a global replace of "canSerial"-> to "Serial3."
  •  Add some buffer clearing since 1939 CAN Data is on the bus starting at power-up.  This floods the serial3 port on the DUE making it difficult to perform the setup.  Sending "+++" to the Serial CANBUS board, sets it to Command Mode, but if the a baud rate is unknown, then the "+++" must be sent at each of the 5 possible baud rates.   After sending the +++; flush the receive buffer then return to Data mode.
  • Change the Serial Can Bus factorySetting() routine to set the serial baud rate to 115200 and to start searching for the current baud rate at 115200 since that is most likely where the board is set to at power up.  The Serial CanBus board stores all settings in nonvolatile memory.   Also set all 6 filters to EXT 0 and the two masks to EXT 0.  EXT is for extended frames used in J1939 CAN Bus 2.0b broadcast protocol.  The 0x00 filter and masks allow all frames to pass through.  When set right the Receive LED on the Serial Can Bus board will flicker dimly with traffic.  If set wrong, it will either be bright or off.  Also, the Green power LED flickers with serial traffic to the DUE.

Monday, December 30, 2019

Tuning the Kelly KLS-72701-8080i

Understanding the Settings


After about a year of using the Kelly KLS72701-8080I BLDC sinusoidal controller (Hall Input) with the Motenergy ME1306, I spent time experimenting with different settings available in the Kelly PC app.  Here is a summary of the settings did to the performance of the car.  The goal was to optimize acceleration from a stand-still on level road.  One indicator of performance is how the battery amps changed (not phase amps).

  1. Increasing IQ-Kp and ID-Kp to 6000 from the previous setting of 4500 resulted in a hum from the motor at about 300 rpm.  Increasing these to 9000 increased the hum.  No performance difference.
  2. Increasing IQ-Ki and ID-Ki to 5000 from previous setting of 500 resulted in low hum from the motor.  No performance change.   Reverted both back to 1000 to resolve the hum.  No performance.
  3. Decreasing IQ-Ki and ID Ki to 0 and 10, resulted in the motor not starting to turn from a stop.
  4. Increasing Torque Kp & Ki from 4500 to 10000 resulted in noticeable improvement in acceleration from a stop.  The battery amps appeared to increase faster when accelerating.
  5. Decreased Speed Error to 50 from 200 and the acceleration was very sluggish.     
  6. Increase Speed Error to 4000 and observed improved performance.
  7. Lowered PWM frequence from 20k to 6k. High hum with no real motor spin.
  8. Lowered Maximum Output Frequency from 1000 to 100.  No change to acceleration but in 2nd gear, the controller shutdown with no error message.  Resumed once RPMs returned to 0.
  9. Increased acceleration time from 1 to 100 (0.1ms to 10 second) - Noticeable reduction in acceleration rate.
Overall, with the Torque Kp & Ki changes and the Speed Error increases, the acceleration is improved with no other observable issues or problems.

Bottom Balancing

Started the annual bottom balancing the drive pack.  Using a custom discharger which is set to connect each cell to a 1/4-ohm resistor network, pulling about 10A (3v/0.25 ohm).  A voltage meter is set to connect the network when the cell's voltage is above 2.8v.  As the pack SOC moves down the shoulder of the voltage curve, the voltage with oscillate around 2.8v until the pack is finally discharged to a stable 2.79v and no longer recovers to above 2.8v.


Friday, August 9, 2019

Summary of Changes over the last year

  1. Rear Subframe - This resolved the concerns from the heavily rusted, 40 year rear frame.
  2. Dampers - GAZ shocks for lowered models from MiniSport.  Noticeable improvement in the ride.
  3. Walnut Dashboard with round digital dashboard to match center console speedo.  This also involved replacing the CAN-BUS transceiver from the Serial Can-Bus device.  With the new transceiver, the system is using the built-in CAN-BUS feature of the DUE.  Still having intermittent CANBUS dropouts/loss of communications.
  4. Interior Door Trim - the plastic window roll-down handles broke, so this led to replacing all of the handles with bright alloy versions.  7ENT.COM
  5. Diagonal Tie Rods Link - The old ones were bent and in need of replacement.
  6. Speedometer Cable - The probably 40 year-old one broke due to tight routing. The new one resulted in a much smoother speedometer needle.  Before breaking, the needle always bounced at low-speeds, and now it just moves smoothly.
  7. Cooling fans for the Controller - The controller was overheating and self-limiting motor current once it got above about 60C.  Two 12v 5" box fans under the controller keep it in the 50C range over long runs with heavy braking.
  8. GreenBikeKit Battery Monitor - This was the end of the CellLog monitors which served Jane well.  The GreenBikeKit 26S BMS is a integrated and programmable system.  A new Arduino communicates over the serial port to the BMS to monitor cell voltages, terminate charge, and drive an audible & visual alarm for over & under voltage conditions.  The BMS also provides charge termination based on two different mechanisms, providing additional protections.  This brings the Arduino count up to 3 for the car.  

KLS72701-8080i Controller Serial USB Communication

Ran into a problem that the controller stopped communicating with the PC Configuration program over the Serial-RS232-USB connection.  The Kelly PC App Reported, no connector or power.

Saw this post on Endless Sphere

In summary - I ran a separate 12v supply to the SM-4P 12v line and cut the 12v coming from the controller (red wire) to the SM-4P connector.

This resolved the issue. The PC still only connects about 30% of the time but once it is connected, I can power cycle the controller without exiting the PC app and the App reconnects (on the Monitor Screen) reliably.

Finally, did some adjusting for Ki Kp SpeedTorque settings to try to squeeze out a bit more performance.

Wednesday, September 20, 2017

It all comes together

Painting

After taking off all of the 5 colors of old paint, and building it back up, here is the final product.






The Union Jack was printed and applied by Corvallis Custom. 

Additional enhancements in the last few weeks:
1) New carpet installed
2) New front seat padding installed - The 40 year old foam was quite done.
3) Wiring organized under the hood and in the boot.
4) Please note the new WIPAC fog lights on the front.
5) 3D printed (MakerBot) Wheel center caps 
6) All seats and inside panels painted with Gloss Black Vinyl paint.
7) Brighter tail/brake and turn-indicator LED bulbs
8) Wheels painted flat-black with pealable paint
9) New mirrors (Side and rear view)
10) Chrome washer nozzles and fillers for unused wiper holes
11) New chrome license plate frame and rear license plate light assembly

More photos will be posted soon.

Sunday, February 5, 2017

Painting

Actual Painting Starts

This weekend real primer and paint were applied.  After months of body work including fiberglass filler, body filler and endless scrapping of 5 layers of old paint, I was able to start to paint.  As with most, the prep is never done, so there comes a time when perfect enough is good enough.

Plastic drop cloths hung from ceiling, the garage spray booth was ready.

Sprayer of choice - Earlex 5500 HVLP Spray Station
Image result for earlex 5500

Paint System

Martin Senour Cross/Fire family

  1. CE430 LCF Etch Primer on the bare metal and fiberglass bonnet (2 coats)
  2. CP440 Gray 2K Urethane Primer (2 coats)
  3. 56 Basecoat - Marshall Red 
  4. CC5020 Clearcoat
  5. Used the CR733 reducer for 55-70 degrees. The garage was between 60-65 during the paint sessions.
All of these were mixed as instructed on the datasheets.
The 1.5mm tip/needle for all of the coats.
16 oz of each primer for these 4 parts.
24 oz of paint and clear to for 2 coats on the 4 parts.  Heavier coats were used to achieve good wetting.

One note, the 3M VOC respirator breathing mask is amazing - I never once smelled a fume.

Here is the progression of the fiberglass hood/bonnet
Raw, unpainted

After the etching and 2K Primer

With 2 coats of base color and 2 coats of clear coat\

Results: There is mild orange peel visible so I expect once the rest of the car is painted, there will be a wet-sanding day along with polishing to achieve the best possible finish.  It will be easier once these parts are back on the car.

The doors and boot cover (trunk) also came out well:





A significant improvement over the stripped versions:




Wednesday, April 20, 2016

3D Printing a Steering Wheel Hub

3D Printing


Jane has never had the center hub of the steering wheel.  This left the bolt exposed and looking very unfinished.  Having looked on-line and not knowing exactly what steering wheel is installed, I figured this would be a good project to learn about 3D Printing.

I took some rough measurements of the hole size to attempt to get a good press-fit for the hub.

Using TinkerCad to draw the hub and a MakerBot 3D Printer to print it,
after some fine tuning to get the dimensions just right, the resulting part looks good and is fairly solid.

You can see the 3D Model here.

Here is what it looked like as a drawing



After some sanding, priming and painting the final hub is shown on the right.  The left is an unfinished version and the middle was a failed attempted at painting.




This is what the bottom looked like to cover the small bolts and press fit into the wheel

.


Here is the hub installed.




Thursday, December 17, 2015

Wireless Comms in a '73 Mini

Wireless Fuel Gauge

Up to now, Jane's fuel gauge was driven by an Arduino Uno that is monitoring current via a Shunt in and out of the battery pack.  This has worked well but it require a comms wire be run from the boot to the dashboard to power the fuel gauge.  Since the fuel gauge had to be isolated from the 12V system to maintain complete isolation of the traction pack from the rest of the car.

This week's project involved replacing the wire with a wireless system.  Using two nrf24L01+ 2.4GHz radio boards that cost about $2.00 each, the system now communicates wirelessly from the current monitoring Arduino Uno to the dashboard Arduino Mega.

 nrf24L01+ board

These boards communicate over the SPI port on the Arduinos and only need 2 additional digital lines for chip select.  Using the RF24 library, it took about 15 minutes to connect these and have a two exchange between the Arduinos.  To assure reliable comms, the radios were set to 250 Kbps and maximum output power and retries.  The system has no problem communicating from the boot to the dash and these radios have a acknowledgement system, so comms are quite reliable.   The dash radio sends a request for data and the battery system send back charge level, current current and time that the system has been charging.  Since this is less than 10 bytes, it goes quite fast.

For the dashboard Mega that is also driving a Sainsmart 3.2" color LCD, an SD card, a Touchscreen and the CanBus interface for the Kelly Controller, I ended up adding a softSPI interface since connecting to the standard hardware SPI interface introduced some issues.  After a couple of hours of unsuccessful debug, it was easier just to grab 5 unused pins on the Mega and setup the greiman Soft SPI bus.   This worked great and did not interfere with the SDCard which is the only other SPI device in the system.  Also, Megas are known for noisy 3.3V supplies, so I added a simple LM317 regulator with the appropriate resistors to get a 3.3V supply from the 5V line.  The radios run between 1.9V and 3.6V so a precise supply was not critical, just a clean one which was done with a few large caps.

With the battery monitor now is communication with the dashboard computer, a new feature was added to the dashboard computer.  By touching the screen, the system will switch to a battery view which shows charge level and current battery current.  This will allow for an easy comparison between battery current and motor current.  The real test will be comparing the reported power of each which should provide some additional efficiency data.   Also, the dashboard computer will now drive both the original fuel gauge and temperature gauge, simplifying the overall system and isolating the battery system from the dashboard.

Tuesday, November 24, 2015

New Primary Gearing

The second time is the charm

Recently the primary gear (22A1493) started to make some noise and it has always been slightly non-centric.  Well this was motivation enough to make a second attempt at attaching the gear to the ME0913 motor.

In the original Mini engine, the primary gear spins on the crankshaft and couples the clutch plate to the transfer gears which go to the transmission.  Normally, the gear spins with press-fit bronze bushings which is oil fed through feeder holes in the gear.

With Jane, the primary gear is firmly attached to the electric motors shaft and transfer power to the transfer gears.  The challenge is the Primary gear has an ID of about 1.75" and the ME0913 motor's shaft is 7/8".

A shaft coupler can be used to adapt these two, however, the inside of the Primary Gear is not a consistent diameter but actually 3 different diameters.  These vary by about 0.1" by design (1.5" - 1.62").  The center section has a smaller ID (~1.504") than the outer sections.  Therefore, additional adapters (bushings) must be made to permit a press-fit between the coupler and the gear.  The two new bushings were designed to match the diameter of the inner section (shoulder) so that the coupler will have consistent contact through the length of the gear.  The gear is hardened steel and could not be easily machined.


Here the keyed shaft coupler is shown press fit in bronze-aluminum bushing pressed into the primary gear.

This is the other end of the assembly showing all three elements (Gear, bushing (bronze),  coupler (inner black)).  Note the thickness difference in the bronze bushings (Front vs. rear)


Additionally, a grade-8 bolt was installed through the gear-bushing-coupler to transfer power and hold the assembly together.  With only 40 HP, the Grade-8 bolt should provide sufficient shear strength.  The coupler was cut flush with the front of the primary gear.  The other end of the adapter fits flush with a feature on the motor and is held in place with a bolt through the shaft.

You can also see a new seal (black rubber LUF10005) installed that will keep oil from leaking along the gear.

The first time this assembly was made, the original bushings were turned to accept the coupler but since the gear is difficult to chuck-up in a lathe, it was impossible to machine the inside of the bronze bushings concentric with the outside of the gear.  This resulted in a slight acentricity and it was visible as the gear was turned by the motor.  I suspect this added to the noise coming from the primary gear.  The new custom bushings should be perfectly concentric resulting in a better fit and hopefully reduced noise.

Success

The new gear assembly is in and here is a video of it in motion.  No visible non-concentricity and it is much quieter. Also visible is the good oil circulation for the primary gear train.  


Some photos for higher details.