Author Topic: Greenworks 60v battery Ohm terminal  (Read 3090 times)

0 Members and 1 Guest are viewing this topic.

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #25 on: February 28, 2021, 11:45:02 pm »
Thanks for sharing.

I just bought a 60V 4Ah GW battery-should be here on the 8th. Once I get it I'll post the data from the logic analyzer as well.
I'm still confused how those on the other forum got it working and we did exactly what they mentioned with no luck? Hopefully we'll figure it out.
 

Offline typoknig

  • Regular Contributor
  • *
  • Posts: 74
Re: Greenworks 60v battery Ohm terminal
« Reply #26 on: March 01, 2021, 03:20:43 am »
GreenWorks: 1, Typoknig: 0

I have produced the signal within 2us of precision and used the 5 unique initialization pulse groups, but that is apparently not good enough.  I set up my scope to record both the GW battery Omega pin signal and the signal generated by the Arduino at the same time and had the Arduino start generating the signal at the same time (there was about a 50us delay for the Arduino starting because I was using the GW battery Omega pin signal as a trigger) and the wave forms are essentially on top of each other with only very minor differences that I'm unable to remove due to the precision of the Arduino.

I felt I had exhausted all possibilities trying do duplicate the signal without knowing more about the actual data.  I didn't think that GW would bang out their own protocol, so I took the battery apart to seen what was inside.  No surprise, it was potted just like the snow blower controller, but it wasn't nearly as thick.  There was one large chip that looked like it might be a controller, so I scraped off the potting material and found it is a Renesas R5F100ACA.  Datasheet from Mouser attached.  I'll dig into the datasheet this week to see WTF this chip wants from us, but the first thing I noticed is that it is a 32MHz chip compared to the Arduino Nano which is only 16MHz.  That could definitely cause a resolution problem.

Also attached is a spreadsheet of the pulses I recorded from my scope. The actual pulses were often a fraction, so I always rounded down to a whole number.
« Last Edit: March 01, 2021, 05:13:54 pm by typoknig »
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #27 on: March 05, 2021, 08:57:08 pm »
My GW battery arrived yesterday.

I looked at the signal on the scope and it looks exactly like the one I'm producing with the Arduino code.
I thought like you said it might be the voltage difference (+5V Arduino vs +2.3V GW batt) so I hooked up a POT and used it as a voltage divider to take the signal down to about 2.3V...Still didn't run (I used a 2k pot-perhaps it also needs a specific current?). I also noticed like you said the initial pulse group only went low to about 60mV and the 2nd pulse group went to about 20mV?

I will try connecting to my logic analyzer sometime this weekend but so far everything looks fine on the scope?

I guess if this doesn't work I'll just keep the GW battery and use my additional batts with it to give me a longer runtime.
 

Offline typoknig

  • Regular Contributor
  • *
  • Posts: 74
Re: Greenworks 60v battery Ohm terminal
« Reply #28 on: March 06, 2021, 03:30:25 am »
Don't give up!  That's what they want!  :)

I haven't had a chance to dive into the datasheet I posted.  That controller is complex enough that nothing was jumping out at me at first glance.  I also had to send my scope in for service so I'll be without it for a couple of weeks.

Here is one thing that give me hope though.  If this is a timing issue (which is still one of the most likely cases) here is post about producing sub microsecond accuracy.  I haven't had a chance to implement it yet, but I did notice that a lot of the pulses from the GW battery were XX.5us, so the method described in this post could help us get closer to that mark:

https://forum.arduino.cc/index.php?topic=96971.0
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #29 on: March 06, 2021, 08:54:30 am »
Hooked everything up to the logic analyzer tonight,

For some reason (probably me) I am only getting the signal from the Arduino to come up on the logic analyzer.
I have the signal from the Arduino adjusted to 2.3V. I have never used a logic analyzer so I'm sure its something I'm doing wrong...Perhaps the GW batt signal not going to 0V is the problem, I'll try a few different triggers tomorrow and see what I can get.
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #30 on: March 06, 2021, 09:40:44 pm »
Good news,

