Arduino controlled wheelchair

Power wheelchair board for REAL info!

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

Arduino controlled wheelchair

Postby jcka22 » 16 Feb 2015, 21:06

Hi,

I am new to this forum. I am looking to interface an Arduino board into an electric wheelchair. I found a little information on this site but couldn't find any information on actually setting this up and getting it working.

I'm not sure the brand of chair but it uses a Shark power module and control system. I know these chairs have a ton of safety features which makes it difficult to do projects like this.

Is it possible to keep the existing wheelchair circuit boards and somehow use an Arduino to control the wheelchair? Or would it be easier to just scrap all the control boards and start from scratch, keeping just the motors and batteries of the chair?

Any advice would be much appreciated !

Thanks,

Jack
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby woodygb » 16 Feb 2015, 21:53

You should use the Arduino to produce a voltage swing that replicates the existing joysticks outputs ...then use it in tandem with the existing joystick or simply replace the joystick with the Arduino.
User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby jcka22 » 16 Feb 2015, 22:56

Thanks for the reply. That is certainly what I want to do, my issue is how exactly to do it. Specifically, where should I interface the Arduino with the joystick? The joystick controller uses CAN to communicate to the wheelchair, will that be a problem?

I've attached a picture of the joystick taken apart.



Thanks!


Jack
Attachments
IMG_3766 (1).JPG
IMG_3766 (1).JPG (95.57 KiB) Viewed 33294 times
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby woodygb » 16 Feb 2015, 23:51

The joystick is a simple analogue device that produces a voltage swing.... the board converts that voltage into a CAN signal.

Measure the voltages of the white wires.
User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby woodygb » 16 Feb 2015, 23:56

I have the following specs on A Dynamic joystick.

Dynamic controls motor controller
The input to the motor controllers is a 4-pin connector which carries power (direct battery connection) and a modified CAN bus called DXBUS.
The joystick unit which plugs into it has an inductive joystick which is good quality. It produces a variable voltage between 0.7V-4.4V. The white and blue wires both produce the same voltage, for one axis, and the yellow and brown wires both represent the other axis.
This plugs into a 7-pin connector on the control board in the joystick module. The pins, reading away from the joystick, are white, blue, brown, yellow, not connected, black (0V) and red (+5v).
User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby woodygb » 17 Feb 2015, 00:24

woodygb wrote:The joystick is a simple analogue device that produces a voltage swing.... the board converts that voltage into a CAN signal.

Measure the voltages of the white wires.


I'm ASSUMING that the white wires come from the Joystick ...your picture isn't clear enough for me to see.
User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby jcka22 » 17 Feb 2015, 00:29

Thanks woody! I did what you said and measured the voltages. They are all roughly 5V (4.69-4.98V) besides pin 4, which is labeled "SCK" which is approximately 0.2 V. What's odd though, is that none of the voltages change when I engage the joystick in any direction. Any clue on what my next step should be?


Thanks,

Jack
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby jcka22 » 17 Feb 2015, 00:45

Here are some more pictures to try and help
Attachments
IMG_3772.JPG
IMG_3772.JPG (55.48 KiB) Viewed 33280 times
IMG_3771.JPG
IMG_3771.JPG (53.36 KiB) Viewed 33280 times
IMG_3769.JPG
IMG_3769.JPG (52.25 KiB) Viewed 33280 times
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby LROBBINS » 17 Feb 2015, 09:23

From the last photo it's clear that the white wires are NOT coming from the joystick. You need to find the wires that go from the joystick pot to the board. I've never touched a Shark, and that pot is certainly different from the ones used in the DX Attendant Control Unit or larger DX remotes - it looks like a newer design. If, however, they followed the same basic scheme as in other Dynamic products each axis will have two outputs. BUT, they are not simply two wires connected together at either end. There are actually two independent outputs that track each other - if they ever fail to have close to identical outputs, the processor knows that something has failed in the joystick. If that's the case, your Arduino will have to also provide two outputs per axis (i.e. two digipot outputs per axis, or some way to split a single output into two isolated lines of the right impedance). In any case, the first thing you need to do is find those wires and measure the voltages on them.
Ciao,
Lenny
'
LROBBINS
 
