PINNED - Roboteq Controller - developing for powerchairs

Power wheelchair board for REAL info!

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 08 Jul 2015, 18:06

Well I have a plan. Actually several... But will build one, but need the ardumow electronics, and my own much more compact edge to edge design.

So what electronics do I buy?

Don't reply here... New thread coming up.

viewtopic.php?f=5&t=5223&p=69521#p69521
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 08 Jul 2015, 19:06

New script.

Tested today. Speed pot, no affect.
Full speed even when set low.
And turn left/right no affect.

In fact even if I then stop the script, it still wont turn. Forwards and reverse still work.
If I tick "mute" it then turns left/right, normally.
I f I restart the script, no turning command again.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 08 Jul 2015, 22:31

Do the space differences matter here?

No, spaces are only for the human reader.

Tested today. Speed pot, no affect.
Full speed even when set low.
And turn left/right no affect.

I'll try to take a look at it tomorrow to see if I can spot what I've screwed up. Pity I don't have a second Roboteq as that would make debugging a lot easier.
Ciao,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 09 Jul 2015, 16:11

Tested today. Speed pot, no affect.
Full speed even when set low.
And turn left/right no affect.

Guess what. Here are a couple new files. I found 3 mistakes in John's script with damping, two of which also were present in Will's. The third mistake was not having taken something out of John's that was a particular change put in by Will in his.

To summarize:
(1) Will wanted to allow TurnAtFullSpeed to be > 100, so had added a TurnSpeed variable, set to 250, to make sure turn rate couldn't get out of hand - he truncates at that value if turn rate gets too high. I forgot to take that truncation routine out of John's version, and he doesn't have a TurnSpeed variable, so it was truncating steering to 0.

(2) In the new SpeedPot routine, I first find the value of the physical pot setting - a variable called "Pot" and then should have used "Pot" and the settings for throttle and steering forward and reverse minimum and maximum to calculate Steering and Throttle. However, instead of using "Pot" in the equations, I used "SpeedPot" which was set at the top of the program to 100 and always left there. No wonder turning the pot didn't change speed (nor steering which was stuck at 0).

(3) I screwed up the counting indexes used in the moving averaging, in two different places, so it wasn't actually averaging. That's been fixed.

Simulation says it's OK now, but the real test has to be hooked to controller and motors.

Ciao,
Lenny
Attachments
John 7-09-2015 damping.zip
(37.06 KiB) Downloaded 227 times
Will 7-09-2015 damping.zip
(36.94 KiB) Downloaded 210 times
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 09 Jul 2015, 16:29

Will get it on blocks after 7pm. And test!

Thanks.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 09 Jul 2015, 16:52

Well I got chance to test it early. Looks fine. Working as expected.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 09 Jul 2015, 21:38

Just tried setting the frequency of the motor drive pulse to 10k. Drives the same. Sounds terrible. Can see why those high frequency gadgets move teenagers elsewhere!
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 09 Jul 2015, 21:58

Drives the same. Sounds terrible.

My wife would leave if we ever had a device like this. The whine of the inductors in the charger drives her bats as it is, even though I can't hear it at all.

Glad the script seems to be working.