I found my mistake (grounding issue on the GW signal-logic analyzer) and captured both signals.
You can see many differences between them on the PDF screen capture (attached).
Channel 0  (top) is the signal from the Arduino, Channel 1 (bottom) is the GW battery.

Typoknig, like you mentioned there are some differences in pulse lengths etc.

Now the bad news, I know very little about 'decoding' the signals and changing the Arduino code to match it. The only thing I know how to do is put my cursor on each pulse and compare the measurements.

I tried attaching the file but it is not an 'Allowed File Type'.
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #31 on: March 06, 2021, 10:56:02 pm »
For anyone who wants the original file:

Download the free logic analyzer software @ https://www.saleae.com/downloads/

Send me a PM with your email and I will email you the .logicdata file.

UPDATE: So I have been going through the signals and found 26 mismatches on both High and Low pulse widths.
More to come...
« Last Edit: March 07, 2021, 02:03:41 am by BradK »
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #32 on: March 08, 2021, 07:35:34 am »
Here's where I'm at:

Measured GW batt logic using a sample rate of 16Ms/s.
Compared High and low pulse lengths-noted mismatches.
Wrote a program for my nano, rounding the high and low pulse lengths to the nearest uS.

Signal looked good on scope, connected voltage divider to produce 2.3V peak and connected to mower.
   *Result: Beep beep beep!


Thoughts/troubleshooting:
1. Code not precise enough (although other forum users claimed theirs worked?)
2. Timing between applied power and signal needs to be precise (Right now I have my Arduino powered by a separate PS-I wonder if the Mower has to see the signal within ____mS of seeing 60V power?
3. GW pulse pattern LOWs do not go all the way to 0V as stated by Typoknig.

After this I looked over my Arduino code, made a few changes and found an error that I fixed and then uploaded the new program and tried it again. Result, Beep beep beep. I'm getting really tired of hearing those beeps, I feel like the mower is laughing at me.

Tomorrow I will connect the Arduino to the batteries in hopes of testing if the timing between applied power and the signal is the problem, but I am doubting it. Here's the Arduino code I wrote so far:

Quote
void setup()
{
pinMode(6,OUTPUT);
}

void loop()  {
digitalWrite(6,HIGH);
delay(189);

digitalWrite(6,LOW);
delayMicroseconds(411);

ditigalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH)
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(214);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(214);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(130);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(214);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(117);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(102);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(116);

digitalWrite(6,LOW);
delayMicroseconds(214);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(103);

digitalWrite(6,LOW);
delayMicroseconds(115);

digitalWrite(6,HIGH);
delayMicroseconds(526);

digitalWrite(6,LOW);
delayMicroseconds(204);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(104);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(204);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(204);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(104);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(205);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(105);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(105);

digitalWrite(6,HIGH);
delayMicroseconds(96);

digitalWrite(6,LOW);
delayMicroseconds(105);

digitalWrite(6,HIGH);
delayMicroseconds(95);

digitalWrite(6,LOW);
delayMicroseconds(206);

digitalWrite(6,HIGH);
delayMicroseconds(95);

digitalWrite(6,LOW);
delayMicroseconds(105);

digitalWrite(6,HIGH);
delayMicroseconds(95);

digitalWrite(6,LOW);
delayMicroseconds(106);

digitalWrite(6,HIGH);
delayMicroseconds(95);

digitalWrite(6,LOW);
delayMicroseconds(206);

digitalWrite(6,HIGH);
delayMicroseconds(94);

digitalWrite(6,LOW);
delayMicroseconds(106);

digitalWrite(6,HIGH);
delayMicroseconds(94);

digitalWrite(6,LOW);
delayMicroseconds(206);

digitalWrite(6,HIGH);
delayMicroseconds(94);

digitalWrite(6,LOW);
delayMicroseconds(206);
}   



If the timing test does not solve the problem I will probably look over the program a few more times, measure the GW sig at a higher sample rate and try to get more accuracy out ot it. If that does not work I'll probably give up and figure the problem is beyond my knowledge and just use the GW batt and my batts in parallel to at least double the run time.
« Last Edit: March 08, 2021, 03:13:10 pm by BradK »
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #33 on: March 08, 2021, 05:35:45 pm »