Posts: 5543
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Arduino controlled wheelchair

Postby Burgerman » 17 Feb 2015, 11:22

They are usually mirrored on the old joysticks I have here. So when one goes plus, the other goes minus on each channel. And there is often a centre reference comparison voltage too. So it will be at 2.5v or close to it.
User avatar
Burgerman
Site Admin
 
Posts: 65050
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Arduino controlled wheelchair

Postby LROBBINS » 17 Feb 2015, 11:47

No, the DX joysticks have the tracking outputs in parallel rather than mirrored. In any case, the OP has to measure what his does.
LROBBINS
 
Posts: 5543
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Arduino controlled wheelchair

Postby Burgerman » 17 Feb 2015, 11:59

Never even looked inside a DX system.
But those white wires are nothing to do with joystick output directly - at least I wouldn't expect so.

It appears to be soldered directly to the board. Much messing about with a multimeters will be needed while powered up to figure out which ones do what. Not so easy to mess about with as a PG Drives system.
User avatar
Burgerman
Site Admin
 
Posts: 65050
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Arduino controlled wheelchair

Postby LROBBINS » 17 Feb 2015, 13:23

The DX-ACU has a plug & socket for the joystick connections, but the one on the Shark looks like it's soldered to the board. On top of that I suspect that it's not an analog output joystick at all. There are two wires on the side of the joystick that look like they are the + and gnd (and one seems to be labelled 5V on the board bottom), but the other connections seem to be under the edge of the pot and on the bottom are labelled MOSI, SCK, MISO, and RST which implies SPI rather than analog communications. To mimic this you'd need to use an oscilloscope to know the SCK frequency and what data packets are going across MOSI and MISO. The Arduino does have SPI built in, but there's a fair amount of reverse engineering (not as bad as for the CAN messages though) needed to figure out what's what. Actually, once you know the clock frequency, you could probably program an Arduino to print out the raw data then use that to program an Arduino to mimic the joystick output. Might also be necessary to unsolder the joystick and disconnect it to not have interfering signals from the emulator and the "real" stick.

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

Re: Arduino controlled wheelchair

Postby woodygb » 17 Feb 2015, 16:41

User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby woodygb » 17 Feb 2015, 16:47

User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby LROBBINS » 17 Feb 2015, 17:06

Thanks Woody. That differential serial protocol is very different from what's used in the DX systems and rather like a reinvention of a simplified CAN for simplified hardware. It'ss what's traveling over the cable between the joystick box and the power controller. If it were fully "hacked" one could inject your own messages directly there, but the information in that link is pretty incomplete. There's an attempt to see what the joystick packets are, but nothing yet about the handshake responses and things are very likely to say "fault" unless you get both right. Given that Dynamic used a very small Atmega8 processor in the Shark, any Arduino (most have an Atmega328) should be more than up to doing the job if you really knew what messages have to be sent and received.

There's also something in that blog that I don't understand at all:
The center position is around 128, full forward/left is 255, full backwards/right is 128, so dead center/off should be around 128 + (255-128)/2 or 191.
If center is 128, how can full backwards/right also be 128? I also suspect that Dynamic is not really just using single-byte precision for each axis, so the actual joystick message is probably a combination of these two bytes with two others somewhere in the message: that 255 may really be 65535 (two bytes of 255) or anything in between. Some of the other unidentified fields may be used for error detection: check sums or bitwise complements or something else.

It's a start, but no where near enough for programming a joystick emulator.

In any case, this is the protocol for communication between the boxes, not the protocol for transmission from the joystick pot to the board. If there's some identification on the pot itself it might be possible to track down the manufacturer's information to know what that SPI coding is. BTW, I wouldn't use SPI over anything but a short cable - it is not differential and has no error checking, but if an Arduino were packed into the joystick box or right next to it, it would probably be OK.

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

Re: Arduino controlled wheelchair