Do you notice any difference in feel with the moving average for joystick? (Damping is set at 10, 1 would be as before, >10 and it will eventually get a bit non-responsive, especially trying to stop quickly from a high speed turn.(

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 09 Jul 2015, 23:49

My dog hated the sound of the roboteq chair, and ignored the PG drives one. So I turned its frequency down to listen. He was right!

Damping. Feels super damped to me at 0 setting. And changing to 5 or 10 doesent seem any different. So not sure. Will test higher values. And report back!
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 09 Jul 2015, 23:57

OK tested 0 and 50.

0 is a bit slow and delayed, but not really enough to worry about for most users, but it bugs me in actual use.
50 feels like the chair is about .1 second slower to catch up with what I do. I couldnt drive it "angry" like that and would wipe out dogs, people, door frames etc. When gunned after a turn it would go "late" and rotate too far, and be behind what I was actually requesting it to do...

This is sat on blocks, not actually driving the chair, just watching the wheels. So its less clear cut as a result than I would like.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 10 Jul 2015, 09:36

0 makes no logical sense, but if I recall correctly the script is written so that it does the same as 1 which should actually be the same as what you had before, so I don't understand why it makes it sluggish - each (analog) stick reading is immediately processed and sent on without any averaging.

50 is way, way too high, and in fact isn't real - there's a bit in the program that says:
Code: Select all
IF (Damping > 20) THEN
  Damping = 20
END IF

So you are seeing the sluggishness one gets with damping = 20. If anyone ever wanted more, I'd have to make the arrays that store the js reads larger first, but I can't imagine anyone wanting more than 20. I too find 20 annoying (but timing with the CAN messaging is also different from your more direct system).

The script I sent had it at Damping = 10 which is what I'm using, but the ideal for you might be different because you are different, the chair is different, and the electronics are different. I suggest trying a few values like 6, 8, 10, 12, 14. There may be rather little difference among these, just pick the one that feels best.

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 10 Jul 2015, 10:06

0 makes no logical sense, but if I recall correctly the script is written so that it does the same as 1 which should actually be the same as what you had before, so I don't understand why it makes it sluggish - each (analog) stick reading is immediately processed and sent on without any averaging.


It hasn't changed. It was always just a little slower to respond than the maxed out PG 100A controller. Maybe because my acceleration rates are set lower. I will probably set it to 3 or 4 as I cant tell that from 1...
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 10 Jul 2015, 18:09

http://www.wheelchairdriver.com/BM3-con ... Script.txt

The script as of 10th July 2015 and working well, for those following this.
I added a few comments and tidied it up so its easy to understand what does what. Partly for me, partly for others.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 26 Jul 2015, 18:40

Brake2Pin = 0 'Digital pin number 0 if only 1 brake pin used.

What happens here?

0 = 1 brake pin used?
1 = both brake pins used?
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 26 Jul 2015, 20:20

No, set that to the number of the digital output (logical not physical) pin that controls Brake 2, 0 if none. For example, mine are:
Brake1Pin = 7 'digital output pin 7
Brake2Pin = 8 'digital output pin 8
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 26 Jul 2015, 22:00

Interestingly, its working fine, set to 0

???

Like this:

Code: Select all
SpeedPotPin = 5            'Analog input number in Roboteq setup.
LeftCurrentSensorPin = 7   'Analog input number.
RightCurrentSensorPin = 8  'Analog input number.
AlarmPin = 6               'Digital output number in roboteq setup used for low voltage alarm.
Brake2Pin = 0              'Digital pin number



Its actually on no.1 output. What difference will it make?
Now fixed. Joystick damping is on 1. 3 is too much.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 27 Jul 2015, 03:06

How do you have Brake1Pin defined? Did you leave it at the absurd value 101 or set it to the digital output pin used for the brakes? That's the only one that matters. You should have Brake2Pin set to 0 so you don't read some other pin not used for the brakes but that might be always "set", or might be "set" for reasons having nothing to do with the brakes - if that happened you'd lose motor compensation.

The only place the brake state is used in the script is in motor compensation to keep the chair from moving because the motor works as a generator if it's given a strong bump from outside while sitting still. There's also a check to avoid this if the stick hasn't been moved at all (i.e. if there's just noise on the analog signal). Of course, with fresh motors and no brake slip, the motor won't be working as a generator anyway once the brakes are set.
Code: Select all
'ignore small changes to avoid brake clicking and motor judder if motor milliohms set high
'and make sure if stick has been centered BrakeDelay msec that physically jostling the chair
'can't release the brakes
  BrakesSet = ((GetValue (_DIGOUT) AND BrakesMask)=0)
  IF (abs(oldThrottle-Throttle) <= 3) OR (BrakesSet = TRUE) THEN
    Throttle = oldThrottle
  END IF
  IF (abs(oldSteering-Steering) <= 3) OR (BrakesSet = TRUE) THEN
    Steering = oldSteering
  END IF

With that "belt and suspenders" protection, you probably won't have any problem even if the suspenders are unhooked.
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 27 Jul 2015, 07:14

This is the script I am using.

Theres no longer a brakepin1 to set?
And so I set brakepin2 to zero.
Then reset it to 1 (the one I use for digital out)

This is the script as it is at the moment. Other than I changed the 0 to 1. Chair on blocks so not sure if compensation working.

There is no brakepin1 to set any longer!

http://www.wheelchairdriver.com/BM3-con ... Script.txt
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 27 Jul 2015, 08:31

Well, I don't know when you deleted it. The file I posted had this:
Code: Select all
'WILL and JOHN: I don't know what pins you are using for brakes, set here to silly numbers to allow compilation
Brake1Pin = 101 'digital output pin ??
Brake2Pin = 0 'digital output pin, 0 of only 1 brake pin used (oops, says "of", but should say "if")

Intent was that you change that 101 to the pin number you are actually using.

Omitting Brake1Pin, the way MicroBasic works, probably gives a value of 0 when the program later on tries to use it. So, missing Brake1Pin and having
Code: Select all
Brake2Pin = 1 ' = your pin number
is actually going to work because later on if Brake2Pin >= 1 it combines the pin values for Brake1 and Brake2.

Still, I prefer to have them both explicitly defined. That way if something goes wrong later on it will be much easier to track down the bug. So, you should change your script to read:
Code: Select all
Brake1Pin = 1
Brake2Pin = 0  'both brakes controlled by one pin

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 27 Jul 2015, 10:09

OK thanks. Will do.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Williamclark77 » 06 Aug 2015, 16:03

I have not forgot this nor slacking on trying the newest updated script. I have not had a chance. I've either been using the chair or away from home. I PLAN to this weekend. Although, I planned to the past two weekends and did not have time. Too many projects.

I have created a new docking mechanism to drive my Willchair from. Nothing protrudes below the chair. Hooks cinch down on a pin located on each side of the chair. I had it temporarily set up using a hand operated lever to lock the chair down. Worked fantastic. Used it for the past few months. And unlike every other docking mechanism I've seen, has zero affect on the chair's usability. I have most of the parts machined to make it electronically controlled from a toggle switch and have tested it. Works great. Hopefully I can get someone to help install it this weekend.

I also have a side project going at work. I'm mentioning because of the gps lawnmower posts a page back. It involves a 31 horsepower diesel zero turn commercial grade Kubota mower, a lot of electronics, and most of my sanity. RC control was no big deal. Still racking my brain on getting the gps right. I used my Willchair to alpha test some gps stuff.
User avatar
Williamclark77
 
Posts: 1182
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: Some thinking and questions about Roboteq

Postby Burgerman » 08 Aug 2015, 14:34

Well it seems OK here. Comp working normally. But you are not using motor compensation are you?
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby ex-Gooserider » 11 Aug 2015, 06:10

Can you start a different thread (since it's WAY off-topic on this one) on the lockdown device?

Can it be adapted to different chairs besides yours?

How does it affect the ability to put the regular drivers seat, or swap the passenger seat over to the drivers seat position?

(I see the above as necessary if wanting a mechanic to be able to test drive the van, or to allow multiple drivers on long trips and the like... It is also a decent 'last resort' option if the power chair brakes down....)

I know I'm tired of snagging air hoses, extension cords and whatever else with the grappling hook (AKA bolt) hanging off the bottom of my chair....

ex-Gooserider
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Some thinking and questions about Roboteq

Postby Williamclark77 » 12 Aug 2015, 03:03

Goose, you really should make your bolt retractable like I did on my Permobile. That alone makes a HUGE difference. I destroyed so many water hoses, air hoses, door thresholds, etc that I lost count before I did.

It's already dark here and I haven't taken any pictures yet. I will tomorrow evening when I get home from work. You could build it at the Asylum, minus the 3d printed parts. It doesn't affect putting the driver's seat in. I do have to remove the hooks to use my Permobile, but that takes less than 20 seconds. They stick up too high (for now, i have a way around it when I get time). Two pins and done.

I still have not tried the script revision. Lack of time and been using the chair for too much.
User avatar
Williamclark77
 
Posts: 1182
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: Some thinking and questions about Roboteq

Postby ex-Gooserider » 18 Aug 2015, 05:41

I've thought about trying to do a retractable bolt, but the problem is that the bolt is in the middle of my battery box - so I'd have to get rid of the batteries to make room for it - sort of a non-starter...

ex-Gooserider


Williamclark77 wrote:Goose, you really should make your bolt retractable like I did on my Permobile. That alone makes a HUGE difference. I destroyed so many water hoses, air hoses, door thresholds, etc that I lost count before I did.

It's already dark here and I haven't taken any pictures yet. I will tomorrow evening when I get home from work. You could build it at the Asylum, minus the 3d printed parts. It doesn't affect putting the driver's seat in. I do have to remove the hooks to use my Permobile, but that takes less than 20 seconds. They stick up too high (for now, i have a way around it when I get time). Two pins and done.

I still have not tried the script revision. Lack of time and been using the chair for too much.
User avatar
ex-Gooserider
 
Posts: 6232
Joined: 15 Feb 2011, 06:17
Location: Billerica, MA. USA

Re: Some thinking and questions about Roboteq

Postby Burgerman » 18 Aug 2015, 10:47

If your chair has good ground clearance, you can raise the ezlock in your vehicle by say 1.5 inches, as I have, And shorten the bolt so that you have an extra 1.5 inches clearance. Mine never causes problems this way.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Williamclark77 » 18 Aug 2015, 17:44

I sent Goose a pm with a video of the locking mechanism working.

I can't move the EZ Lock in my car because I need to be able to lock my Permobile in just in case. I still prefer it if I will be machining stuff. It is several inches taller which makes seeing over the bed of my equipment easier.

I cross stuff tall enough to drag the bottom. I wanted the bottom to be smooth.

Speaking of, I did flip this passed weekend. Just because you can hop up onto a stack of boards about 12" high doesn't mean you should just because a camera is going. Embarrassing.

I feel bad that I still have not tried the newest script update. I've been in the chair 16-18 hours a day every day lately and at home very little.
User avatar
Williamclark77
 
Posts: 1182
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: Some thinking and questions about Roboteq

Postby Burgerman » 18 Aug 2015, 23:31

Speaking of, I did flip this passed weekend. Just because you can hop up onto a stack of boards about 12" high doesn't mean you should just because a camera is going. Embarrassing.


Join the club. Its a regular thing here for years!
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Williamclark77 » 22 Aug 2015, 19:06

I FINALLY made time late last night to try Lenny's update. I didn't have to change much as far as user settings. In an hour or so of butt testing last night I am thoroughly pleased. As always, A+ to Lenny. That removed pretty much all of the jumpiness. The combination of these new motors having 8 poles vs the 4 poles of my last and Lenny's formula for averaging the joystick reads makes it very competitive for smoothness to a typical brushed setup. I will do a lot more testing and tuning later today after finishing up another project. I have some 1/4" pressure vessel grade 316L stainless swiped out of the trash bin from work to remachine some parts out of for my lock down.

I currently have it set on 10 reads. That does give it a touch of muddy feeling at mid speed zipping through the house far faster than I should be going indoors anyway. I'm going to try changing some hardware before fooling with the software much. I have these new motors geared for 13.2 mph on paper. GPS shows about 12.5 in my yard. Haven't really tried it on the road. Even after a LOT of low input high amp use on rough hilly trails the motors and wiring are barely warm to the touch without the cooling even turned on.

I plan on swapping to the 15+ mph gearing I have boxed up. It made the other motors feel too "coggy" at low speed and overheated the electronics under the above conditions. The combination of beefier wiring with less resistance, the script update, and higher pole count SHOULD get it acceptable. We'll see. That may be faster than I need though.

15ish mph doesn't sound fast until you're doing it on a motorized recliner down a rough atv trail. As BM can agree, it feels more like 35!
User avatar
Williamclark77
 
Posts: 1182
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: Some thinking and questions about Roboteq

Postby Burgerman » 22 Aug 2015, 20:06

Its odd, that speed thing. Sometimes it feels like you are not going that fast. Oher times it feels like you are going at least 4 times too fast... I think its bumps . My chair is tippy, very short, and no suspension just the low pressures in those fat tyres. It needs some at 15mph or so. But I don't go fast often, you cant really in town unless you take to the road. Then you can over take cyclists and slow traffic.

>I currently have it set on 10 reads

Really? That makes it seem really delayed to me. I have it on 0 to 3 and cant really tell the difference there.

Are you using the new firmware and Roborun software? I have not bothered yet.
User avatar
Burgerman
Site Admin
 
Posts: 71106
Joined: 27 May 2008, 21:24
Location: United Kingdom

PreviousNext

Return to Everything Powerchair

Who is online

Users browsing this forum: jehan, LROBBINS, shirley_hkg and 507 guests

 

  eXTReMe Tracker