Radio Control - Brushless Gearless (GB) Invacare Powerchiar

Power wheelchair board for REAL info!

POWERCHAIR MENU! www.wheelchairdriver.com/powerchair-stuff.htm

Radio Control - Brushless Gearless (GB) Invacare Powerchiar

Postby gcebiker » 30 Apr 2020, 10:14

So i have this emulator i built up with lots of help from members here.
A short video...

youtu.be/y1I8IzHqwz4

I have an Invacare Storm Arrow power chair, GB motors (Brushless - Gearless)

And i have a Kayak.

The first power chair that i have used to tow it to the boat ramp, still works but with smaller batteries and tired brushed gearbox.
I wont want it to fail and for me to be stranded with a 14ft Hobie Pro Angler (I'll need a very big taxi to get home)

This a short video of that set on an early test run.

youtu.be/KTTHOhhKhhc

The goal now is to use the Invacare Storm Arrow with the Gearless Brushless motors, with its much larger batteries and more effecient motors, to tow me to a better boat ramp on the Gold Coast Broadwater.

This Chair
Storm Arrow Brushless Gearless Invacare motors.jpg


The Storm Arrow power wheelchair has a connection at the Power Module that looked like a Shark Bus cable connector.
Plugging in one of my Shark Joystick modules confirmed that it would work with Shark Gear (...and it said so in the manual as well )

Hopefully that meant my Radio Control emulator board for the Dynamic Shark Power Module would plug in and off into the sunset i could go....
Ah if only :lol:
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 30 Apr 2020, 10:22

Data captures quickly suggested that Data [4] may be the reason for it not working.
The Arduino sketch does power the chair on (can hear the tell tale motor click) but the chair cant be driven.

Below is the data side by side with a fourth column having descriptions for what each packet of data controls.
Joystick data comparison.png


Anyone have a technical manual for these Power Modules for GB motors ?
Possibly with the formula for the BitWise calculation Dynamic Controls used to get that value for Data[4] ?
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby Irving » 30 Apr 2020, 11:47

I take it therefore the calculation shown in data[4] now isn't correct for the GB Controller? I doubt you'll find it documented anywhere, but if you have a dozen or so samples it should (may?) be possible to reverse engineer it..
C5/6 A (complete)
Puma 40, 75Ah LiFePO4 (pic is on tour @ Whistler, BC)
Puma 40 backup, 73Ah MK (for now)
Spectra Plus (weedy 40Ah MK)
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby Burgerman » 30 Apr 2020, 12:07

Wrong motors. They are hopeless for stall torque. It will soon refuse to move if you load it heavily. I returned a brand new chair because it took 192A at the battery to do a zero speed turn, EMPTY! With me in it it would turn once or twice then it rolled back power and efused to move.
User avatar
Burgerman
Site Admin
 
Posts: 65050
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 30 Apr 2020, 13:19

Irving wrote:I take it therefore the calculation shown in data[4] now isn't correct for the GB Controller? I doubt you'll find it documented anywhere, but if you have a dozen or so samples it should (may?) be possible to reverse engineer it..


Ive the .csv file.
storm arrow_shark joystick.csv
(46.14 KiB) Downloaded 167 times


This was the capture tapping into the shark bus connected to the GB motor controller, with the Shark controller the chair works...
Well mostly.

If the original Joystick is set at max speed then you can indeed vary the max speed on the Shark Joystick....
But if the original Joystick was set to ...say 50% then you can only go at full speed setting on the Shark Joystick to 50% of the possible top speed of the motors.
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 01 May 2020, 00:07

I am going to have a fish around today and see if i can find a BitWise online calculator of some sort.

I guess the first step is to convert all of the Decimal numbers to Binary ? then try combinations of the current checksum's.
I doubt it will be a vastly different method (of calculating the checksum), given the data packets appear to be identical.

This is the version of the Arduino Code from the Shark Joystick Emulator that has the Storm Arrow Power Chair turning on.
SR_RC_PCB_Blue_Board_shutdownpacketsinc(1).zip
(5.87 KiB) Downloaded 179 times
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby swalker » 01 May 2020, 04:57

gcebiker wrote:I am going to have a fish around today and see if i can find a BitWise online calculator of some sort.


I use RealCalc on my android phone. It handles decimal, binary, octal, and hex. It will also do RPN or regular.

Steve
Permobil F5 Corpus 3G
Permobil C500s VS
Permobil C500 Corpus 3G
Permobil C350 Corpus 3G
Magic Mobility X4 with 176 Ah LiFePO4
swalker
 
Posts: 547
Joined: 23 Jul 2018, 22:57
Location: Vail, Colorado, USA

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby swalker » 01 May 2020, 05:05

Duplicate
Permobil F5 Corpus 3G
Permobil C500s VS
Permobil C500 Corpus 3G
Permobil C350 Corpus 3G
Magic Mobility X4 with 176 Ah LiFePO4
swalker
 
Posts: 547
Joined: 23 Jul 2018, 22:57
Location: Vail, Colorado, USA

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 02 May 2020, 07:00

Made a copy of bits of the full code to do the bitmath.
Then read the values on the serial monitor.

Code: Select all
int speed;        // int (16 bit) - signed number from -32768 to 32767
int direction;
int maxSpeedVal;
unsigned char data[5];


void setup() {
  Serial.begin(38400);
 
  speed = 192 ;
  direction = 191 ;
  maxSpeedVal = 255 ;       // full speed on the Shark Remote
}
   void loop(){
    data[0] = (0x60);       // Packet type identifier
    data[1] = (speed);      // (0x80 | ((speed >> 3) & 0x7f));     // Joystick speed reading (7 MSbs)
    data[2] = (direction);  //0x80 | ((direction >> 3) & 0x7f); // Joystick direction reading (7 MSbs)
    data[3] = (maxSpeedVal);//0x80 | ((maxSpeedVal >> 1 ) & 0x7f);  // SpeedVal pot reading (7 MSbs)
   
    data[4] = 0x80 | ((maxSpeedVal & 0x1) << 6) | ((speed & 0x7) << 3) | (direction & 0x7);

   for (unsigned char i = 0; i < 5; i++)
          Serial.println (data [i]);
          }


Originally i had all of it up in void setup () {
( so it only ran once and printed out only the value for data[4] )
I was getting a value of '199' instead of the expected '214'
capture data_sketch_output.jpg


Top left of picture is the data I am inputting (from data capture), in the first (black color) scenario i should be getting '214'

The same Aruduino Nano is plugged into the pc so i can upload/run/monitor results, that i am using for the emulator boards
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 02 May 2020, 14:42

Ive been at it a while and I'm feeling like its a good time to completely re-write the main code.
Using the snippets that i have, returns unexpected numbers.

The numbers input, get modified a few times in code, going to try and slim it down a bit and make it easier to read...for everyone, including me.
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby swalker » 02 May 2020, 17:54

I know you are planning to rewrite the code, but here are a couple of comments.

When bit twiddling, it is better to use an unsigned int rather than an int, to avoid confusion. I assume that you are dealing with positive numbers here.
The statement you use to assign a value to data[4] will not produce the results produced by black, magenta, and yellow table above your serial console output.

If you can explain how you need to pack the bits into data, perhaps we could give some feedback.

As it is, it seems like you are assigning the highest order bit to 1, then selecting certain bits from speed, direction, and maxSpeedVal and assigning them to certain bit positions in data[4]. Doing the same thing with the values in the black, magenta, and yellow table will not result in the value of 214 or 241 in those tables.

Steve
Permobil F5 Corpus 3G
Permobil C500s VS
Permobil C500 Corpus 3G
Permobil C350 Corpus 3G
Magic Mobility X4 with 176 Ah LiFePO4
swalker
 
Posts: 547
Joined: 23 Jul 2018, 22:57
Location: Vail, Colorado, USA

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby snaker » 03 May 2020, 01:28

Is data[4] a checksum byte? If so, its formula should use XOR operators (not OR).
User avatar
snaker
 
Posts: 1193
Joined: 23 May 2015, 10:45
Location: Vietnam

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 03:34

To give a bit of context to what i am trying to achieve.

Woody makes these Bluetooth and RC controllers that are hard wired into an existing Joystick Module.

youtu.be/QSqNKhaaMpg
This video is one that i purchased from him, midway through trying to make the Shark Joystick Emulator RC (it really needs a shorter name...), the emulator eventually ended up as a shield for a Rasbery Pi3 ? I think....not sure i dont know much about the RPi
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 03:47

After a bit of fiddling and help from members here with the code, I was able to drive my power chair that had Dynamic Shark Power module and Joystick.
With a Nintendo Wii.

youtu.be/YVvPwSwwGj8

Second video of same Nintendo control of Power chair with Dynamic Shark Power and Joystick Modules/

youtu.be/6GkNFPJlW4c

This is the code for using the Nintendo Wii wireless verson that i built up.
(this and other early code variations did not yet have the "shut down" sequence that later versions included)
SR_emulator_software_serial_Wii_Input.zip
(4.76 KiB) Downloaded 166 times


After that i tidied up the prototype boards, and ported the code to use with off the Shelf RC car transmitters.

youtu.be/6x7QHqmzDK8

Fitted it up to a donated power chair that had the same Dynamic Shark Power Module
Until recently Ive only ever had one chair at a time and needed the one that i had to pull double duty as a 'house chair' and 'power mobility aid for moving my water mobility vehicles'.

youtu.be/Ta24wr3IecQ

This is the 'how it works' video the same day.

youtu.be/RP0mHbw7hyU
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 04:26

That boat was too big, I started off with a helper at the ramp to launch the boat (so i only needed the RC power chair at home).

....Then my helper got a job ... lol and i was back to square one, sort of.

I sold the Polycraft boat in those videos and purchased a Hobie Pro Angler 14, fitted it with 50ah of LiFePo4 and a Bixby Jet Brushless motor.
I could then tow the Kayak/boat (they are big kayaks and a lot call them a boat) from my house to the kayak ramp in the creek a few blocks from my place.

youtu.be/KTTHOhhKhhc

Its a steel trailer and did not fit well in my shed nor am i able to clean it off after using it, so commissioned an aluminum one that was thinner and shorter.
First two trials over the last two years (yes i am very slow, cant do much about that).... had issues.
Third trial was successful to the point it was uneventful and very relaxing.... but for one issue.

Where i had been previously traveling to the local ramp, the 3rd sea trial was to a ramp much further away. About 20minutes in the chair.
The age and wear on the gearboxes of the dontated power chair would be an area i needed to address, along with the chair only having space for 50ah Batteries.

I purchased from gumtree an old Invacare Storm Arrow, repaired it and found much to my surprise the incredible range and power of the GB motors.

The GB motors use a Shark Bus cable and connectors, will drive with a Shark Joystick module but you can see in the colour coded capture data, the Shark Joystick on the GB motor controller returns a different CheckSum to that of the Shark Joystick on a Shark Power Module.

This is my most recent video.

youtu.be/y1I8IzHqwz4
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 04:38

The specific part of the code i am looking at is the
Code: Select all
void sharkOnMode() {

  digitalWrite(dePin, HIGH);

  Deadband = 32;
  digitalWrite(dePin, HIGH);
  directionPinVal = DirectionVal;
  directionPinVal = constrain(directionPinVal, 1000, 2000);
  directionPinVal = map(directionPinVal, 1000, 2000, 0, 1023);  // Power base only recoginizes values in this range

  // Woody's Deadband code
  if (directionPinVal > (512 + Deadband)) //deadband defined in global veriables
    direction = map(directionPinVal, (512 + Deadband), 1023, 513, 1023); // Turn Right ??
  else if
  (directionPinVal < (512 - Deadband))
    direction = map(directionPinVal, 0, (512 - Deadband), 0, 511); //Turn Left ??
  else
    direction = 512;    // 512 = stop


  {
    speedPinVal = SpeedVal;
    speedPinVal = constrain(speedPinVal, 1000, 2000);
    speedPinVal = map(speedPinVal, 1000, 2000, 0, 1023);

    // Woody's Deadband code
    if (speedPinVal > (512 + Deadband)) //deadband defined in global veriable
      speed = map(speedPinVal, (512 + Deadband), 1023, 513, 1023); // Forwards ??
    else if
    (speedPinVal < (512 - Deadband))
      speed = map(speedPinVal, 0, (512 - Deadband), 0, 511);      // Reverse ??
    else
      speed = 512;    // 512 = stop

    // Code thanks to Irvings bit genius.
    maxSpeedVal = 255;     // full speed on the Shark Remote
    data[0] = (0x60);    // Packet type identifier
    data[1] = 0x80 | ((speed >> 3) & 0x7f);     // Joystick speed reading (7 MSbs)
    data[2] = 0x80 | ((direction >> 3) & 0x7f); // Joystick direction reading (7 MSbs)
    data[3] = 0x80 | ((maxSpeedVal >> 1 ) & 0x7f);  // SpeedVal pot reading (7 MSbs)
    data[4] = 0x80 | ((maxSpeedVal & 0x1) << 6) | ((speed & 0x7) << 3) | (direction & 0x7); //checksum for the speed/direction/maxspeed pot.
    data[5] = 0x80;  // 128;     // default horn off 128 , horn on value is 130
    data[6] = 0x84;  // 132;     // Value read during data capture, taken to be the 'on' value.
    data[7] = 0x80;  // 128;     // chair mode/ drive 128, tilt/aux output 129
    // Checksum calculations - thanks to Irving,Jim and Tony
    byte sum = 0;
    for (int i = 0; i < 8; i++)
      sum += data[i] & 0x7f;
    data[8] = (255 - (sum & 127));
    data[9] = 0x0F;  // 15;       // all packets end with this identifier

    for (unsigned char i = 0; i < 10; i++)
      Serial.write(data[i]);
  }
  digitalWrite(dePin, LOW);
}
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 05:28

snaker wrote:Is data[4] a checksum byte? If so, its formula should use XOR operators (not OR).


Per the Shark Bus protocol manual data[4] is.
Byte 3:
bit 6: Speed pot reading LSb
bits 5-3: Joystick speed reading (3 LSbs)
bits 2-0: Joystick direction reading (3 LSbs)


So instead of data[4] = 0x80 | ((maxSpeedVal & 0x1) << 6) | ((speed & 0x7) << 3) | (direction & 0x7);

I should be using data[4] = 0x80 ^ ((maxSpeedVal & 0x1) << 6) ^ ((speed & 0x7) << 3) ^ (direction & 0x7);

?
Speed pot is an 8bit number, speed and direction are 10bit numbers. Yes all values are positive.
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 05:49

Changing the sections of the test code from OR ( | ) to XOR ( ^ ) per suggestions.

Gives code that looks like this (and changed from word variable type to int and unsigned char, added notes, per suggestions)

Code: Select all
int speed;        // int (16 bit) - signed number from -32768 to 32767
int direction;
unsigned char maxSpeedVal;
unsigned char data[5];




void setup() {
  Serial.begin(38400);
  speed = 512;    // these are PPM Values from the RC receiver. 10bit values
  direction = 512;  // these are PPM Values from the RC receiver. 10bit values
  maxSpeedVal = 255 ;       // full speed on the Shark Remote. 8bit values
}

void loop() {
  data[0] = (0x60);       // Packet type identifier
  data[1] = 0x80 ^ ((speed >> 3) & 0x7f);     // Joystick speed reading (7 MSbs)
  data[2] = 0x80 ^ ((direction >> 3) & 0x7f); // Joystick direction reading (7 MSbs)
  data[3] = 0x80 ^ ((maxSpeedVal >> 1 ) & 0x7f);  // SpeedVal pot reading (7 MSbs)

  data[4] = 0x80 ^ ((maxSpeedVal & 0x1) << 6) ^ ((speed & 0x7) << 3) ^ (direction & 0x7);


  for (unsigned char i = 0; i < 5; i++)
    Serial.println (data [i]);
}


and returns values of
96
192
192
255
192
in the serial monitor
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 07:10

I'm now thinking that I must have to do some sort of setup.

When changing from the MK6i to using a Shark Joystick with the invacare GB motors.

Ill google that.
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby snaker » 03 May 2020, 08:43

According to the specs, your formula (with OR) seems correct. But the specs only describe the last 7 bits (bit 0 to 6). Your formula sets the bit 7 to 1 (by 0x08). Where do you find the description of the bit 7?

I have a look at your numbers in binary:
214 11010110
255 11111111
192 11000000
191 10111111

I just guess that the specs index the bits from LEFT to RIGHT. The following formula gives the result 214. Try it with your other values to see if it is correct.
int checksum = (speed & 0xE0) | ((direction & 0xE0) >> 3) | ((maxSpeedVal & 0x80) >> 6);

Byte 3:
bit 6: Speed pot reading LSb
bits 5-3: Joystick speed reading (3 LSbs)
bits 2-0: Joystick direction reading (3 LSbs)
User avatar
snaker
 
Posts: 1193
Joined: 23 May 2015, 10:45
Location: Vietnam

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 10:56

Byte 0: Joystick speed reading (7 MSbs)
Byte 1: Joystick direction reading (7 MSbs)
Byte 2: Speed pot reading (7 MSbs)
Byte 3:
bit 6: Speed pot reading LSb
bits 5-3: Joystick speed reading (3 LSbs)
bits 2-0: Joystick direction reading (3 LSbs)
Byte 4:
bit 6: Joystick Error (indicates joystick mirror fault or some such problem when set).
bit 5: Speed pot Error (indicates out-of range error or some such problem when set).
bit 4: Local fault (such as CPU fault) (set when there is a fault)
bit 3: Battery charger inhibit state (set when inhibit is active)
bit 2: Power switch state (all bits in this byte are 1 for active, 0 for inactive).
bit 1: Horn switch state ( set when switch is pressed)
bit 0: Lock switch state ( set when switch is pressed)
Byte 5:
bit 6: Hazard light request
bit 5: Left Indicator request
bit 4: Right Indicator request
bit 3: Remote Inhibit. When this bit is 1, the SPM shall not drive.
bit 2: Programmer Comms flow control. Set when SPM MAY send HHP packets, clear when buffer space is low.
bit 1: Joystick Calibration active ( set when JC mode is active )
bit 0 : Power down / Sleep mode confirmation. Set when Sleep or Power down has been requested and the SR is
ready to comply.
Byte 6:
bit 6: Not used
bit 5: Local non-critical fault (causes "limp" mode)
bit 4: Headlight request
bits 3-0: Operating mode, defined as
00 Drive mode
01 Actuator 1 mode
02 Actuator 2 mode
03 Actuator 1+2 mode
04-0F currently undefined
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 11:22

snaker wrote:The following formula gives the result 214. Try it with your other values to see if it is correct.
int checksum = (speed & 0xE0) | ((direction & 0xE0) >> 3) | ((maxSpeedVal & 0x80) >> 6);


Returns
result_desired.png
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 03 May 2020, 11:29

Testing with the power chair definitely shows that i need to do some on chair programming of some sort... as when i remove the MK6i Joystick and attach the Shark Joystick (Invacare refer to it as a SPJ+)

The power chair with the Shark Joystick, reacts as tho its in limp mode.

This included me testing the MK6i in a mode (1-4) then swapping to a SPJ+ testing then back to the MK6i and the next mode, until i had tested in all four modes.

I'm reading manuals at the moment to see what i need to do to Remove a MK6i and use a SPJ+ (Dynamic Shark Joystick)

...then when i jump that hurdle, ill go back to the emulator ... it may turn out to not need any tweaking.
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby Irving » 03 May 2020, 16:40

gcebiker wrote:Byte 0: Joystick speed reading (7 MSbs)
Byte 1: Joystick direction reading (7 MSbs)
Byte 2: Speed pot reading (7 MSbs)
Byte 3:
bit 6: Speed pot reading LSb
bits 5-3: Joystick speed reading (3 LSbs)
bits 2-0: Joystick direction reading (3 LSbs)
Byte 4:
bit 6: Joystick Error (indicates joystick mirror fault or some such problem when set).
bit 5: Speed pot Error (indicates out-of range error or some such problem when set).
bit 4: Local fault (such as CPU fault) (set when there is a fault)
bit 3: Battery charger inhibit state (set when inhibit is active)
bit 2: Power switch state (all bits in this byte are 1 for active, 0 for inactive).
bit 1: Horn switch state ( set when switch is pressed)
bit 0: Lock switch state ( set when switch is pressed)
Byte 5:
bit 6: Hazard light request
bit 5: Left Indicator request
bit 4: Right Indicator request
bit 3: Remote Inhibit. When this bit is 1, the SPM shall not drive.
bit 2: Programmer Comms flow control. Set when SPM MAY send HHP packets, clear when buffer space is low.
bit 1: Joystick Calibration active ( set when JC mode is active )
bit 0 : Power down / Sleep mode confirmation. Set when Sleep or Power down has been requested and the SR is
ready to comply.
Byte 6:
bit 6: Not used
bit 5: Local non-critical fault (causes "limp" mode)
bit 4: Headlight request
bits 3-0: Operating mode, defined as
00 Drive mode
01 Actuator 1 mode
02 Actuator 2 mode
03 Actuator 1+2 mode
04-0F currently undefined


I'm wondering now if you're misunderstanding the meaning of the description of byte 0-4.

The way I'm reading it is that the Joystick direction and speed are 10bit numbers so are encoded 7MSB in bytes 0 and 1 and the three LSB packed into byte 4, speed pot is an 8 bit number so encode 7MSB in byte 3 and the LSB packed in byte 4. This way all bytes are 7bit and can be transmitted as ASCII. There is no 'checksum' as such in byte 4. Bit 7 is always 0 as basic ASCII is 0 - 127 decimal. This is a very common scheme for encoding used on several systems (non-wheelchair).

Just a thought?
C5/6 A (complete)
Puma 40, 75Ah LiFePO4 (pic is on tour @ Whistler, BC)
Puma 40 backup, 73Ah MK (for now)
Spectra Plus (weedy 40Ah MK)
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby Irving » 03 May 2020, 17:05

So for your test values you are setting speed = 192 and then putting that in byte 0. But byte 0 is defined in code as 0x80 | (speed >> 3), so if speed is 192 then byte 0 = F8 and bits 5-3 of byte 4 = 0

If I work your data capture back, using the above descriptions I get actual 10bit values for speed as varying between 512 - 520 and direction between 517 and 527... i.e a joystick at centre (ish).

That all makes sense then.

Speed is a 10bit number from 0 to 1023, centre = 512, similarly direction. Thats exactly the outputs I get from a commercial digital joystick I use for a CNC machine. And what you'd get from an analog joystick on an Arduino. 2.5v at centre would read as 512 from the ADC.
C5/6 A (complete)
Puma 40, 75Ah LiFePO4 (pic is on tour @ Whistler, BC)
Puma 40 backup, 73Ah MK (for now)
Spectra Plus (weedy 40Ah MK)
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby Irving » 03 May 2020, 18:13

I don't believe there is an issue with the calculation of data[4]. i suspect its something else, maybe the packet checksum?

The checksum calculation is correct for the majority of packets, but in the test data you provided there are 2 extended 'q' packets at lines 978 and 1003 that have extended data after the checksum and a further checksum just before the 15 terminator byte.
C5/6 A (complete)
Puma 40, 75Ah LiFePO4 (pic is on tour @ Whistler, BC)
Puma 40 backup, 73Ah MK (for now)
Spectra Plus (weedy 40Ah MK)
User avatar
Irving
 
Posts: 2114
Joined: 04 Dec 2012, 11:51
Location: NW London

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 04 May 2020, 01:16

Irving wrote:I don't believe there is an issue with the calculation of data[4]. i suspect its something else, maybe the packet checksum?

The checksum calculation is correct for the majority of packets, but in the test data you provided there are 2 extended 'q' packets at lines 978 and 1003 that have extended data after the checksum and a further checksum just before the 15 terminator byte.


They are the packets sent by the Power Module.

I think the issue lies in that some programming needs to be undertaken to swap from a MK6i joystick to a Shark, as the shark i put on the chair only drives it in limp mode regardless of which mode its in.

I had previously thought the Shark Joystick worked with out issue but i did not move it far, for fear of running out of cable or running over my feet.
I moved it at full speed (using the Shark Joystick) and saw that it had quite restrained speed/power.

Wizard 5 comes up with 'unknown power module' error, even after updating the libraries.
I'll install wizard 6 and see how i fare.

Rover if you are about, any ideas on what i need to do Re: swap from MK6i Joystick to a SPJ+ (aka Shark) ?
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby snaker » 04 May 2020, 01:33

I also see the docs only describe 7-bit bytes. But gcebiker's data contains 8-bit bytes. Maybe there is something wrong in the logged data.
User avatar
snaker
 
Posts: 1193
Joined: 23 May 2015, 10:45
Location: Vietnam

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby rollingcowboy » 04 May 2020, 06:35

gcebiker,
I don't mean to throw cold water on -- but you should heed BM' comments on the lack of starting torque using the GB motors.
They may not pull the boat up the ramp. Do you have a way to test the GB to see if it will pull?
rollingcowboy
 
Posts: 347
Joined: 16 Feb 2012, 08:56
Location: Denver, CO

Re: Radio Control - Brushless Gearless (GB) Invacare Powerch

Postby gcebiker » 04 May 2020, 07:34

rollingcowboy wrote:gcebiker,
I don't mean to throw cold water on -- but you should heed BM' comments on the lack of starting torque using the GB motors.
They may not pull the boat up the ramp. Do you have a way to test the GB to see if it will pull?


A fair question, yup they will be awesome for the job at hand.

I volunteer at Sailability Gold Coast, and at the boat ramp there (which is much steeper than the one i will use).
I drove to the bottom and had no issue taking off.
I was 127kg at the time :)

The bigger issue i have with the power base used in the above videos is that with the smaller batteries, there is not enough weight over the wheels.
When at the steep Kayak ramp, I get off it to launch the boat it starts sliding down the ramp.

It's one of the reasons I will be using a different boat ramp and a chair with much heavier batteries.
http://greenmobility.com.au/rc-wheelchair-controller/
My YouTube Ch -- https://www.youtube.com/user/gcebiker
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Next

Return to Everything Powerchair

Who is online

Users browsing this forum: No registered users and 158 guests

 

  eXTReMe Tracker