Postby lewisriverred » 19 Feb 2015, 05:37

http://www.karlssonrobotics.com/cart/4x4-driver-shield/

I've been lookng at the 4x4 robots controlled by the Arduino and thinking about scaling something up to use as a chair. Some even have four wheel steering and limited slip differentials. Can this shield power enough motor to use at high speeds and torque?
User avatar
lewisriverred
 
Posts: 31
Joined: 11 Feb 2014, 04:10
Location: Woodland, Washington USA

Re: Arduino controlled wheelchair

Postby LROBBINS » 19 Feb 2015, 09:17

5A at up to 30V with no heat-sinking. It is ideal for such applications as driving solenoids, relays, and small DC motors.

That says it all. No, this controller is not suited for a chair. You will need something close to or above 100A per channel capacity.
LROBBINS
 
Posts: 5543
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Arduino controlled wheelchair

Postby jcka22 » 30 Jun 2015, 04:30

Okay! Back to the goal of trying to get this Arduino controlled wheelchair up and going.

First thing, it looks like I have to scrap the existing controller. The CAN communication is going to be too difficult to deal with.

I'm having some issues though, and I'm hoping someone can explain to me how these motors work. There are 6 wires going to each motor from the board. 1 each red and black 12 gauge, and 2 of each yellow and white 20 gauge. Six wires total. One set of yellow and white are soldered together. I was thinking the red and black must be the 24V power from the battery. So the other set of white and yellow must be the signal wire to tell the motors the speed. But, when I tapped my multimeter into these and ran the motors forward, backward, whatever - I read around 24V. Adjusting the speed using the old controller, still read 24V. How is this possible? Is it because my multimeter isn't capable of reading the correct voltage. Do I need an oscilloscope?


Thanks!

Jack
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby LROBBINS » 30 Jun 2015, 08:11

The thinner wires are probably brake wires, and the pair soldered together would probably be used for an interrupt switch activated by a mechanical brake release. Brakes are either 24V or 12V and yours seem to be 24V. The brake solenoids are "live" (= 24V) whenever the motors are running and for some delay after the motors stop - they are parking brakes.

The 2 heavier wires go to the motor winding and will be fed with a pulse-width modulated 24V; averaging a low voltage when there's little load, near a full 24V during hard acceleration or otherwise under heavy load.

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

Re: Arduino controlled wheelchair

Postby terry2 » 01 Jul 2015, 10:14

User avatar
terry2
 
Posts: 1281
Joined: 07 Nov 2014, 12:08
Location: Solihull

Re: Arduino controlled wheelchair

Postby jcka22 » 02 Jul 2015, 23:30

Lenny- you were right, Thanks! Terry - thanks for the link, there's some useful info there.

For my next step, I need to pick some motor controllers since I am going to have to scrap the original control board (actually may keep it just to charge the batteries).

What are yall's thoughts on something like this:
http://www.ebay.com/itm/10-50V-40A-DC-M ... 565f16a383

I was debating making something myself, but making a nice h-bridge, and incorporating all the safety features (ex. flyback protection) I figured it would be easier to just buy an existing controller since they're pretty cheap. I can just scrap the pots on these and then use my arduino to control the speed, right?

I will also have to make something up to supply the 24V to the brake wires to release the brakes when I want to drive. I haven't looked into that yet, any ideas there?

Planning to buy some parts this weekend and really get going on this.
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby Burgerman » 03 Jul 2015, 01:42

A stalled or hard accelerating wheelchair motor is limited to "only" 80, 100 or 120A by the controllers measuring the current, and software limiting the current.

That controller has no output Amp limiting and will fail above 40A. As you turn on the spot in most powerchairs the motor current would exceed 100A each without Amps being limited.

Seriously you need to look for a more complex controller with greater max power capability and current limiting that doesent depend on a high impedance motor to limit Amps.
User avatar
Burgerman
Site Admin
 
Posts: 65050
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Arduino controlled wheelchair

Postby LROBBINS » 03 Jul 2015, 02:09

