Alta electric dirtbike OEM project

Tell us about the project you do with the open inverter
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Alta electric dirtbike OEM project

Post by marengo »

I have landed here by way of endless sphere board. What little I know of electrified traction systems comes from the 40kW or less end of the spectrum. I joined here because reading through the threads here has given me hope that my project isn't a lost cause.

Alta Motors was a US company that produced about 1000 electric motorcycles 2017-2019. The company folded and the the intellectual property is now in the hands of BRP (Sea-Doo, etc). The bikes are very robust and powerful dirtbike/supermoto machines. Luckily they are pretty reliable and owners have been able to fix a lot of issues with no company or dealer support.

My project is a non-functional bike that was sold as an early prototype. It has most of the components of a working bike but I'm not sure any of them are functional. I am in the reverse engineering and component identification phase. It's a little different from most projects here as I have the whole machine on hand and don't need to do mechanical fabrication. I am, however, stuck with using all the OEM parts as they are all integrated.
20210303_103456.jpg
Reading this thread https://www.evbmw.com/index.php/evbmw-w ... u-modboard has shown me some similarities between the Alta inverter and the Tesla 3. They both use Texas Instrument chips integrated into the same board with some of the power stage elements. (still not comfortable with even the terminology). I was planning to buy a Version 3 inverter board straight away but now am wondering if the upcoming Tesla Modboard has any chance of being able to run my inverter.
20200520_111344.jpg
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Alta electric dirtbike OEM project

Post by joromy »

Hi, and welcome. Very cool project!!
The tesla board is made specifically for tesla motor.

The ver3 board is more allround board.
https://openinverter.org/shop/index.php ... duct_id=58

What kind of motor is it?

Would be nice with some tech spec.
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Thanks!
20210207_182607.jpg
I think it is PMSM with absolute position encoder
AMS motor position sensor
https://ams.com/as5134#tab/applications

Motor also has temperature sensor, 6 magnets and 14000 rpm redline
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Inverter details so far: (motor and igbt brick are water cooled)

Mitsubishi 300A 600V igbts with 6 integral gate drivers?
http://www.mitsubishielectric.com/semic ... /g1_series

Inverter Microcontroller TMS570
https://www.ti.com/document-viewer/TMS5 ... PNS1412487

Melexis hall current sensor
https://www.melexis.com/en/product/MLX9 ... ent-Sensor

Throttle, not yet identified

Battery is 84S Panasonic 18650 cylindrical li ion cells. It supplies a large capacitor on top of the inverter

The system uses a canbus with nodes for inverter, accessory control module, battery, charge port module and display module. I'm told the production bikes have a second canbus from throttle to inverter but I'm not sure if the early bikes like this prototype has that.
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Reading the wiki on FOC, I read

"Field oriented control is only implemented for permanent magnet motors. Moreover it is optimized for IPM motors (interior permanent magnet). So it will not drive PMSM or BLDC motors in an efficient manner. "

First big question: is openinverter a good choice to try to get this project going?

(i think i have PMSM with surface magnets SM instead of IPM)
User avatar
Bratitude
Posts: 783
Joined: Thu Jan 02, 2020 7:35 pm
Location: Canada
Has thanked: 57 times
Been thanked: 168 times
Contact:

Re: Alta electric dirtbike OEM project

Post by Bratitude »

Don’t use the foc software, use sine!
https://bratindustries.net/ leaf motor couplers, adapter plates, custom drive train components
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

You'll need to use FOC for any synchronous motor. IPM motors need some Id, whereas for SPMSM, Id=0. I'm currently working on using a converted alternator (effectively a SepEx, but behaves similar to SPMSM/BLDC for constant field currents) and have a small edit to the firmware to force Id=0 which seems to be working nicely. I should say the motor also runs fine using the 'standard' FOC code, but should be more efficient I think with Id=0. The modification to the firmware may end up in a future release, but if you're happy editing source code and compiling it's a simple edit. https://github.com/mjc-506/stm32-sine/c ... d34d3b58b4

You'll be able to run the motor with the sine software at low speeds for testing, but a synchronous motor is unlikely to work well with it in actual use.

'All' you need to do to get your inverter running with the OpenInverter main board is to find the low voltage (3.3V or 5V) PWM to the IGBT drivers, and perhaps hold the built in microprocessor in reset to stop it fighting with the OpenInverter board. This may mean that other parts of the bike may get grumpy if they can't talk to the stock inverter - I'd be tempted to try to work out why it's not running? You may end up replacing a number of other parts to play nicely without the stock inverter controller.

I'm not jealous much... :)
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Yes, ideally I could fix or figure out why the components don't work. I had a volunteer try to communicate with the bike through the OEM data port. He couldn't get any response from the MCU either through CAN or (I think) JTAG.

I have an OEM diagnostic laptop with the Alta program which is in part a fancy CAN sniffer? One of the tabs is labelled "raw can". This setup works great on the working Alta bike I have, which is a regular production bike. It does fault detection and firmware updates.

I think all the modules have to be happy together or one of many interlocks are engaged. If I can't crack the Alta code, I have to start where I can and pick away at it. The motor is set in stone as it is built into the frame. IF I can get the inverter and motor to work, then I can work on the other dominoes.
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

