'13 CRF250L motorcycle

Tell us about the project you do with the open inverter
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: '13 CRF250L motorcycle

Post by mjc506 »

Seems a long time since I last got the chance to play with this :)

I set out to take some readings today for stall torque in relation to field and DC amps, and also no load speed in relation to field amps. Hit a few snags, but nothing too critical so far as I can tell.

I started with stall torque tests, as this seemed to have less potential to end in a centrigual yield test... (with fmax set to 21Hz) Unfortunately, with only two car batteries in series for my 'HV' supply, I couldn't really push enough amps through the motor to take any meaningful measurements. Additionally, the regulator I'm using to drive my field doesn't seem to be working great - it'll only adjust between ~0.4 and 3.9amps, increasing the range would be preferable. I've got a replacement on the way though.

So, giving up on that, I moved on to no load rpm tests. fmax set to 1000, which would give me a maximum of 10000rpm (redline on the car engine it came from gives ~18000 alternator rpm), using ~26V DC bus. fwkp is set to 0 to eliminate field weakening (this would increase rpm above the base speed, which is undesirable for this test, and in fact undesirable at all times for the alternator - field weakening is better performed by reducing field current to directly reduce field strength!) and I've also adjusted the MTPA function such that Id always equals 0 (this is not an IPMSM). The alternator still includes its fan, so not really 'no load' at higher rpms, but best I can do for now. (Better would be driving the alternator as, well, a generator, and measuring emf, but I don't have the kit).

Reading the reported rpm from the inverter interface at max throttle and varying field currents (high currents first to limit rpm...) gave me a strange relationship between field amps and 'no load' rpm. I could calculate Kv (rpm per volt, I've used rpm reported by the inverter, and DC bus voltage - apparently I should be using peak voltages from the motor phases, but I'm assuming this will be close to DC bus voltage at full throttle) and from that, Kt (Nm per amp).
Image

