Wednesday, April 28, 2021
Digital Dashboard Do-over
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.
- 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).
- 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).
- 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.
- A basic state-machine worked well with the following paths.
- Bypass->Forward->Advance Timing-> Bypass
- Bypass->Reverse->Bypass
- Bypass: a pass through mode when the timing signals pass through unaltered.
- Forward: Forward rotation is detected.
- 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.
- Reverse - Reverse rotation is detected. Currently the system just passes through the signals in reverse since no timing changes are needed.
- 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.
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 fixesSetup
Fixes
- TFT display would not consistently initialize after being powered off for longer than a few seconds
- Added a 9K resistor as shown in http://www.dimdim.gr/2016/03/fixing-startup-issues-with-arduino-dues/
- Used the latest UTFT library and un-commented out all of the unused configs in the memorysaver.h -
- 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.
- 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
- 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.
- 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.
- Decreasing IQ-Ki and ID Ki to 0 and 10, resulted in the motor not starting to turn from a stop.
- 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.
- Decreased Speed Error to 50 from 200 and the acceleration was very sluggish.
- Increase Speed Error to 4000 and observed improved performance.
- Lowered PWM frequence from 20k to 6k. High hum with no real motor spin.
- 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.
- Increased acceleration time from 1 to 100 (0.1ms to 10 second) - Noticeable reduction in acceleration rate.
Bottom Balancing
Friday, August 9, 2019
Summary of Changes over the last year
- Rear Subframe - This resolved the concerns from the heavily rusted, 40 year rear frame.
- Dampers - GAZ shocks for lowered models from MiniSport. Noticeable improvement in the ride.
- 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.
- 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
- Diagonal Tie Rods Link - The old ones were bent and in need of replacement.
- 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.
- 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.
- 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.