That controller, 40A max (for how long?) would make for a very low-powered chair, but yes you could use two of them. It will be no small task, however, to write a program to properly control a chair - you not only need to mix Throttle and Steer joystick outputs to get Left and Right motor commands (or just turn the joystick 45o as some older chairs did), but you have to program how fast the PWM ramps up and down (acceleration and deceleration), numerous safety interrupts and much more. You'll also have to add current measurement circuitry in order to keep the motors from drawing enough to fry those boards (such as if stalled) and to implement motor compensation. Why not start by trying to write an Arduino program to do this, just using serial or LEDs to visualize the output, before trying to make it actually drive some motors.

The brakes are a simpler matter, however. They each draw about 1/2 amp, so all you need is a digital switch controlled by an Arduino digital output. Although you could design your own MOSFET circuit for this, it's simpler to take advantage of the integrated digital switches already on the market. Roboteq uses a chip that contains 8 low-side switches good for > 1 Amp each (there was a picture showing the part number on some thread here). In my system, for lights I'm using separate high-side switches (STM VN540-E) that are good for up to 2.8 Amps. There are many similar devices out there mostly designed for the automotive market, they're not very expensive and they already include, in addition to the MOSFET, over-current, over and under voltage, and thermal runaway protection.

The easiest way to control a chair from an Arduino is to start with a normal wheelchair controller that has an analog joystick that you can mimic - take a look at Woody's posts about plug-and-play RC for P&G controllers - he's done exactly that. Doing it from scratch is going to be a BIG, BIG, BIG project.

Ciao,
Lenny

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

Re: Arduino controlled wheelchair

Postby jcka22 » 03 Jul 2015, 19:00

Okay, I guess I was trying to get away too cheap, I was hoping to spend around $50 for 2 controllers, I can go higher but would prefer less than $100 for 2.

Originally I did want to hack the controller and use all the existing hardware. However that doesn't seem to be possible since this chair uses a proprietary CAN communication that I can't mimic.

I am planning to turn this wheelchair into a robot, so I won't need the many safety interrupts you might for a wheelchair with a person in it. I've built two very small, simple robots previously, using PWM & servos.

The first used a ultrasonic sensor and a simple algorithm I wrote to avoid obstacles, it decides whether to turn left or right based on the distance of objects. Here's a youtube link: https://www.youtube.com/watch?v=6LTKuldFzRQ

The second was controlled using an Android phone and bluetooth. The Android sends the accelerometer information to the Arduino and the code I wrote turned this into a PWM voltage to the servos so you could tilt the phone to steer the robot. Youtube link: https://www.youtube.com/watch?v=GFZAt9tGh58

I want to do these same things (and many more) but with these bigger motors. I'll look for some better motor controllers and post what I find. Thanks all for your help.

Jack
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby woodygb » 03 Jul 2015, 19:44

Junk the Dynamic and replace it with a Penny and Giles control system the Pilot+ , VR2 or Vsi.
User avatar
woodygb
 
Posts: 7068
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: Arduino controlled wheelchair

Postby LROBBINS » 03 Jul 2015, 21:08

and then don't hack into the P&G in the serial communication bus between modules, but into the internal joystick connection inside the hand control. You could also do this with a Dynamic DX or DX2 as they also use analog joysticks like the P&G.

BTW, if you are making a robot and not a chair perhaps you don't want motors as strong as a chair needs. If so, there may be some other options. For example, STM makes a 30 Amp integrated full-H bridge motor controller, the VNH3SP30-E, suitable for 24V systems that already is set up to use PWM and has over-current, over-voltage, over-temp and so on protection as well as a diagnostic pin that gives fault information. You would need to make a printed circuit board with a fairly big copper area for cooling if you want to pull a full 30A, and you would probably want to add reverse voltage protection (yes, you won't attach the batteries backwards, but it could happen). Price from RS (the European name for Allied Electronics) is E8.16 in single units, to which you have to add the cost of a circuit board for two of them, a couple large electrolytics, and a hefty diode for reverse voltage protection (or a P-channel MOSFET - the data sheet describes several ways to protect from reversed voltage). BUT, 30 Amps is not sufficient for the motors from anything but the puniest chairs.

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