Given I'm only reading field amps to 0.1A (and this varies significantly when the rotor is spinning!), and eyeballing rpm from the 'plot', I can ignore much of the lumpiness :) but there's definitely a non-linearity there. Whether this 'should' be a smooth 1/x curve, or two separate lines I'm not 100% sure, but I believe that this has captured the saturation current for the field/rotor. (~2.3-2.4A). Saturation isn't necessarily something to avoid at all costs, but it does drastically affect efficiency in terms of field strength/amp and driving higher currents increase heat more than field strength - however, Kt at 3.9A is usefully better than Kt at 2.5A, and the extra few watts used is pretty insignificant compared to armature watts! Also, the alternator contains no permanent magnets to damage with heat - all I have to worry about temperature wise is insulation (the windings are enamelled, the cabling I'm using at the moment is rated to 95degC, and will be running cooler than the motor windings).

You can see I've added columns for 'volts for 18000rpm' and 'Amps for 35Nm'. As 18000rpm is my max allowable rpm (still need to increase the maximum allowed for fmax... guaranteed I'll forget that until riding the bike for the first time and wondering why I can't exceed 40mph...) this gives me a good idea of my required pack voltage, and 35Nm is roughly the motor torque required to match the stock engine and transmission. I must admit, I don't know if this is motor or DC amps, or if a reasonable pack voltage will be able to push enough current. I can't think of a good way to calculate either. On the plus side, I can increase the pack voltage if necessary, then adjust the Kv/Kt/field current to suit :)

I'll re-run these tests once I've received the new regulator for field current, and hopefully see how far I can increase field current while still increasing Kt and avoiding melting anything! I should probably also test with difference DC voltages (1 car battery instead of two...) to make sure I still get the same Kv and Kt numbers. A lower 'HV' would probably also make testing at lower field currents less scary/reduce rpm...

I don't think my sin/cos encoder is quite perfect yet. It's connected to the main board using shielded twisted pair Cat6a cable (shielding is both foil shields on each twisted pair, plus a braid shield around the lot) with the shield connected to ground at the board end. With polepairs=1 I get ~1degree of 'noise', but obviously setting polepairs=6 to match the windings increases the amplitude proportionally. I suspect this is one of those 'get it as good as possible' things? On the plus side, it doesn't seem to be affected by field current (the pulley does attract tools quite strongle as field current increases!). I think I've got it mounted slightly misaligned too - I have some vibration (not the rotor being out of balance, although I'm sure its not perfect!) especially at low speeds, and it can rather appropriately sound like a car engine struggling to turn over :)
User avatar
johu
Site Admin
Posts: 5793
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: '13 CRF250L motorcycle

Post by johu »

Amazing to see what the alternator seems to be capable of!
I would expect some non-linearity when lowering the voltage. Say you have like 2V IGBT drop then two batteries result in an effectice DC voltage of 22V while one only results in 10V.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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: '13 CRF250L motorcycle

Post by mjc506 »

I'm quite pleased with it :-) even at these voltages it has enough torque that I can't hold the pulley still with my hand (although that's not massive to be fair haha). 6.7kg including pulley, so kg/kw is pretty good!

Good shout re: igbt voltage drop. I'll try account for that when I rerun at different voltages.
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: '13 CRF250L motorcycle

Post by mjc506 »

Realigned the encoder (x,y,z; not axially) last night. Still not perfect, but much smoother rotation now. The greater the distance between magnet and chip, the less an effect any mounting inaccuracy has, but the smaller the signal and hence greater noise. Get too close though and it saturates, so there's a definite sweet spot to aim for.

Obvious now, but that dip in the graph above is most likely due to the encoder/motor/inverter/bench/floor system hitting resonance with the vibration caused by the encoder being off-centre... Saturation probably wouldn't be particular obvious on a graph of no-load rpm vs field current - I'll be better off graphing Kt vs field current for that.

Also played with braking/regen a little. Need to think about how brakes will be wired up - I want proportional regen (easy enough - I'll be using the clutch lever as a left-hand rear brake) but I also want to be able to apply throttle while applying brakes (front and/or rear). I could easily not connect the existing brake light switches to brake_in, but would need a separate mechanical switch on the clutch lever (there is already one there, but its designed to switch near the end of travel) or I just remove the check for brake_in from the firmware and just mix throttle and brake pot signals... This'll probably better match the 'feel' of using clutch and throttle on an m/c I suspect.
User avatar
johu
Site Admin
Posts: 5793
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: '13 CRF250L motorcycle

Post by johu »

You can just leave brake_in disconnected and modify brkmax with your second pot. Brake_in is just a "no frills" way to have some extra regen when touching the brake pedal. But when using a second pot on the brake pedal, you can skip the digital signal. The digital signal is also a safety feature so you can NOT accelerate while braking but that is exactly what you want to be able to :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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: '13 CRF250L motorcycle

Post by mjc506 »

I'll check my wiring - I'm sure I needed 12V to brake_in to get any regen. Or I may be losing my mind, entirely possible hahah :)
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: '13 CRF250L motorcycle

Post by mjc506 »

A little more progress today - good news and bad news :(

Good news is that I realised I do have what I need to measure Kv 'properly' - a battery powered drill driver and a cheapy usb oscilloscope - spin the motor with the drill, measure peak voltage and frequency with the 'scope, calculate rpm, peak voltage, Kv, and Kt. Simple! :)

Bad news is that better data isn't always 'better'... With the vibration from the offset encoder, and the load from the fan both gone (I'd set the drill to 'low' speed - ~350-400rpm), Kv was significantly higher at higher field currents than previously calculated, meaning Kt is lower - ie, lower torque per amp. Even at 5A field current, I'd need ~500A phase amps to get 35Nm... 5A is well into saturation too, no significant increases to be had there.

On the plus side, I may have identified the IGBT modules used in the inverter - I found a Mitsubishi application note, and there's a photo of a remarkably familiar looking built up PCB :-) The app note shows an image from a scope measuring the output of an IGBT with 200A rated current, 400A overload current, so I don't think it's an unreasonable assumption that this might still work. Other experimenters (trying to push the IMA system in the original car) have written about a system built into the inverter that prevents really high currents (sounds like desat protection, perhaps overcurrent as ignoring the error will let it continue running) so I'm reasonably happy continuing, pushing the current when built into the bike a bit more, and seeing what happens... Worst case, the Honda inverter does give me a nice driver board which I can use to drive other replacement IGBTs... and they're cheap anyway :)

I didn't actually run the inverter today - I'll check brake inputs etc next time hopeully.
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: '13 CRF250L motorcycle

Post by mjc506 »

Been away from the bat(tery) cave for a while, but some virtual progress... :)
johu wrote: Tue Mar 16, 2021 3:27 pm You can just leave brake_in disconnected and modify brkmax with your second pot. Brake_in is just a "no frills" way to have some extra regen when touching the brake pedal. But when using a second pot on the brake pedal, you can skip the digital signal. The digital signal is also a safety feature so you can NOT accelerate while braking but that is exactly what you want to be able to :)
Worked out the braking thing. From throttle.cpp: (comments added)

Code: Select all

s32fp Throttle::CalcThrottle(s32fp potnom, s32fp pot2nom, bool brkpedal)
{
   s32fp scaledBrkMax = brkpedal ? brknompedal : brkmax; //if the brake pedal is pressed, set max braking to brknompedal, else brkmax

   //Never reach 0, because that can spin up the motor
   scaledBrkMax = -1 + FP_MUL(scaledBrkMax, pot2nom) / 100; //and then scale this with pot2 (with default params, pot2 is always 100%)

   if (brkpedal)
   {
      potnom = scaledBrkMax; // if brake pedal is pressed, ignore pot1 and just output the braking torque
   }
   else if (potnom < brknom)
   {
      potnom -= brknom; //if brake pedal is not pressed, but pot1 is below brknom (the 0% throttle point) then
                        //output braking scaled by how much pot1 is below brknom
      potnom = -FP_DIV(FP_MUL(potnom, scaledBrkMax), brknom);
   }
   else
   {
      potnom -= brknom; //if pot1 is above the brknom threshold, IGNORE pot2 braking input!!
      potnom = FP_DIV(100 * potnom, FP_FROMINT(100) - brknom); //...and output pot1nom scaled to the gap between brknom and 100%
   }

   return potnom;
}
In my case, I have no brake pedal switch, and I want brknom=0 (so with no throttle or brake inputs, the vehicle just rolls). This drops me into the final 'else' statement, which ignores pot2. Easy fix for my situation (once I've worked out how I want to mix throttle and brake inputs) but it strikes me that always mixing in a brake term might be useful generally? Happy to do a PR once I've worked out a 'nice' mixing method if that would be useful?

Also still having nagging concerns that the alternator might not be quite enough. So I did some spreadsheet modelling! (Click for the full spreadsheet, ods) Graphs have time in seconds along the bottom, speed (mph) and Kv on the left, phase amps on the right.
Basically modelled how the motor would perform with 30secs of full throttle, adjusting field current/Kv/Kt to optimum values for each time step. For a 200A current limit and ~175V nom pack, 0-30mph would be ~4.5secs, 0-60mph would be >10sec (and then limited to 70mph to protect it from overspeed). Max accel 0.35g... not fantastic for a vehicle that should be capable of driving off-tarmac.
Image
On the plus side, Kv stays well within the range observed for reasonable field currents, and pushing the current limit would of course help... As would a lower gear ratio and allowing motor overspeed, but that's rather risky, and the spreadsheet ignores losses from internal friction and more importantly the internal fan.

I've previously been pointed towards the Hyundai/Kia 'Belt-driven Starter Generators' from their hybrids (by Mouse, Bratitude et al...) but I had avoided these units mainly due to cost. I've recent found a few at more reasonable prices, and also some information from Kiwifiat made me think again. The much lower Kv of ~32rpm/volt (the lowest the alternator can manage is ~135) means much higher torque per amp. Here's what my spreadsheet thinks assuming field weakening can affect Kv sufficiently.
Image
0-30 of <2 secs, 0-60 <7 secs, peak accel ~1.1g is much better, but performance at speeds above 20mph relies heavily on field weakening - any experience to suggest how much I can expect? (The spreadsheet just uses the optimum Kv point based on rpm, pack voltage and peak current, without caring if it's possible or not, although constrained by min Kv. In this case, it increases Kv to nearly 170rpm/volt from its base Kv of 32rpm/volt, I'm not sure if this is reasonable?) Clearly the BSG/HSG seems a much better motor (as it should be!) but equally clearly, I've ignored field weakening current and probably some laws of physics. Probably the best way of working out what's best is by trying both...
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: '13 CRF250L motorcycle

Post by Isaac96 »

I once put an alternator on a bicycle. It was a Delco 10si or 12si, think it was rated for 100A.
I ran it at 24v with a normal R/C controller -- no feedback, no sensors. It maxed out at about 15mph (gearing) and field weakening was approximately useless, reducing torque enough that top speed barely increased.
This whole system was 200lbs including me, so much lighter than a motorcycle and probably similar in drag.

Which all goes to say, you may not get what you want from an alternator. They're horribly inefficient and are optimized only for cost and reliability.
The "BSG" motor will probably be much closer to what you want.
This is not to dissuade you from fully testing the alternator, just trying to say that it's not much motor.
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: '13 CRF250L motorcycle

Post by mjc506 »

No feedback and no sensors precludes FOC, and yes, at 24V it doesn't have a huge amount of output. Field weakening in the 'traditional' sense works quite nicely with openinverter, but simply reducing field/rotor current is more efficient - and I know exactly what Kv I'll get for varying field current which is nice! This is the main advantage of the alternator motor. By varying the field current between 5amp and 0.5amp, even with a DC bus of only 24V, I can get full throttle no-load speeds between a few hundred rpm, to exceeding 10k rpm (I chickened out of pushing it faster, it's only cable tied to my bench...) That's the way to do field weakening on an alternator motor.

Not arguing that they're built for cost, or that the HSG is a better motor, that's a given :) I just don't know if I can push the HSG far enough into field weakening for it to be a viable alternative.
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: '13 CRF250L motorcycle

Post by Isaac96 »

mjc506 wrote: Wed Mar 24, 2021 11:51 pm No feedback and no sensors precludes FOC, and yes, at 24V it doesn't have a huge amount of output. Field weakening in the 'traditional' sense works quite nicely with openinverter, but simply reducing field/rotor current is more efficient - and I know exactly what Kv I'll get for varying field current which is nice! This is the main advantage of the alternator motor. By varying the field current between 5amp and 0.5amp, even with a DC bus of only 24V, I can get full throttle no-load speeds between a few hundred rpm, to exceeding 10k rpm (I chickened out of pushing it faster, it's only cable tied to my bench...) That's the way to do field weakening on an alternator motor.
Absolutely. You're actually weakening the field rather than counteracting it. More efficient too!
I'm excited to see what you can get out of it with that sophisticated control!
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: '13 CRF250L motorcycle

Post by mjc506 »

Sophisticated? The pot I'm twiddling doesn't even have a knob :) hahaha
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: '13 CRF250L motorcycle

Post by Jack Bauer »

Ho about a valeo istars alternator? got one here I'll never use. Yours for shipping cost:)
I'm going to need a hacksaw
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: '13 CRF250L motorcycle

Post by mjc506 »

Appreciated, but I've got a good one thanks :-)
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: '13 CRF250L motorcycle

Post by mjc506 »

Needed a distraction from work, and waiting for a delivery :) so a couple small firmware changes.

Removed setting STAT_EMCYSTOP on hw_rev3 (it's marked as 'reserved' on rev3 mainboard, but should be tied to +12V to allow starting the inverter using a 'start' button - wiki edited) as I was too lazy to fiddle with my wiring, and didn't like the error showing up on the web interface...

Changed the throttle/brake to potnom mapping as above.

Implemented a 'walk mode' - trying to push the bike when its stuck in mud is tricky enough with an ICE and clutch, could be amusing with an electric motor (applying a bit of throttle will let the rear wheel spin up, possibly to max rpm/70mph, and then it catches some grip... all while I'm pushing really hard on the handlebars and have limited control over throttle/brake/etc...) So a couple buttons on the handlebars to spin the motor up to a set (low) speed (in either direction) could make things much easier! I won't be using the fwd and rev inputs, so I read these and just set the cruise speed to something reasonable (the existing direction selection handles that part). Rather than another new parameter, I'm just using the idlespeed param, as I won't be using idle either (creep on a motorcycle could be... interesting)

Each of those worked first time, which was strange... :?
marengo
Posts: 26
Joined: Tue Mar 02, 2021 11:57 pm
Location: virginia usa

Re: '13 CRF250L motorcycle

Post by marengo »

Walk Mode sounds brilliant. "electric overspin" is one of the few weaknesses I have found in my electric motorcycles ridden over rocks and roots and mud.
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: '13 CRF250L motorcycle

Post by mjc506 »

Yeah, some sort of basic traction control might go on the 'to-do' list, perhaps just a 'rpm change per second limiter' or similar.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: '13 CRF250L motorcycle

Post by Jack Bauer »

Pulled the istars apart for a look. Most interesting thing seems to be much finer stator lams and bar magnets in between the poles of the rotor.
Attachments
2021-03-31 15.00.53.jpg
2021-03-31 15.00.51.jpg
2021-03-31 15.00.24.jpg
2021-03-31 15.00.07.jpg
I'm going to need a hacksaw
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: '13 CRF250L motorcycle

Post by mjc506 »

I keep trying to count the poles and keep losing count :-)

Strange rotor, bar magnets not in all the gaps? Or did you remove some? My rotor has no magnets, but does exhibit some residual magnetism.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: '13 CRF250L motorcycle

Post by Jack Bauer »

16 rotor poles. 2 slots at oposite sides have no bar magnets.
I'm going to need a hacksaw
slociviccoupe
Posts: 34
Joined: Fri Mar 25, 2022 10:29 pm

Re: '13 CRF250L motorcycle

Post by slociviccoupe »

Would you mind sharing the wiring info for the honda ima or what gets hooked up where to the driver board. I have a spare insight mdm or whatever want to call it. Would like to get it spinning something outside of a car.

Im on the insight forum and have searched snd yet to find the pinout for the igbt or its controller
User avatar
Mouse
Posts: 138
Joined: Wed Sep 25, 2019 8:17 am
Location: Wales
Been thanked: 7 times
Contact:

Re: '13 CRF250L motorcycle

Post by Mouse »

slociviccoupe wrote: Sat Mar 26, 2022 3:27 pm ...what gets hooked up where to the driver board.
I've got this pinout for the standalone IGBT you're got from https://www.diyelectriccar.com/threads/ ... ut.183690/
I've successfully controlled one from an arduino with direct connection from the arduino pin out to the UH / UV etc pins.
IGBT pinout.JPG
PWR = 12V feed
GND = Ground
IPUA = Serial feed of things like IGBT temperature and HV bus voltage. This has been hacked but I dont have it to hand.
UH, VH, WH = High IGBT feeds 5V logic compitable.
UL, VL, WL = LOW IGBT feeds 5V logic compitable.
The colours are relating to the main connector loom to the IGBT module.

If you're getting into the later self contained unit this is a valuable document from diyelectriccar,com about where you need to tap into the main PCB for control of the IGBTs.
Honda_IMA_Rev_Eng.pdf
(1.78 MiB) Downloaded 70 times
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: '13 CRF250L motorcycle

Post by mjc506 »

Ah, apologies, I thought I'd already put something up about the serial line, but evidently not.

It's 10400 baud, 8E1. The inverter sends 5 'types' of messages, each 6 bytes in length. Two interesting words begin with 0xE1, and 0xD2.

Bus voltage is the 2nd byte of the 0xE1 array *2 + 10. (Adjust the numbers to suit your particular unit/calibration).
Heatsink temperature is the third byte of 0xD2 / 2. The board temperature appears to be the fourth byte of 0xD2. There's something in the 5th byte too, not sure but appears to be a temperature.

The other words include error messages etc, and probably currents? But I haven't fully mapped yet. I've attached some poor Arduino code that reads the serial line and sends UDC and heatsink temperature over CAN. You can probably comment out all the CAN stuff to begin with...
Attachments
inverterSerialRead.ino
(5.06 KiB) Downloaded 60 times
slociviccoupe
Posts: 34
Joined: Fri Mar 25, 2022 10:29 pm

Re: '13 CRF250L motorcycle

Post by slociviccoupe »

So this is the hch1 igbt can the gen 1 insight igbt be driven similarly or does it need the mcu with it. Ive tried google searches and even on insight central. I cant find anything for the gen 1 insight igbt. If i have to ill get a hch igbt.
slociviccoupe
Posts: 34
Joined: Fri Mar 25, 2022 10:29 pm

Re: '13 CRF250L motorcycle

Post by slociviccoupe »

And do you happen to have your info of an arduino or an stm32 running a honda igbt. Im just tinkering trying to get a prius compressor to run on my insight since i have the pack for it. I have a honda compressor controller on the way with the accord ima motor but seing what i can do in the meantime.
Post Reply