Worst case, using the stock motor and inverter powerside, and then an openinverter controlboard, bms( maybe?) and perhaps replacement dash (if this is driven from the stock electronics) wouldn't be the end of the world.It should certainly at least run with the openinverter control board...
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

inverterboard1.jpg
Connectors onto board:
1. Current sensor
2. "Main" 12 volt, CAN1, CAN2, Throttle?
3.tiny wires and connector to battery POS and NEG
4.Temps sensor near IGBT housing
5. Temp sensor in motor
6.Encoder. I'm told it is "SPI" as the traces are marked RACLK and RACS
7.This connector sits on top of all the pins coming out of the IGBT brick. The gate drivers live inside the brick
8. JTAG holes

Some of the devices
A. microcontroller , 144 pins
B. CAN2
c. CAN1
D. Opto isolator https://docs.broadcom.com/doc/AV02-1360EN
E. I'm told these are for "desat" protection
F. I'm told these are the power supply transformers for the gate drivers

My understanding is that the Openinverter board V3 will take care of everything above the level of the optoisolators (D). I'm hoping there is a way to disable the Alta microcontroller and connect V3 board onto this board. Is there a way to connect V3 board to this oem board above the optoisolators?
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

Looking good!

I'd be tempted to try finding/tracing the PWM signal - the IGBT brick will take 6 lots of PWM at something like +15/-5V (depends on the IGBTs) but somewhere this will be driven by a low voltage (+3.3/0V? maybe +5V), which the openinverter board can drive. I'd start looking at D - I can't quite read the numbers on the ICs, but there are 6 of them, always a good sign! You may have to hold the main ucontroller in reset, hopefully you can find a datasheet.

Another option might be to remove the stock controller board entirely and drive the IGBT brick with the openinverter board and gate drivers?
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

What I'm calling the igbt brick
20200815_064311.jpg
The linear connector towards the bottom of the inverter board sits on top of these pins.

Under the bricks cover is another board holding the gate drivers
20200521_181809.jpg
I'll edit the text in the previous post with some of the device info
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

Ahhh, even better then. The openinverter board should probably be able to drive that fairly direclty (although looks like the top board has all the power supplies etc)
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Looking at the big picture for a moment, everything above the level of the row of opto-isolators is low voltage inputs and outputs that could be handled by the Johannes brain and V3 board. We would have PWM input flowing down into the igbts and feedback and error info flowing back up to the brain. Everything below the isolators is high voltage and needs to be retained or replicated as none of this stuff would be provided by the openinverter v3 kit.
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Position sensor situation. I'm pretty sure I have an absolute angle position encoder that is configured for SSI output. It is located on the end of the shaft and the housing is 26 mm inside diameter.

https://ams.com/documents/20143/36005/A ... 2749bdaa27

(The sensor chip itself is capable for "ABI" encoding which is the same as ABZ, but the pcb isnt wired that way and the chip might need different programming)

Is my understanding correct that openinverter will not work with this position sensor?
20200604_160932.jpg
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

Hmm. It's a nice sensor, I'd be tempted to make it work. Openinverter will take an SPI encoder input, it would be worth finding the spec for this SSI output, hopefully there won't be too much of a change to the openinverter firmware to get them to talk nicely.

Worst case, its a great enclosure to make a board built around one of the Melexis sin/cos encoders for into!
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Alta electric dirtbike OEM project

Post by arber333 »

marengo wrote: Sat Mar 13, 2021 2:52 pm Position sensor situation. I'm pretty sure I have an absolute angle position encoder that is configured for SSI output. It is located on the end of the shaft and the housing is 26 mm inside diameter.

https://ams.com/documents/20143/36005/A ... 2749bdaa27

(The sensor chip itself is capable for "ABI" encoding which is the same as ABZ, but the pcb isnt wired that way and the chip might need different programming)

Is my understanding correct that openinverter will not work with this position sensor?

20200604_160932.jpg
That AS5134 looks rather similar to RLS module. I bet there is an annular magnet on that shaft end.
I see it is supplied from 5V, it can output UVW signal and can be set for motor poles. I think that would go with Lebowski drive very nicely.
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

mjc506 wrote: Mon Mar 15, 2021 8:34 am Hmm. It's a nice sensor, I'd be tempted to make it work. Openinverter will take an SPI encoder input, it would be worth finding the spec for this SSI output, hopefully there won't be too much of a change to the openinverter firmware to get them to talk nicely.

Worst case, its a great enclosure to make a board built around one of the Melexis sin/cos encoders for into!
What I can gather as far as SPI vs SSI is that SSI has one wire for messages to go back and forth on and the SPI has two wires for carrying messages , one input and one output. The firmware would have to be modified to let the microprocessor send and receive messages from the encoder over a single wire somehow.

The next issue might be that the 256 pulses per revolution is too much for openinerter to handle?

Here is an interesting sensor that is already on a board that would fit into the OEM enclosure or cap. Might this be a possibility if it is set up for sin/cosine?
https://www.rls.si/eng/rmb20-rotary-magnetic-module
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