Re: Arduino controlled wheelchair

Postby jcka22 » 04 Jul 2015, 03:12

The thing is I already have these motors. I'm a college student and thus have a very low budget so it doesn't make sense to buy new motors.

I know my motors are 200W so would this H-bridge work:
http://www.ebay.com/itm/240W-High-power ... 19e147a18b

Do I need to do some kind of power supply, or if I'm using one of these pre-made H-Bridges are they set up to just take the power straight from the battery?
jcka22
 
Posts: 15
Joined: 16 Feb 2015, 21:00

Re: Arduino controlled wheelchair

Postby LROBBINS » 04 Jul 2015, 08:39

The Watt rating on motors is NOT the maximum current X voltage as you might think. It is the continuous mechanical watts it can produce without overheating. Under load, the current draw will be much, much higher than what you'd get by doing 200/24 = 8.3 A. Initial starting current might be 50 or 70 A or even more. Going slowly up hill, it might draw 30 A, and turning on carpet 100A - IF THE CONTROLLER DOESN'T LIMIT THE CURRENT. A motor does not limit the current it draws beyond what's provided by the internal resistance of its windings. It's up to the controller to do that.

Mobility controllers, and good hobby controllers, and automotive controllers all limit the current. So, if the mechanical load is such that the motor would draw 100A and the controller limits it to 50A, the motor will just never produce the torque it could if directly connected to the battery, but neither the controller nor the motor will be fried. The controllers you've been finding don't do this (well, I didn't look at the details on all of them, perhaps some do), they just say what maximum current draw they can tolerate. If the motor tries to draw more than that, goodbye controller. You are not going to end up saving money by using a controller that doesn't limit maximum current, you're just going to see lots of smoke.

Motors rated 200W are pretty small as wheelchair motors go. In a robot, without the weight of the WC user, they might give fairly snappy performance. In a WC they're "granny" level. For your use, you can probably get away with the smallest of wheelchair controllers. I think the P&G's Woody mentions start at 40 A (really way too low for a real chair, except for going slowly in a shopping mall), but it might do for your purposes. Used ones should come pretty cheaply on e-bay, and I completely agree with Woody that this is probably not only the easiest, but in the end cheapest, way to make what you want.

Not that I object to roll-your-own designs. If you have a clear goal in mind and the knowledge to pull it off, that's a great way to go. At this stage, however, I think you have to invest first in learning, not hardware, before you can do that. You are a student, so it's time to put those studying skills to use. To start with, you really need to know more about electric motors and their electrical and mechanical properties. What are the important parameters to design around? What are motor characteristic curves and what can you glean from them? Even if you can't get hold of those data for the particular motors you have, understanding what those things are will let you at least make ball park estimates of what you need to do. Wikipedia probably is a decent place to start, but if you can find an old Encyclopedia Brittanica (e.g. from the 50s) you will find some excellent articles on all kinds of electric motors and their characteristics (of course, without anything about things like brushless DC motors - they didn't exist then). Or just search for "electric motor characteristics" and you'll find enough to keep you well-occupied and eventually well-informed.

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

Re: Arduino controlled wheelchair

Postby Burgerman » 04 Jul 2015, 08:44

A 250 watt motor doesn't take 250 watts. It takes about 120 to 150A stalled or initially accelerating at 24v.

120A x 24V = PEAK WATTS OF 2880

250 Watts refers to its max average continuous power without overheating.

Didn't see lennys reply! Oops... :o

That controller you link to can do about 10 amps before heat/failure/smoke. Take a look at http://www.roboteq.com/index.php/docman ... sheet/file
User avatar
Burgerman
Site Admin
 
Posts: 65050
Joined: 27 May 2008, 21:24
Location: United Kingdom

Next

Return to Everything Powerchair

Who is online

Users browsing this forum: Bing [Bot], mrgus2u and 28 guests

cron

 

  eXTReMe Tracker