Arduino controlled wheelchair

Power wheelchair board for REAL info!

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

Re: Arduino controlled wheelchair

Postby gcebiker » 10 Sep 2015, 14:48

Its been a crazy few weeks here, decoding the chair i am sitting in has not been working out to well...

...doh just figured out i can disengage the wheels and do some full forward/reverse captures (instead of the tiny joystick movements at the desk..)
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 22 Sep 2015, 00:51

Ill be sampling a known and already decoded Wii Nunchuck today so that i can try to better learn the tool i am attempting to use.

Sampling:
Joystick 'Dynamic - Shark' , Motor Driver 'DKPM05' Shark Wheelchair Controller
Using the 'Modbus' setting in the https://www.saleae.com/ Logic 4 i am at least NOT getting framing errors.

SPR bus is printed on circuit board, i don't know meaning of this to try the right settings on the Logic4, maybe 'Scratch Pad Register' ?

Which would kind of make sense as the Joystick's software setting would need to be referenced to then output the required signal to the motor driver.

To try and remove the software data, i have been sampling ; stopped, after gets to full speed, not on the ramp up as no consistent values.
(looking at buying Jazzy GT controller just to see if i am even getting the right data as Doug, perhaps i need the Logic16's higher sample rate as Doug said earlier in this thread) - These are mostly notes to myself as much as they are sharing the progress/lack of.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 22 Sep 2015, 02:13

rereading http://gizmosmith.com/?paged=2

Using settings he used to decode with same (i hope) version of logic sniffer.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 22 Sep 2015, 02:59

One small hurdle achieved, i feel like my heads going to explode but dumb luck will get you a lot of places...

Inverting the read signal was the bit i was missing it seems.

Settings for Saleae Logic 4
Image

Snippet of Power on Capture, same as Gizmosmiths (well slightly different owing to the settings of Wizard Software i think)
Code: Select all
Time [s]    Analyzer Name    Decoded Protocol Result
0.028954833   Async Serial   '0' (framing error)
0.332185917   Async Serial   t
0.332471917   Async Serial   '130'
0.332757917   Async Serial   '133'
0.333043917   Async Serial   '130'
0.333329917   Async Serial   '128'
0.333615917   Async Serial   '136'
0.333901833   Async Serial   '205'
0.334187833   Async Serial   '160'
0.334473833   Async Serial   '128'
0.334759833   Async Serial   '141'
0.335045833   Async Serial   '15'
0.337132833   Async Serial   '5'
0.337414417   Async Serial   '128'
0.337695917   Async Serial   '250'
0.339231667   Async Serial   '15'
0.35215375   Async Serial   `
0.352439667   Async Serial   '191'
0.352725667   Async Serial   '191'
0.353011667   Async Serial   '255'
0.353297667   Async Serial   '223'
0.353583667   Async Serial   '128'
0.353869667   Async Serial   '140'
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 22 Sep 2015, 04:04

Also captures at baud of 38400, as Doug is able to communicate with his Jazzy Select GT, ill stick with this baud rate for now.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 23 Sep 2015, 10:33

For anyone better at coding than i am at walking... :?

Here is a copy of the Saleae Logic4 data capture.

Async analyzer, 38400, inverted - i used these settings.

its the same Data that GizmoSmith on his blog but this is the raw data for anyone interested.
sailabilitygc.org/download/Dynamic%20Shark%20controller_on_capture.zip

Seems like once its gone thru the boot up sequence settles into a string of
Ascii , Hex , Text Notes
` (0x60) Address ?
192 (0xC0) Y axis data
192 (0xC0) X axis data
255 (0xFF) Speed max setting (Turtle/Hare speed button on the shark)
192 (0xC0) Speed fine tune ?
128 (0x80) Horn off/ 130on
140 (0x8C) Joystick on ?
128 (0x80) Chair mode (128drive/129tilt)
212 (0xD4) Some other XY modifier ?
15 (0x0F) End packet


I seem to be having a blond night, i'd intended to write short arduino sketch to play the above data packet over and over with 17.16ms pause between each packet.
ie read A0/A1 pot values and modify the first two values only , leaving the rest alone just as a test to see what happens.
anyone good at coding want to have a crack at it ?
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 23 Sep 2015, 14:31

4 seconds at 38400 is a lot of stuff to manually type out...

This is where i am up to

Its pretty basic what i want to do as a first step...get the chair to respond to a little spark fun thumb joystick connected to A0/A1
A power on button to initiate the 'power on' sequence

I am pretty sure my code is not written right...used the wrong words/structure, if any pointers please let me know.
I am posting this here instead of the Arduino forums to save double posting.


Code: Select all
pinMode(JSIGPIN, OUTPUT);
     
     
     // Dynamic Shark initialization sequence
     // Bytes starting with (0x60) are Joystick in put data
     // Bytes starting with (0x74) are initialization packets
     // (0x0F) is the end packet notification, delays mostly 10ms till Joy has ( booted up ? 3.3seconds)
     // then settles to a delay of 17.16ms
     
      digitalWrite (JSIGPIN,HIGH);    // Power button pressed On (from off state)
      delayMicroseconds(293000);
      digitalWrite (JSIGPIN,LOW);
      delayMicroseconds(10.28);
     
      // Fist packet of data sent from Joystick
      Serial.write((0x74),(0x82),(0x85),(0x82),(0x80),(0x88),(0xCD),(0xA0),(0x80),(0x8D),(0x0F));
      delayMicroseconds(1.527);
      Serial.write((0x05),(0x80),(0xFA));
      delayMicroseconds(1.406);
      Serial.write(0x0F);
     
      // delay till next group of data
      delayMicroseconds(13.04);
     
      // Second group of data
      // Appears to be Joystick raw data reads/reads after interpretation by Wizard Software settings
      Serial.write((0x60), (0xC0), (0xBF), (0xFF), (0xCD), (0x80), (0x8C), (0x80), (0xC8), (0x0F));
      delayMicroseconds(2.32);
     
      // Third group of data
      // Inhibit files ? till joystick has booted up fully ?
      // All inhibit bytes start with (0x61) and stop after 3.3seconds
      Serial.write((0x61), (0x80), (0x80), (0xC0), (0x80), (0x80), (0x80), (0x80), (0xDE));
      delayMicroseconds(.7155)
     
      // End bits are (0x0F)
      Serial.write(0x0F)
       
       // now a cycle of Joystick (0x060), inhibit/raw/controller values (0x61) continues till 3.3seconds
       // Then a steady stream of Joystick data with 17.16ms delay between bytes of data.
       // Start bit, 8 data bits, End Bit
       // Start bit (0x60)   Address ?
       // Bit 1 (0xC0)   Y axis data
       // Bit 2 (0xC0)   X axis data
       // Bit 3 (0xFF)   Speed max setting
       // Bit 4 (0xC0)   Speed fine tune ?
       // Bit 5 (0x80)   Horn off/ 130on
       // Bit 6 (0x8C)   Joystick on ?
       // Bit 7 (0x80)   Chair mode (128drive/129tilt)
       // Bit 8 (0xD4)   Some other XY modifier ?
       // End Bit (0x0F)   End packet

       // is 3.3 seconds of data packets necessary ?
       // would not a "if bit 1 <>='192'(0xC0)" then inhibit enable ? surfice
       
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby LROBBINS » 23 Sep 2015, 19:05

Just a quick glance, and yes there are some problems with your code:

You haven't told the MCU which pin is JSIGPIN. You need a #define JSIGPIN somepinnumber

Every Arduino program needs a setup procedure and a loop procedure (the loop can be empty if you just want your code to run once, but it does need to be there). If you are using the latest Arduino compiler (1.6.x) and tell it to create a "new" program, you will get a sketch with that structure already there (in the 1.0.x compiler it was just a blank sketch). ["Loop" takes the place of the "Main" procedure in non Arduino dialects of C and C++]

There is no numeric coprocessor in these, but you have lots of real numbers in your code. You can make it do real-number arithmetic (slowly and with lots of overhead), but you can't do delayMicroseconds (a real number). You have to figure out a way to do things with only integers.

If you want to have lots of numbers saved, consider learning how to use PROGMEM for that - there's a lot more flash than static RAM available. In any case, I think it would be better to have your data in an array and use ArrayName[index] to load and write them. Serial.write can take only a single argument, so a bunch of values separated by commas will not work. Either you have to write an awful lot of Serial.write lines, or use something like a for loop to go through an array of values.

Ciao,
Lenny
LROBBINS
 
Posts: 5790
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Arduino controlled wheelchair

Postby gcebiker » 24 Sep 2015, 00:38

Above code is just small snippet out of DougL's Jazzy GT code (partial rewrite).

I ,once i am able to test the sections, would like to get a series of .h files for each type of controller (i have a New Qlogic and a Dynamic Shark motor controller)
Similar to what has been written for the Nintendo Wii Nunchuck.

Makes the main code a lot cleaner,

I dont know how the format to write a byte of data to Serial (the port is defined but not posted in that snippet).
I am hoping someone has a link to how to a tutorial (as i for the life of me have not found one yet, i think i am using the wrong words to search for it...)

Some of those hard coded delayMicroseconds values will need to be taken out/modified, they are just a straight copy from the Logic4 and don't take into account the inherent processing time delays in code.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby LROBBINS » 24 Sep 2015, 01:15

You can send a byte with serial.Write (positive number <= 254 in any base notation you want). Instead of delayMicroseconds (which must be an integer), what you really may want to be doing is sending null characters. In this compiler null = 0 (and that's most often the case) so serial.Write (0) is OK, but you can also sent it as the literal null character, serial.Write ('\0') as a reminder that you're thinking of this as null rather than a numeric value of 0.
Ciao,
Lenny
LROBBINS
 
Posts: 5790
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Arduino controlled wheelchair

Postby gcebiker » 24 Sep 2015, 14:09

I am thinking i probably should shoot over to the Arduino forums for some coding help, tho i guess there are some coding guru's lurking about here too.

here is the next rewrite for anyone interested, don't worry about the massive errors in the code
its just to show where i am trying to head (if you are a code head..which i am not..who would have guessed hey :o )

I am SUPER aware that this will run the initialization sequence on power up and immediately start outputting to serial (well i hope it will)

I am going to hook the Arduino up the Logic4 for testing
... not the power chair itself,
i want to see the wave forms match or how far they vary from each other and tweak it.

Code: Select all
#define INHPIN  11  // well its not used for testing this code as yet but will need inhibit at some point
#define JSIGPIN 1   // TX pin
#define LEDPIN  13  // Other output pin to connect to Jazzy line that pulses 255 all the time ?
#define pwrBtn  7  // On/Off button Digital Pin 4, has internal pull up resistor ? or was that pull down ?

unsigned char data[10];
unsigned long timer = 0;
int Ypin = A0;
int Xpin = A1;
int YpinValue;
int XpinValue;
int startYvalue = 192;
int startXvalue = 192;


void setup() {
 
 

  // Dynamic Shark initialization sequence
  // Bytes starting with (0x60) are Joystick in put data
  // Bytes starting with (0x74) are initialization packets
  // (0x0F) is the end packet notification, delays mostly 10ms till Joy has ( booted up ? 3.3seconds)
  // then settles to a delay of 17.16ms
Serial.begin(38400, SERIAL_8E1);

  digitalWrite (JSIGPIN, HIGH);   // Power button pressed On (from off state)
  delay(293);
  digitalWrite (JSIGPIN, LOW);
  delay(10);

  // Fist packet of data sent from Joystick
  Serial.write((0x74), (0x82), (0x85), (0x82), (0x80), (0x88), (0xCD), (0xA0), (0x80), (0x8D), (0x0F));
  delay(1);
  Serial.write((0x05), (0x80), (0xFA));
  delay(1);
  Serial.write(0x0F);

  // delay till next group of data
  delay(1);

  // Second group of data
  // Appears to be Joystick raw data reads/reads after interpretation by Wizard Software settings
  Serial.write((0x60), (0xC0), (0xBF), (0xFF), (0xCD), (0x80), (0x8C), (0x80), (0xC8), (0x0F));
  delay(2);

  // Third group of data
  // Inhibit files ? till joystick has booted up fully ?
  // All inhibit bytes start with (0x61) and stop after 3.3seconds
  Serial.write((0x61), (0x80), (0x80), (0xC0), (0x80), (0x80), (0x80), (0x80), (0xDE));
  delay(0)

  // End bits are (0x0F)
  Serial.write(0x0F)

  // now a cycle of Joystick (0x060), inhibit/raw/controller values (0x61) continues till 3.3seconds
  // Then a steady stream of Joystick data with 17.16ms delay between bytes of data.
  // Start bit, 8 data bits, End Bit
  // Start bit " ' "(0x60)   Address ?
  // Bit 1 "192"(0xC0)   Y axis data
  // Bit 2 "192"(0xC0)   X axis data
  // Bit 3 "255"(0xFF)   Speed max setting
  // Bit 4 "192"(0xC0)   Speed fine tune ?
  // Bit 5 "128"(0x80)   Horn off/ 130on
  // Bit 6 "140"(0x8C)   Joystick on ?
  // Bit 7 "128"(0x80)   Chair mode (128drive/129tilt)
  // Bit 8 "212"(0xD4)   Some other XY modifier ?
  // End Bit "15"(0x0F)   End packet

  // is 3.2 seconds of data packets necessary ?
  // would not a "if bit 1 <>='192'(0xC0)" then inhibit enable ? suffice

}

pinMode(pwrBtn, INPUT_PULLUP);
pinMode(LEDPIN, OUTPUT);
pinMode(INHPIN, OUTPUT);



void loop() {
  //read the value from the Y axis on port A0
  YpinValue = analogRead(Ypin);

  //read the value from the X axis on Port A1
  XpinValue = analogRead(Xpin);

  ///build serial packet
          data[0]= (0x60);    // Joystick packets start with this " ' " not accepted had to use hex
          data[1]= YpinValue; // Joystick Y value     
          data[2]= XpinValue; // Joystick X value
          data[3]= 255;       // Max speed setting via turtle/hare buttons on joystick
          data[4]= 192;       // Speed Fine Tune ?
          data[5]= 128;      // default horn off, horn on value is 130
          data[6]= 140;      // joystick On Value ?
          data[7]= 128;      // chair mode/ drive 128, tilt/aux output 129
          data[8]= 212;      // some other XY modifier..maybe acceleration/de settings
          data[9]= 15;        // all packets end with this identifier     
          data[10]=0xff-(data[0]+data[1]+data[2]+data[3]+data[4]);    //-Check sum
        for(unsigned char i=0;i<11;i++);
  Serial.write(data[i]);
                //


}
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby LROBBINS » 24 Sep 2015, 20:16

I think you're right in thinking that the Arduino forum is a better place to go for help with this. You will have to explain what you are trying to do, and then, if you want to post code you know can't work do make sure to say that it is a sort of pseudocode, or put it in proper Arduino syntax first.
Ciao,
Lenny
LROBBINS
 
Posts: 5790
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Arduino controlled wheelchair

Postby gcebiker » 25 Sep 2015, 02:47

Going to learn how to write library files.

I hope, once learning the Shark Controller to then move onto other power chair controllers and do Libraries for each.
So i may as well start learning now.

Its going to make the code a lot easier to read at the very least.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 28 Sep 2015, 16:46

I think i have gotten over the coding hump that i have been stuck on for a few days.

This is a picture of the emulated wave form, its nearly perfect compared to the original, now for a little tweaking.

I am thinking now to just put the Arduino inline with the Master Joystick and modify the values with relation to distance from objects.
(...I've got to get it working first hey...lol)

I think one of the easiest and least controlling ways would be to use the fourth Byte (the master speed dial / turtle / hare button) to turn down the max speed as an object was approached, till it reached to close.

Ill have to allow room for when the castor swivels side to side or reversing would still wipe out the skirting on a wall.

Using the factory joy will at least leave all the safety, charging and other benefits it has.
Fortunately Ive an OEM programmer and mine works exactly as suits me.

A big shout out and thank you to Doug, I did not completely understand your array sections but once i understood that it all be came clear.
That and needing Software Serial.h (myRX, myTX, true) to invert the data signal (to match the factory Shark Joystick)
Rather than using the Hardware Serial port.

I think understanding this may make it possible for me to even get the Wii and the Serial output on the one Arduino working...dam i am excited !
Image
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 30 Sep 2015, 15:27

Doug, i think i jumped the gun yesterday, test code was incomplete /doh forgot to map inputs and properly define the integers.

..so much to learn, so ...much time ? :ugeek:

For the original poster of this thread, and anyone else tagging along.
Here is the current build of the test code, comes out correctly on the Logic4.

Many many other packets are missing, this is just to test wiring and digital output on the Logic Analyzer.

..i wish there was a spell checker in the Arduino IDE.

Code: Select all
// This sketch is to emulate the packet of data that the Shark Joystick sends
/******************************************************************************
    * Author: Tony Matthews ammatthews at gmail dot com
    * License: FreeBSD
    ******************************************************************************/
/******************************************************************************
Copyright (c) 2015, Tony Matthews
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.

*******************************************************************************/

// This code is incomplete and still under revision.
// Its also got junk that may not be needed,
// Early testing phases.
// Successful output of Data packet for Shark Wheelchair controller.
// Not tested on chair, just on the Logic Analyzer.
// Pulse at one second for testing, chair sends pulse every 17ish microseconds

#include <SoftwareSerial.h>

#define rxPin 10      // Digital Pin10 for Receive from controller.
// this will have to be changed for the GCDuiNode as it uses this pin to communicate with the RF24

#define txPin 11      // Digital Pin11 Transmit from Shark Joystick to Controller.

// int sharkDataInt [10];    //Declare size of data packet sent from Shark Joystick
int joyStartByte;    //  was/is to setup/call function from new "void sharkJoyInt" .h file yet to be written.

// Names for Pins and what they are connected to
const int yPot = A0;    // Y Pot input value
const int xPot = A1;    // X Pot input value

// not used yet but will be one day...not that i ever dial my chair down...what's the point of going slow :P
int maxPot = A2;      // Max speed dial pot


// Names for analogRead values of Analog Pots
int yPotVal;
int xPotVal;
int maxSpeedVal;

// Names for Mapped analogRead Values of Pots
int yPotValMapped;
int xPotValMapped;


// Size of data packet, tho the packets are not constrained to this size.
// This size for this packet but probably not for others.
unsigned char data[10];
unsigned long timer = 0;

// set up a new serial port
SoftwareSerial sharkSerial (rxPin, txPin, true);    // TRUE sets this to invert software serial output.


void setup()  {
  // define pin modes for tx, rx:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);

  // set the data rate for the SoftwareSerial port
  sharkSerial.begin(38400);
}
void loop() {
  // the brackets above and below are for the packet of data
  // below is the packet of data i would like to test there are notes next to what the
  // current thinking is as to the function of each piece of data
  // Logic4 Async serial inverted logic sniffer is attached to pins
  //  RX and TX on Arduino Nano V3.0
  {
    yPotVal = analogRead(yPot);
    xPotVal = analogRead(xPot);
    yPotValMapped = map(yPotVal, 0, 1023, 128, 255); // Map min/max pot values to match min/max original Shark joystick values.
    xPotValMapped = map(xPotVal, 0, 1012, 128, 255); // Map X values
  }
  {
    //build serial packet
    data[0] = (0x60);   // Joystik packets start with this " ' " not accepted had to use hex
    data[1] = yPotValMapped; // Joystick Y value
    data[2] = xPotValMapped; // Joystick X value
    data[3] = 255;      // Max speed setting via turtle/hare buttons on joystick
    data[4] = 192;      // Speed Fine Tune ?
    data[5] = 128;     // default horn off, horn on value is 130
    data[6] = 140;     // joystick On Value ?
    data[7] = 128;     // chair mode/ drive 128, tilt/aux output 129
    data[8] = 212;     // some other XY modifier..maybe acceleration/de settings
    data[9] = 15;       // all packets end with this identifier

    for (unsigned char i = 0; i < 10; i++)
    {
      sharkSerial.write(data[i]);

    }
  }

  delayMicroseconds(1716);    //Delay next packet 17ms input from Shark joystick

}

User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 01 Oct 2015, 01:54

On chair testing of Logic 4 of above code

No response from motor controller - Both Original and Emulator are joined at same time.

Only one powered on at a time, Emulator not sending packets correctly...nearly but first two bytes get framing errors.
(found problem....i forgot to ground the Logic4 to the emulator /slaps self in head), transmitting " ' " correctly

-- With Joystick and emulator both powered, Chair motor controller only responds after the 't' packet is sent...which is the factory on signal..so no surprise there.

Ill now rewrite the code to send the 't' packet and see if i get correct Async response from Shark Motor controller..

Image
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 01 Oct 2015, 03:12

Rewrote code, emulator sending the "t" packets.

Getting this return...just a reflection of same, and RX line is Low from start not high as it should be

Image



Below is the Logic Capture i am trying to replicate (TX from Joystick is CH3, RX CH2)
Notice that RX is High, "spiking" (because its an inverted signal), to low on the trailing edge of each High.

Anyone with any ideas as to reason for this ?

Image
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 01 Oct 2015, 14:52

Hi Brendan,

For people that dont know Brendan, he's a freakin awesome guy.

Brendan, this is ONE of the forums i am posting my work on for ADDING control to Power wheelchairs.
Yeah the QLogic is crap, everyone that has one knows its's over controlled.

The chair makes it appear you are more fucked up than you are.
Hell knows its bad enough to be trapped in your own brain.

Mad worse for a 'Qualified' person to recommend a chair that exacerbates your own internal issues...
Is not tech, not to make your life an order of magnitude easier ?

WE are PEOPLE inside, trapped in an electric chair by people that DO NOT UNDERSTAND.
WE DO NOT NEED CONTROL, we need interpretation...and the line is crossed with the Qlogic, myself and Brendan and countless others were stranded with.

A chair that takes your input and puts you into a Door frame.
Skinning your Knuckles as it goes,

Dynamic, your control...is over control.
Take out the LAG, give real input in real time.

EVEN the most brain injured of us, deserve a level playing field.

If our brains are slow, don't slow them more by shackles of code !

I RIPPED your guts out of my chair, what an over priced piece of crap programming.
The electrics are OK, i replaced them with the Dynamic Shark...

Don't Shackle your consumers,
We have a voice now wheelchairdriver.com , i just wish more of the disabled voices out there knew about it.

Power Chair People take notice.
The time of supply of goods, made by the able for the disabled.
IS OVER, future profits, come from taking NOTICE NOW.

Listen to your consumers.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby Burgerman » 01 Oct 2015, 15:00

You realise that this:

QLogic is crap, everyone that has one knows its's over controlled.


Much like every controller, is simply due to adding turn acc and low speed turn acc, and turn dec and low speed turn dec, to every system on every chair as a default setting?

An OEM level programmer allows you to set these 4 settings to 100 instead and remove all this crap, and get full control back dont you? :?
User avatar
Burgerman
Site Admin
 
Posts: 70265
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Arduino controlled wheelchair

Postby gcebiker » 03 Oct 2015, 14:17

,,,not so good at two things at once am i, i think i've the parts in the shed Brendan, ill see what i can do.

I'm really keen to go fishing independently ! (in a boat, somewhere i have half a chance), wife's out of squid for dinner :P
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 03 Oct 2015, 14:44

Thread for Qlogic is here viewtopic.php?f=2&t=2757 , also known as Curtis Controller OEM programmer.

I have the parts to do as Woody has posted on page 2 of the thread.
I've the software....

I can try it out, but it will mean.
Rewire of the chair i am sitting in... I'm not so keen on that.
Meh , i ll just use the Ezyrider to get to the toilet.

But winners are grinners and it its grand final weekend :)

Sunday is rewire day, if all goes well i will bring a laptop Tuesday...you will need time to get used to the chair responding correctly after so many years with it.
Ill back up old program first (if i get it sorted on Sunday).

Shit while i am at it , i may as well see if i can fit the reclining race seat i have in the shed to the Power Base.
damit, its midnight, im drunk and posting again when i should be coding.

Drunk + Coding actually works out pretty well it turns out....just read all the 'coherent' posts above
....Brain Damage is freakin weird. 11 Years this year, I'm still not used to it.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby woodygb » 03 Oct 2015, 18:01

gcebiker wrote:Thread for Qlogic is here viewtopic.php?f=2&t=2757 , also known as Curtis Controller OEM programmer.

I have the parts to do as Woody has posted on page 2 of the thread.
I've the software....

I can try it out, but it will mean.
Rewire of the chair i am sitting in... I'm not so keen on that.
Meh , i ll just use the Ezyrider to get to the toilet.

But winners are grinners and it its grand final weekend :)

Sunday is rewire day, if all goes well i will bring a laptop Tuesday...you will need time to get used to the chair responding correctly after so many years with it.
Ill back up old program first (if i get it sorted on Sunday).

Shit while i am at it , i may as well see if i can fit the reclining race seat i have in the shed to the Power Base.
damit, its midnight, im drunk and posting again when i should be coding.

Drunk + Coding actually works out pretty well it turns out....just read all the 'coherent' posts above
....Brain Damage is freakin weird. 11 Years this year, I'm still not used to it.


No need for a rewire .
You can sort out the Qlogic's communication part of the programming on the bench ... all you should need is the joystick pod connected to the control module and a 24v supply.

You seem to be under the impression that using the Arduino as an input rather than the joystick will override / take out the delays etc ... well it depends where the programming of delays etc resides.
PGDT and Curtis have their "brains" in the control modules thus altering the input from the joystick will have NO effect on any delays etc.

Cheers Woody
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby gcebiker » 07 Oct 2015, 15:23

You seem to be under the impression that using the Arduino as an input rather than the joystick will override / take out the delays etc ... well it depends where the programming of delays etc resides.


Na, just got a few things in the air at once.

QLogic controller - Follow Burgerman's advice - in progress
Shark Joystick controller - emulator. - in progress
Shark Joystick inline signal modifier - awaiting parts
Radio Control of said shark chair so i can make a dinghy trailer i can park / retrieve from the waters edge - awaiting results on above items.
Robot / RC fishing / squid fishing floating thing with remote sonar - gathering parts (very very cool boat here, http://lainefamily.com/RCFishingMachine.html)
Build 4.2v solar/wind charger for the drill to power the reel/motors on the fishing boat - got the bits doing static testing.

As Doug is the only one that i know of in the world that has hacked the ASII data ..successfully (rather than the individual pot lines).
Its all to be discovered and i'm having a great time learning as i go.
(yes i and Gizmosmith are/were/will be/did (depends on which time line you are reading this in...))

I hope the other people that are interested in this thread may share their work and we can all bounce off each other and progress our learning together.

Logic4 is a very cool bit of kit
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby Burgerman » 07 Oct 2015, 15:48

Very impressive stuff. You could have used a slightly better transmitter though that already does all that motor mixing etc. Via many free mixers, V tail or elevon mixing, etc. Save a lot of work?
User avatar
Burgerman
Site Admin
 
Posts: 70265
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Arduino controlled wheelchair

Postby gcebiker » 08 Oct 2015, 00:22

Thats not my boat, i wish i had his tool shed tho.... my projects are over on this page, http://sailabilitygc.org/category/projects/
Full code is there, mostly its other peoples that i have tweaked to suit.

This is the first time for me coding a full script from scratch.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 08 Oct 2015, 07:35

Soft wired QLogic controller/motor driver - per Woody's suggestion ,
Set all Turn variables to 100% - per Burgerman's suggestion.
...waiting for 'FastnFurious' to come back from holidays

This is not the Arduino Project part, this is another project that may turn into an arduino project.
Image

Image

Image

Image

Image
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby woodygb » 08 Oct 2015, 08:54

The Curtis appears to use the same joystick as Penny and Giles... ( see pic below )...could you please see if it has any identifying marks so that I can confirm this.
Image

http://www.cw-industrialgroup.com/getat ... 0_jun07(EN)

Cheers Woody
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby gcebiker » 08 Oct 2015, 09:08

Its reassembled and in the shed..which is outside in the rain (no internal access)

Ill take it appart again tomorrow. But from your pictures it has the top of the one on the right and the bottom of the one on the left....
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby gcebiker » 08 Oct 2015, 11:42

Just opened it up again, its a JC2000.
User avatar
gcebiker
 
Posts: 879
Joined: 11 Jul 2015, 14:20
Location: Gold Coast, Queensland, Australia.

Re: Arduino controlled wheelchair

Postby woodygb » 08 Oct 2015, 12:10

Thank you very much ... my current B.T or R/C interface should plug straight in ...assuming that the joystick voltage swings etc are the same.

IF you get time I'd very much like a voltage read out of the pins ...

NOTE if you measure voltages at the board , that the connecting ribbon may have the plugs crimped to opposite sides thus transposing the numbering system.

The Joystick pin 1 is board pin 7 which is 5v
2 is 8 L/R OUTPUT 1
3 is 5 GND 0V
4 is 6 FORE/AFT OUTPUT 1
5 is 3 FORE/AFT OUTPUT 2
6 is 4 Vs/2 2.5v
7 is 1 L/R OUTPUT 2
and 8 is 2 Not connected
User avatar
woodygb
 
Posts: 7128
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

PreviousNext

Return to Everything Powerchair

Who is online

Users browsing this forum: Bing [Bot], ricardoh, tettralytic, Yennek and 92 guests

 

  eXTReMe Tracker