Today I connected everything to my batteries to see if the issue was timing.
Found out my 5V regulator circuit had a short in it and I overvolted my last Arduino Nano (+18V to +5V pin), CRAP!
I may order another Nano but right now this project has taken too much time from other projects.
I'm just going to wire up my existing setup to the mower and use it with the GW battery.

I am still confused how those on the other forum had success as their Arduino program did not even come close to matching what I am seeing coming from the GW battery???
 

Offline typoknig

  • Regular Contributor
  • *
  • Posts: 74
Re: Greenworks 60v battery Ohm terminal
« Reply #34 on: March 09, 2021, 03:27:22 am »
This is just a guess, but I suspect some of the older GW tools were a bit looser on their timing requirements, so the microsecond precision signal generated by an Arduino worked. I suspect newer tools implement another Renesas chip and the timing requirements are now in the nanosecond range which the Arduino can't do reliability via the delay function.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 7276
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Greenworks 60v battery Ohm terminal
« Reply #35 on: March 09, 2021, 03:46:16 am »
This is just a guess, but I suspect some of the older GW tools were a bit looser on their timing requirements, so the microsecond precision signal generated by an Arduino worked. I suspect newer tools implement another Renesas chip and the timing requirements are now in the nanosecond range which the Arduino can't do reliability via the delay function.
My guess is that the line is a bidirectional bus (similar to 1Wire) and therefore imitating the waveform would only work if the playback starts at exactly the right time. Perhaps make a small inductive pickup to tell which end is driving the line while reverse engineering with the scope?
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline BradK

  • Contributor
  • Posts: 17
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #36 on: March 09, 2021, 04:17:47 am »
Typoknig,

I think your right...Very annoying since most tools use 18650s yet the manufacturers act like their batteries are special.
So far I've converted a weed eater, snow blower, power supply, and a water pump to run on my Ryobi batts.

NiHaoMike,

I think that is something to look into.
Perhaps a DPST switch to turn on both Arduino and apply 60V signals at the same time then add the initial wait time to the Arduino code?
I just ordered a few more parts and will try again in a few weeks.
But I do think Typoknig may be right about the sub uS requirement.

UPDATE: Tonight I soldered in the wires for my Ryobi batts and tested it with the GW batt in parallel. Works great. Can't wait to actually try this mower out on real grass.
« Last Edit: March 09, 2021, 07:56:42 am by BradK »
 

Offline typoknig

  • Regular Contributor
  • *
  • Posts: 74
Re: Greenworks 60v battery Ohm terminal
« Reply #37 on: March 09, 2021, 07:59:06 am »
This is just a guess, but I suspect some of the older GW tools were a bit looser on their timing requirements, so the microsecond precision signal generated by an Arduino worked. I suspect newer tools implement another Renesas chip and the timing requirements are now in the nanosecond range which the Arduino can't do reliability via the delay function.
My guess is that the line is a bidirectional bus (similar to 1Wire) and therefore imitating the waveform would only work if the playback starts at exactly the right time. Perhaps make a small inductive pickup to tell which end is driving the line while reverse engineering with the scope?

Good thought. Bidirectional communication would also explain the two different levels of low pulses (600mv and 200mv).
 

Offline BornToRepair

  • Newbie
  • Posts: 1
  • Country: pl
Re: Greenworks 60v battery Ohm terminal
« Reply #38 on: May 28, 2021, 06:57:51 pm »
Quote
Good thought. Bidirectional communication would also explain the two different levels of low pulses (600mv and 200mv).
Definitely it is like you said.
I have bought Powerworks 60V mower cheap without battery.
My idea was to run it with 3x Makita 18V batteries which I have a lot.

To make it run I have modified Arduino sketch available on Endless sphere thread.
I simply removed second part of a script to check if the answer form mower will still appear on a bus. Indded it was.

Unfortunatley this was not enough for reliable opration. Mover turns off after 1-2 min of running with 6 loud beeps.