arber333 wrote: Mon Mar 15, 2021 8:49 pm
marengo wrote: Sat Mar 13, 2021 2:52 pm Position sensor situation. I'm pretty sure I have an absolute angle position encoder that is configured for SSI output. It is located on the end of the shaft and the housing is 26 mm inside diameter.

https://ams.com/documents/20143/36005/A ... 2749bdaa27

(The sensor chip itself is capable for "ABI" encoding which is the same as ABZ, but the pcb isnt wired that way and the chip might need different programming)

Is my understanding correct that openinverter will not work with this position sensor?

20200604_160932.jpg
That AS5134 looks rather similar to RLS module. I bet there is an annular magnet on that shaft end.
I see it is supplied from 5V, it can output UVW signal and can be set for motor poles. I think that would go with Lebowski drive very nicely.
In order to see if the chip is putting out UVW signal, I would need to probe those specific pins with the board powered on and the magnet spinning? Would this be a good first oscilloscope for this and other reverse engineering stuff? https://store.digilentinc.com/analog-di ... er-supply/
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

The SPI encoder is already bit-banged so it'd be possible to change to SSI with some work on the firmware. 256ppr shouldn't be an issue. But yes, 'simplest' would be to replace that encoder circuit board, either the RLS module (I don't know it) or one of the Melexis sin/cos encoders. It'd need a new pcb, but would use the existing magnet and wire in to the openinverter board relatively easily.
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

inverterboard1.jpg
I'm crawling through the learning process so it takes me a while to respond to all the help. Drilling down on the row of optoisolators on the board labelled 'D"

From left to right they are 1Low, 2L, 3L, 1High, 2H and 3H
(these are Avago "IPM gate drive interface optocouplers"): https://docs.broadcom.com/doc/AV02-1360EN

Tracing the input circuits i find that all six are fed signals through the three small square devices located just above them. These devices are "input positive NAND gates": https://www.ti.com/lit/ds/symlink/sn74l ... poasamples

I think these are some sort of buffers that the PWM signals flow through as another layer of safety?

Working backwards from these buffers or gates I found the six specific pins on the TMS570 mcu from which the PWM signals originate :)
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

Excellent :) You're doing well, it's a lot to learn all at once!

Yes, I suspect those nand gates are a form of hardware protection - it'd be quite easy to wire them up to some hw overcurrent/desat/etc output to disable PWM before the mcu even has a chance to think about it!

I would be tempted to try driving the pwm between the mcu and nand gates, this may not work as the mcu or other circuitry may inhibit. But if it does work you'll likely retain the hardware protection. Otherwise, drive after the nand gates, and tie the fault line to the 'desat' input on the mainboard (next best option)

Remember that both these options may be likely to upset the mcu - this may just set some fault flags you can ignore, or it may disable PWM overriding your inputs. Even best case, you may find that the mcu sends messages that other systems (dash, bms etc) rely on so these may not work. If the mcu stops PWM working, you could try holding in in reset (find the reset pin, tie it to ground usually).
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

I'm working under the premise that the OEM mcu is hopelessly locked up. My jtag hacker friend explained that we dont have the proprietary bootloader to do anything with the mcu. I'm not too upset about losing the other systems like the display/dash and the accessory control module.

If I can get the motor spinning (looks promising!) with openinverter, then the next task would be to try and get the BMS and charger to cooperate. I'll have to learn about can sniffing and deciphering for that crucial job. Luckily, I have a second working bike, a working battery and a CAN adapter.

You wrote "Otherwise, drive after the nand gates, and tie the fault line to the 'desat' input on the mainboard (next best option)" This is the strategy that I can mostly comprehend right now. This would entail plugging wires into the openinverter board header and soldering the ends onto the pads of the optocouplers on the Alta board? (The gate driver boards supplied with the V3 kit would then not be needed)

If I have this right, I suppose its time to place an order...
User avatar
mjc506
Posts: 343
Joined: Wed Sep 09, 2020 9:36 pm
Location: Wales, United Kingdom
Has thanked: 30 times
Been thanked: 28 times

Re: Alta electric dirtbike OEM project

Post by mjc506 »

Sounds good to me! Hopefully BMS will be fairly simple (can always bypass it just to get HV...), charger might be more tricky, but yes, if you have a second working bike to sniff CAN from you're in a pretty good position :)

Yup, you've got all the gate drivers etc you need right there in the stock inverter, one would assume they're designed to drive the powerstage properly, so makes sense to use them :) I reckon just a rev3 mainboard and you'll be pretty set :)
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: Alta electric dirtbike OEM project

Post by marengo »

Ok the ball is officially rolling with a tiny transatlantic cash transfer (order). :D

Next up is ordering another encoder in case I don't figure out how to get the OEM working. The encoder disc I'll buy offers two options regarding analog sinusoidal outputs. I assume I want the one that has 4 wires and has peak to peak voltage of 2.2V. The other one has six wires, 1Vpp and described as "analog complementary sinusoidal".

https://www.rls.si/eng/fileuploader/dow ... _sheet.pdf
Post Reply