Hello Electrified Miata and Formula Mazda-E fans! There is nothing like having priority obligations to heighten the anticipation of hearing the motor Zing to 10,000 rpms in a heartbeat. Join us this week on the journey to make these vehicles go fast through the magic of electrons and magnetic fields.
Last week after car night, the battery was ready to go with 357.7 volts in the tank and some software problems to solve! Perfect. I day-dreamed all weekend of hearing the wonderful Zing with full power. The Leaf motor was on a sturdy stand before, so now I'd be able to turn up the torque! After finding the problem with the CAN bus (I forgot to make the script executable that increases the CAN bus queue size) I did a little re-design on the pre-charge software processes. Withing a few hours, I was ready to test. I turned on the master switch and guess what? Nothing but a few relay clicks. Hmmmm. The good news is that the pre-charge failure logic is tested in real-world failure scenarios.
I methodically tested each part of the pre-charge circuit and the very last part I verified proved to be at fault. The pre-charge relay that connects 12 volts to the pre-charge contactors had died. The lights on the relay driver board changed colors, the relay coil worked fine, but the switch didn't close. I rewired ex-go-kart headlight relay to be the new pre-charge relay and the Leaf motor came to life!. Yes, time to put the motor through it's paces The torque commands range from 0 to 2,047 in the positive direction. On my previous "engine stand", a ratchet-strap to a small dolly, I discovered that a torque setting of greater than 300 was a borderline unsafe.
I entered a starting torque 30 on the computer, and the motor ran. I entered 300 and the motor spun up to speed quickly with no visible movement on the stand. I tried 500 and the Zing was even more pleasing. I tried 1000 and just had to call Bruce. I was bouncing around like a five year, which really amused my wife. The resulting Zing was incredible. My mind was now spinning at 10,000 RPMS along with the motor. I'll need to get my CAN logger running to measure how fast 0-10,000 rpms really happened. How can we record this so other's can share in the joy? Would a slow speed camera work? Bruce came over and we repeated the test several more times as he tested the stability of the stand. The motor never even got warm. No acrid fumes so we left the garage door closed. Oh my goodness, that Zing sounded so good.
What could be more pleasing than running the motor? Running the motor through
an accelerator pedal! I assumed this would be easy, as I'd had the accelerator pedal working before. However, it wasn't till the end of the next day that I had the problems ironed out. The Helper software system had advanced quite a bit from the last time I'd run the accelerator process.
Geek mode on:
The Helper system is an event driven system, much like GUI event loops. I never added a timer to the accelerator program, so the process would end up in a state with no incoming messages and no timers. No input stimulus equals no output from the accelerator process. Since the accelerator pedal process used to run, I assumed the problem was elsewhere in the system and took me a while to track down the real problem, no timer to send the next message.
Geek mode off:
I was so happy when I finally realized adding a timer would solve the problem. No sooner had the accelerator pedal start working then another problem popped up. The system would freeze after a 30 seconds when the motor was shut off. This didn't happen if the accelerator program was stopped. Hmmm. No surprise, the CAN bus would stop working when the inverter power was shut off. What I failed to test was how the program would respond to the stopped CAN bus. The messages from the accelerator pedal being sent to the CAN bus started to queue up and queued messages used all the system resources. Once I discovered this, it was relatively easy to not block on CAN bus full, which solved the problem. With these
problems fixed, I could *finally* start working on computer assisted shifting.
The first challenge was wiring the vehicle speed sensor (VSS) on the transmission to a micro-controller PICO (tiny computer with no operating system). The Miata connectors were old and brittle. I located some new connectors and ordered them. To start testing now, I soldered a few wires directly to the transmission. I wired the VSS to the signal filtering chip (MAX-9924) and fed that signal in the PICO. This setup didn't work reliably, sigh Lucky for me, it was car night already, so we could figure out the problem(s) as a team.
During the week, I shared my code victories with my wife, expecting her to be duly impressed by how many code dragons I'd slain this week. Her comments were, 'it really sounds loud, like metal on metal. Did you fill the transmission with oil?' Feeling irked because I hadn't got the praise I desired from my wife, I initially resisted the suggestion. However, after realizing that spinning the transmission input shaft at 10000 rpms would fling the clinging gear oil off, I decided that $12 in oil (I didn't want to use full synthetic oil Arm donated to our project) would be a suitable price to pay rather than pay the currently rising prices for another Miata transmission.
During car night, we added gear oil to the transmission and it *was* significantly quieter. My wife was right, and wise lady that she is, didn't gloat about it. I'm so blessed to have a wife with a ear for mechanical things. I get so excited about what I'm doing, I forgot that basics and she was there to remind me. She make a great teammate! Thank you Teresa.
Brian, Bruce and Joe were there for car night and after filling the transmission and zinging the motor a few times,
we settled down to figure out why I wasn't getting consistent results reading the VSS sensor with the PICO. I knew I had a software problem (or two) but was seeing consistent problems at low motor RPMS. Joe brought his scope and we observed both the input and output signal from the sensor chip. As we were looking at some of the VSS signals, Jon Guy's name came up several times as the person who would know how to make it 'right'.
Joe showed his his skill at running the Leaf with the accelerator at a slow speed and we discovered that the signal from the VSS is like a tiny generator, whose signal gets
stronger the faster it spins. The sensor chip can and does adapt to this signal, but needs to run in a more sophisticated mode for slow speed( < 2000 RPMS) operation. We started with the simplest settings on the sensor chip. This isn't good enough. More research and experimentation will be required, but I know how to test it, and separate the hardware and software problems, which is great progress.
Formula Mazda news:
We're continuing to wait for parts. We'll let y'all know when parts arrive and we can continue work on this project.
I'll be writing y'all in two weeks. This will save you from me going on and on about the geeky software and hardware rabbit trails and will make the speed sensor solution much clearer. Things are always easier once you have the answer! As always, thanks for reading.
Bill likes cars that understand the 'go fast now' pedal