Reading carefull this thread and endless sphere theread I figure out that query frame is not the same all the time.
Dumb luck I was able to generate different random query and sitll receive answer from mower.

https://youtu.be/Y7Tlfim-A8w

I tried to alternate this query every 2sec. and to my surprise it works!
I was able to mow grass in my entire garden for ~60min.

https://youtu.be/ER4f0lgI0SA
 
Preliminarly I was worried about lack of power in battery powered mower.
Mower draws only ~5A continous, 10A max and this reflecs to only 300 - 600W of power, compared to 2-3kW gas powered mowers.
However it turns to be opposite - gas powered mowers seems to be overpowered for such simple task as grass cutting ;-).

BTW. to power Arduino form 5V you do not need separete DC/DC 60V to 5V converter.
5V is available at motor hall sensor harness!


Here is my working Arduino sketch:
Code: [Select]
// written 5/26/2020
// Working battery interface signal from the "Omega" port
// of a Greenworks Pro 60V batter


//20.05.2021 BornToRepair mod:
//reply frame removed
//pin6 input mode enabled beetween query frames
//query cycling each 2000ms

#define PIN 6

void setup()
{
pinMode(PIN, OUTPUT);
}

void loop()
{

for(uint8_t a = 0; a < 10; a++)

{
digitalWrite(PIN, HIGH);
//Delay 188,000us
for(uint8_t i = 0; i < 188; i++)
{
delayMicroseconds(1000);
}


pinMode(PIN, OUTPUT);

digitalWrite(PIN, LOW);
delayMicroseconds(400);

for(uint8_t i = 0; i < 4; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(200);
}

for(uint8_t i = 0; i < 10; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}

delayMicroseconds(100);

for(uint8_t i = 0; i < 1; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}

// 5
for(uint8_t i = 0; i < 3; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}
delayMicroseconds(100);

for(uint8_t i = 0; i < 2; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(200);
}

for(uint8_t i = 0; i < 1; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}

for(uint8_t i = 0; i < 1; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(200);
}

for(uint8_t i = 0; i < 3; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}

pinMode(PIN, INPUT);
}



for(uint8_t a = 0; a < 10; a++)
{
digitalWrite(PIN, HIGH);
//Delay 188,000us
for(uint8_t i = 0; i < 188; i++)
{
delayMicroseconds(1000);
}
pinMode(PIN, OUTPUT);

digitalWrite(PIN, LOW);
delayMicroseconds(400);

for(uint8_t i = 0; i < 3; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(200);
}

for(uint8_t i = 0; i < 9; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}

delayMicroseconds(100);

for(uint8_t i = 0; i < 1; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(200);
}

// 5
for(uint8_t i = 0; i < 4; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}
delayMicroseconds(100);

for(uint8_t i = 0; i < 4; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(200);
}

for(uint8_t i = 0; i < 3; i++)
{
digitalWrite(PIN, HIGH);
delayMicroseconds(100);
digitalWrite(PIN, LOW);
delayMicroseconds(100);
}
pinMode(PIN, INPUT);
}
}

« Last Edit: May 28, 2021, 07:13:07 pm by BornToRepair »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 15208
  • Country: us
Re: Greenworks 60v battery Ohm terminal
« Reply #39 on: May 29, 2021, 12:41:03 am »
Maybe you can find a worn out battery to reverse engineer? Once a tool has been out for a while there should be some dead ones floating around.

Despite the hassles I do love my cordless tools and hate cords. I gave away all my corded electric tools except for my circular saw and miter saw. I gave away my gas lawnmower last year too, I have a small lawn and realized I was spending more time fussing with the carburetor than I was mowing.
 

Offline typoknig

  • Regular Contributor
  • *
  • Posts: 74
Re: Greenworks 60v battery Ohm terminal
« Reply #40 on: June 22, 2021, 08:52:52 pm »
Awesome!  It is hot AF in the Midwest right now, so this project has been on the back burner for me.  When we get closer to having snow again I'll give your mod a try.  It would be great to be able to do this with an Arduino and not have to upgrade to something faster.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf