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 Bearded_Blunder » 22 Nov 2015, 10:42

Fair enough, I'm glad you have figured something workable out, being hamstrung by number of available inputs would indeed be an issue, hadn't considered that, yes you'd need hardware to give you the value of voltage drop across the motor if it's not tracked by the controller, as you say, in itself that's trivial but no help if you can't get the information to your script for want of inputs.

I'll shut up now.
Bearded_Blunder
 
Posts: 32
Joined: 15 Nov 2015, 04:54
Location: Northampton, UK

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 23 Nov 2015, 16:36

John,

Here's the next attempt at getting acceleration working as it should. It is quite a bit different from earlier scripts, so user settings you've had before this should be ignored. Instead, start with the user setting values in this file.

HOWEVER, and this is IMPORTANT, at least for me to be able to work on this. I want you to follow a step-by-step testing procedure. I'm unlikely to be able to figure out what needs adjusting in the next iteration if you don't do this. PLEASE read the following description of the steps, if you don't understand something here, ask me for clarification first. Then PRINT OUT THE ATTACHED CHECK LIST and follow it religiously (much as you hate religion).

First, some comments about User Settings changes and how this script SHOULD behave:

The relevant section of User Settings is this:
Code: Select all
Accel = 800 '800 use 2000 to speed up simulation
Decel = 800 '800

'boost of accel/decel proportionate to difference between MotorCommand and MotorPower
PowerAccel = 100 'at 200, maximum boosted accel will be 3X Accel, at 100 it sill be 2X Accel
PowerDecel = 100

'boost of accel/decel for turn-in-place
TurnAccel = 100 'at 200, maximum boosted accel will be 3X Accel, at 100 it sill be 2X Accel
TurnDecel = 100 'NOT PRESENTLY USED, but may be needed.

BoostLimit = 100 'currentSpeed ar which efffect of PowerAccel and TurnAccel is reduced to zero.  (During
                          'deceleration refers to change of currentSpeed from speed at moment when deceleraton begins.)
                          '100 corresponds to 10% of max speed, 200 to 20% and so on.
BackStickBraking = 140 'percent of added deceleration to use if Throttle crosses 0. renamed from DecelBoost

Although internally accel and decel of M1 and M2 are sometimes different, there's never been a need for the separate M1Accel and M2Accel etc. user settings, so now there's just Accel and Decel.

There are separate parameters to adjust the amount of boost for speed acceleration (serves also for deceleration) and for starting a turn-in-place. Deceleration boost, to eliminate hesitation when fighting the inertia of a chair in motion, is handled somewhat differently from Acceleration boost, but we'll try to find out if I've done this correctly fairly late in the testing sequence.

The accel boost is reduced as the chair speeds up (or the turn gets going) and there's a new setting BoostLimit that determines at what speed it goes to zero. A setting of 100 corresponds (for your chair) to about 1.5 mph once the motors have reached steady state.

DecelBoost wass a bad name and we may need that name for other things, so I've changed it to BackStickBraking as you used in your explanatory comment.

Now, on to the testing and adjustment procedure that I want you to follow. At each step you will be just one aspect of the chair's behavior and adjusting just one user setting with a specific purpose in mind. I CANNOT OVER-EMPHASIZE the need to NOT confuse things (especially me) by not following this protocol:

TESTING AND ADJUSTMENT OF THE PARAMETERS FOR "John 11-23-2015 temp4" (follow step-by-step: print out and use attached check list)

(1) Bring the stick steadily to full forward (NO TURNING) and pay attention to the acceleration rate only during the last quarter of the process. Do not pay any attention to how the chair starts to accelerate! Adjust Accel (and only Accel) to get a reasonable rate of acceleration in the last part (and only the last part) of the process. Note your comments on just this final stage of acceleration on the printed checklist.

Obviously, you have to slow to 0 for each acceleration test. Do so by bringing the stick straight back to 0, not past zero, with no turning, but ignore what the chair does during deceleration (that comes later).

(2) Bring the stick steadily to about half forward (NO TURNING) and pay attention to the acceleration rate only during the very beginning of the process. Adjust PowerAccel (and only PowerAccel) to get it to start moving without hesitation. Do not pay any attention to anything except the first few moments, nor to how it decelerates between trials. Note the results for just the beginning of acceleration on the printed checklist.

(3) Bring the stick steadily to full forward again (still NO TURNING) and pay attention to the middle part of the process. Is there a speed surge at some point? If so, reduce BoostLimit (but DON'T change anything else). Is there hesitation while speeding up? If so increase BoostLimit (and DON'T change anything else). Record your observations for intermediate-stage acceleration on the printed check list.

(4) Bring stick to full forward, then move it steadily back to center (NO TURNING and NOT PAST CENTER) and pay attention to the LAST part of the deceleration. Adjust Decel (and only Decel) so that it smoothly comes to a stop. Note observations for final deceleration on the printed checklist.

(5) Bring stick to full forward, then move it back to center (NO TURNING and NOT PAST CENTER) and pay attention to the very FIRST part of the deceleration. Adjust PowerDecel (and only PowerDecel) so that deceleration begins without hesitation. Note the results on the printed checklist.

(6) Bring the stick to full forward then back to about 50% and hold stick steady (NO TURNING). After motor speed is steady, bring stick back to zero (not past zero) and note whether there is any hesitation or jumpiness when deceleration resumes. There is nothing to adjust if it's not right - but if it's not right there are changes I need to make in the programming.

(7) Move stick full right and adjust TurnAccel to get good start of turn-in-place. Record results.

(8) Repeat (7) paying attention to what happens as turn rate reaches final value. There's nothing to adjust for this, but if it's not right I will need to make some changes in the programming.

(9) Move stick full right and hold until motor speed is steady, then bring stick back to center (NO FORE-AFT movement, NOT past zero, and NO TURNING). How smoothly and quickly does it decelerate? There's nothing to adjust for this - the program is not using TurnDecel so there's no use changing that. I may, however, have to activate use of TurnDecel in the program so I need to know what you observe with this precise test.

(10) Go into a steady turn-in-place then move the stick to fully straight forward. It should first stop turning, and then accelerate. Does it stop turning quickly enough? too quickly? Is the transition from turning to straight ahead too abrupt? Any problems here will have to be fixed in the code. I need to know what you observe with precisely this test.

(11) Stick full forward then back past zero. Adjust BackStickBraking to get reasonably increased deceleration.

(12) If behavior is not obviously unsafe, try whatever maneuvers you wish and record observations about any problems with as much detail as possible. If you think that things are at all close to correct, you can go back and repeat the WHOLE testing sequence, but don't skip any steps, and change only one parameter at a time. Feel free to adjust SpeedPot and TurnPot parameters as well, but write down what happens for each user setting change you make.

I am sure that the above seems very lock-step, but I want us to treat this testing the way I would approach checking out an unfamiliar airplane after a mechanic's messed with it. It's not as persnickety as a real test pilot would do, but the more precise the data, the more likely that problems can be solved.

Ciao,
Lenny
Attachments
checklist 2015_11_23.doc.zip
(82 KiB) Downloaded 225 times
checklist 2015_11_23.pdf.zip
(36.77 KiB) Downloaded 246 times
John 11-23-2015 temp4.zip
(39.57 KiB) Downloaded 169 times
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 23 Nov 2015, 19:25

Will test and report asap. Got to wait a bit to get chair on blocks. Thanks!
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 27 Nov 2015, 13:34

Test today after 6pm!

Been fighting the council and having financial assessment's, etc. Great fun. Now they are leaving me alone for a bit.
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 27 Nov 2015, 17:01

Good. I want to forewarn you of one thing that you will surely not like in that script, but it doesn't enter into the testing protocol I outlined and I've already fixed it for the next version. If you are, for example, going forward in a sweeping turn and bring the stick back to center, first the turning will stop and then the speed will decrease. However, the turning doesn't stop near fast enough so you will continue to move forward a ways before the speed decays. You'll notice in the user settings list that there's one, TurnDecel, that is not actually used in the script. It is in the next one, and it is in Rachi's, and it does the trick for this problem.

It's still the case that I need the numbers and observations from the testing schedule I sent. There are a couple (rather secondary) things in the script I have some doubt about, but I don't want to fiddle with them till I know what's what with the basic functionality. BTW, the numbers I put in for the user settings are pretty conservative and you may well find yourself increasing some of them quite a bit - however, do that one at a time following the test procedure. These parameters interact, and changing the order of adjusting things will only cause confusion. You need to be as fussy about this as you are about testing individual cells before assembling a battery.

Till later, or tomorrow,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 27 Nov 2015, 21:34

Attached word doc.
Attachments
checklist 2015_11_23.doc.zip
(43 KiB) Downloaded 226 times
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 27 Nov 2015, 23:31

Hi John,

I read through your notes. That's pretty much what I'd expect you to see with the numbers I put in.

Now, go back to the description of these steps in my earlier post and start making the adjustments, one step at a time, as indicated there. Each of the test maneuvers was supposed to be accompanied by a specific user setting adjustment, with that step and that adjustment repeated until the specific "what to watch" is OK (if possible).

For example, at the first step where you are looking at final stage of acceleration at full forward stick - adjust Accel, and only Accel to get a final rate of acceleration you feel comfortable with. Only after you've gotten that done, go on to step 2.

Step 2 - stick to 50% and adjust PowerAccel, and only PowerAccel, to get decent start of acceleration. Keep notes in the checklist of how each of these parameter adjustments goes. Don't be too surprised if the numbers have to go higher than you might expect. (Note, on Rachi's chair if I set PowerAccel way too high, e.g. 1500, which is 16 times the base Accel rate at start of acceleration, it actually gets much more sluggish at initial acceleration - probably reaching current limit - ended up with it set at 400 for now. With PowerAccel = 400 and BoostLimit = 300 (30% of full speed) I seem to have a nice even acceleration, but your numbers are quite likely to be different from these. I suspect that you will want a lower BoostLimit, remember there's a 3X difference in top speed and (electrical + mechanical) gearing between your chair and hers.

The spikiness you saw in command at stick near center is probably caused by the absolute steer priority. Will be easy to cure, I think, and it may even go away all by itself when you've adjusted the various user settings and we've added a working TurnDecel to the script. BTW, how much deadband have you set in the profile? You should have at least a little bit - the Apem joystick doesn't always center to exactly the same mV. Just looked at an old profile of yours. In that one you have 5% deadband which should be sufficient, but for this testing you might want to up it to 10% - that might get rid of the spiking near center.

Again, go back to, or even print out, the descriptive part of the post because it explains what I want you to be doing at each step. The checklist is just a way to organize the results.

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 27 Nov 2015, 23:37

The spikiness you saw in command at stick near center is probably caused by the absolute steer priority. Will be easy to cure, I think, and it may even go away all by itself when you've adjusted the various user settings and we've added a working TurnDecel to the script. BTW, how much deadband have you set in the profile? You should have at least a little bit - the Apem joystick doesn't always center to exactly the same mV. Just looked at an old profile of yours. In that one you have 5% deadband which should be sufficient, but for this testing you might want to up it to 10% - that might get rid of the spiking near center.


Will try increasing deadband because it actually makes testing almost impossible. Took me 5 mins to figure out why there was no forward acc! Its really hard to keep the stick central enough. Deadband should fix it? OK.
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 27 Nov 2015, 23:45

If the script sees any turn change at all, it will not change speed until the turn command has been satisfied, and until Accel and TurnAccel etc. have been adjusted turning is probably taking too long. Once those parameters have been adjusted it will probably lock right onto 0 turn change. Try increasing the deadband, but if that doesn't work I'll get rid of the turn priority when turn change is "almost" zero instead of at exactly 0. (Code already written, just not included until we know we need it.)

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 00:55

New .doc

Many settings and observations.
Attachments
checklist 2 2015_11_23.zip
(42 KiB) Downloaded 238 times
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 08:37

To me, it looks like we're on the right track. Later today I'll send you a new file with TurnDeceleration added - that will take care of the slow stopping of turns when decelerating (which will also let the speed deceleration from a turn start sooner). For now, just some comments on your findings. A lot of the numbers will need to change, possibly by fairly large amounts, once the motors are under load. What you're seeing now is with neither static loading nor the loading due to chair (and driver) inertia. So, the BoostLimit of 100 deals with the load of coming out of stall and it may need to be somewhat higher in real use - Rachi's is at 300, but her "ideal" is probably somewhere between 200 and 300. The effect of PowerDecel also may become more obvious when really moving, and Decel itself may need to go higher. Time will tell.

When you get the next version, you should follow the same testing and adjustment sequence.

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 10:31

I think turn accel needs to be higher too. After testing some more.

Why does the decboost even set high have no affect?
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 10:42

Why does the decboost even set high have no affect?
Do you mean PowerDecel? Don't really know, but here it does. I'll check over the code to make sure it's OK in your version. I can think of three possible reasons: absence of load, on deceleration the chair passes through the BoostLimit point more quickly so an effect on the curve may just be harder to see (and maybe invisible if the stick is cocked even a bit to the side so that turning is taking priority), and the fact that on Rachi's chair base Decel is set much higher - twice what Accel is at as opposed to less than Accel on yours. As the boost PowerDecel is a multiplier, it has a bigger effect if Decel is higher, though I'd still expect to see an effect when set outrageously high like the 2000 you tried.

Till later.
Lenny
P.S. Don't you ever sleep?
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 11:19

Sleep? Pretty much no. Intermittently. Having various pains, ileostomy, and other continence devices to check regularly makes you wake very regularly if you are to stay out of trouble. And I think of things as I sleep/wake and turn my laptop back on if its gone to sleep...

Trust me, I have acc and dec set to around 7 full seconds each. The boost and boost limit are not seen at all. Unless its load (current sensor) dependent. Must be a bug somewhere. There is a slight dec/acc boost just as the motor power line crosses zero if you are back stick braking. Which will feel odd?
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 12:06

Trust me, I have acc and dec set to around 7 full seconds each. The boost and boost limit are not seen at all. Unless its load (current sensor) dependent. Must be a bug somewhere.
I don't see a bug, and driving Rachi's chair it definitely evens out the deceleration rate. However, I have her chair set to decelerate in half the time it takes to accelerate - otherwise it "coasts" too far before speed decays.

There is a slight dec/acc boost just as the motor power line crosses zero if you are back stick braking. Which will feel odd?[
[/quote] I don't think that this will feel odd. When you cross zero, you're actually changing from decelerating to accelerating, and it's from a momentarily stalled condition when the motor's reversing direction, so this is actually PowerAccel doing its thing, not the BackStickBraking.

I'm attaching two files. First, a version of the script with TurnDecel included. I've put in the user setting values that you had in the last checklist, but as the program's different, you should again follow the step-by-step testing and adjusting protocol. Second, a new check list with some things in bold and a few comments added for new things, or points where I'd like you to pay special attention.

If we really have to, we can have separate BoostLimit parameters for accelerating, decelerating, turn increasing and turn decreasing, but I'd rather not add extra settings if not absolutely needed. Once you've got the attached script tested and adjusted while on blocks, unless problems come up I think that it will be safe to test with the chair actually moving.

Ciao,
Lenny
Attachments
checklist 2015_11_28.doc.zip
(42.5 KiB) Downloaded 215 times
John 11-28-2015 temp4 TurnDecel.mbs.zip
(40.23 KiB) Downloaded 161 times
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 12:43

One further thing -- further reason to increase Decel to the maximum you find reasonable as the chair nears zero speed (not average nor total time). As of now, TurnDecel does something only while the chair is actually decelerating (that can be changed if needs be). It has no effect on how long it takes to end a turn-in-place. Decel, however, will affect ending a turn-in-place, so a larger value of Decel will result in a quicker ending of a turn-in-place.

This may not be the best way to deal with this, but the testing will tell us that. If the highest Decel you want to use gives too slow a stop of turn-in-place, I'll make TurnDecel work then too.

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 13:10

This may not be the best way to deal with this, but the testing will tell us that. If the highest Decel you want to use gives too slow a stop of turn-in-place, I'll make TurnDecel work then too.


Well, yesterday, deceleration from speed was over 6 seconds. (That made it hard to stay sat in my seat, and the tyres protested when set to this rate previously.)

And ending a turn in place was miles too slow yesterday. Also its going to feel odd/unbalanced/and not very intuitive if its slow to stop rotating on the spot, but fast to stop turning if you then accelerate. Or if just fast to initiate a turn, but slow to stop. The difference is about 5 fold on my chair. So I think its going to be essential.
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 13:48

OK, as soon as you let me know what happens with the script I sent, I'll send one in which TurnDecel is active whether decelerating or (NOT decelerating and NOT accelerating) -- turn while accelerating is handled by TurnAccel. Then we'll have to decide whether we need to have any difference in stop-turn response when starting to decelerate from high speed vs. when stopping a turn otherwise. It really needs to be very quick when starting to decelerate from high speed to keep the chair from moving forward until the change in turn is done, but that may be too brusque in other situations.

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

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 13:56

I am about to do the tests you want. First take a look at this.

Code: Select all
Accel = 1200
Decel = 1100
PowerAccel = 600
PowerDecel = 600

TurnAccel = 3000
TurnDecel = 3000

BoostLimit = 150

BackStickBraking = 140
MotorResistance = 50     


This is each vertical line on the graph is about 2.2 secs here:

FULL RIGHT STICK. good turn acc.
RELEASE super slow turn deceleration (bad).
Now after some secs, FORWARDS. boosted initial forwards acc (good).


Then RELEASE stick and totally flat deceleration to zero MPH.
Attachments
Capture.GIF
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 14:05

Same thing but with instant transition from right turn to 100% forwards Turn continues far too long. Not news we already know this.

If I don't get the stick exactly central, erratic or no forward acc happens still as before?

OK to do your tests now!
Attachments
Capture.GIF
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 14:11

Same thing, with joystick 1 or 2 degrees off "north".

4 seconds per vertical line.
Attachments
Capture.GIF
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 14:40

Well other than changing a few settings nothing appears to be any different here.
Turn dec setting causes fast steer only while at speed.

Attached .DOC as zip.
Attachments
checklist 2015_11_28.doc.zip
(41 KiB) Downloaded 235 times
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 14:44

Code: Select all
'==========================================================================================
SpeedPotPin = 5          'analog input pin used for SpeedPot
LeftCurrentSensorPin = 7 'analog input pin
RightCurrentSensorPin = 8'analog input pin
AlarmPin = 6            'digital output pin used for low voltage alarm

'WILL and JOHN: I don't know what pins you are using for brakes, set here to silly numbers to allow compilation
Brake1Pin = 1 'digital output pin
Brake2Pin = 0 'digital output pin, 0 of only 1 brake pin used
'JOYSTICK AND SPEEDPOT SETTINGS
Damping = 1 'number of joystick readings to moving average
SpeedPotInstalled = TRUE  'Is speed potentiometer installed?
SpeedPot = 100            'default if SpeedPotInstalled = FALSE; 90 allows some headroom for steer/mixing
TurnPot = 16              'default if SpeedPotInstalled = FALSE;
SpeedPotLowFault = 30     'chair speed used if pot fails giving too low voltage
SpeedPotHighFault = 60    'chair speed used if pot fails giving too high voltage

SpeedPotFwdMax = 100 ' percent speed at highest pot setting, set <100 for lower top
                     ' speed or if headroom needed for turning
SpeedPotFwdMin = 15
SpeedPotRevMax = 26 '26 set at 100 for simulation only
SpeedPotRevMin = 12
TurnPotFwdMax = 16
TurnPotFwdMin = 12
TurnPotRevMax = 16
TurnPotRevMin = 11
TurnAtFullSpeed = 100     '100=no reduction of turn rate with speed, 0=turn rate goes to 0 at full speed

' DRIVING CHARACTERISTICS
'the following override the settings in the Roboteq configuration
Accel = 1200
Decel = 1100
'boost of accel/decel proportionate to difference between MotorCommand and MotorPower
PowerAccel = 600
PowerDecel = 600
'boost of accel/decel for turn-in-place
TurnAccel = 1500
TurnDecel = 1500

BoostLimit = 150 'currentSpeed ar which efffect of PowerAccel and TurnAccel is reduced to zero.  (During
                 'deceleration refers to change of currentSpeed from speed at moment when deceleraton
             'begins.)
             '100 corresponds to 10% of max speed, 200 to 20% and so on.

BackStickBraking = 140 'percent of added deceleration to use if Throttle crosses 0.
                       'effect of this is proportional to how far past 0 the stick is moved.

MotorResistance = 50       'MOTOR COMPENSATION. (SETTING THIS TOO HIGH IS DANGEROUS)
                          'Set to less than motor mohms and then adjust based on chair response
UseCurrentSensors = TRUE 'Set to TRUE if using external current sensors on analog inputs 7 & 8
                          'Set to FALSE to use Roboteq's internal motor current estimates
'parameters added to allow motor compensation boost at low estimated motor current; irrelevant if
'equipped with motor current sensor
BoostStart = 5           'no boost below this to avoid drift at small or no joystick movements
BoostEnd = 500            'safety limit - make sure there's no boost at 50% or more stick throw
MaxBoostFactor = 1        'increase MotorCompensation by this factor at low currents; 0 = no boost
BoostEndCurrent = 100     'taper boost to zero when this value of motor current (10X amps, e.g. 60 = 6 Amps)
                          'is reached
' PROGRAM TIMING
MainLoopWaitTime = 0      'milliseconds to wait for each cycle through MainLoop: set to 0 for max loop speed
CyclesPerSpeedPotRead = 200/(MainLoopWaitTime+1)'number of cycles between each read of pot
                                                'reduce number of cycles if there is a wait time in main loop
TimeBetweenAmpHrReads = 1000     '1000 mSec = 1 second - time interval between checking current draw
TimeBetweenAmpHrOutputs = 10000  '10000 msec = 10 seconds - time interval for sending current used to display
                                 'device
' MISCELLANEOUS
SuppressPrinting = TRUE   'Set to TRUE to suppress printing to speed and smooth controller/PC
                          'interaction; PRINT of current used will not be suppressed, but is sent only
                          'once every vTimeBetweenAmpHrOutputs msec
AllowSerialInput = FALSE  'Set to TRUE if using serial joystick or emulation
FullRechargeVoltage = 449 'ten times battery voltage; 44.9V = 3.45V/cell - voltage present only
                          'immediately after recharging -- used to reset AmpHrs-used measurement to 0
LowVoltsAlarm = 150       'LENNY tenths of volts, 410 = 3.14V/cell for 13s pack
NoLoadCurrent = 30        'current with no motors running (20 = 2 Amps) YOU SHOULD CHECK THIS ON YOUR CHAIR AND
                          'SET THE VALUE JUST OVER WHAT YOU MEASURE
NoVoltReads = 50          'no. of times to read quiescent volts before averaging

'***************************************************************************************************************
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 19:40

I'm not ignoring you, just working all day to try to fix the things that aren't working. Along the way I discovered that the SimulateMotors subroutine didn't know how to deal properly with turning, so it was misleading me. Fixing that was a struggle, but once done I was able to do the following:

(1) correct the gross error in the algebra for TurnDecel. It didn't have 0 effect, but a small, effect that was the same for all values of TurnDecel above 100. I think I've got it fixed now.

(2) changed some IF statements so that speed starts to change when currentTurnRate is within 15 units of targetTurnRate, rather than being blocked until they are exactly equal. This should prevent slightly off-center stick from interrupting forward/back acceleration and deceleration, at the cost of not quite reaching the desired turn rate until speed has reached its final value. Where this might be a problem is if targetTurnRate is zero, that is if you are stopping a turn; it won't go to true 0 but to 1.5% of power devoted to turning. Whether that's enough to actually turn the chair I don't know. It certainly wouldn't do so if the chair isn't moving, but it might if the motors are near the max. efficiency point.

In any case, here's the new file. Follow the same boring test routine yet again!

Ciao,
Lenny
Attachments
John 11-28-2015 temp5.zip
(41.91 KiB) Downloaded 161 times
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 20:06

Testing now...
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 20:42

That's made a lot of difference.
It is doing what you expect and want now. After playing with the settings a little. Looks like it should be good.

One thing is odd though.
The initial acc boost works for straight ahead acc most of the time. Then occasionally, it is missing. Always when you get the stick bang in the centre then it appears to vanish.

This below is two attempts at full stick (rapid application from zero) and up to about 35/40% of speed.
Attempt 1 instant surge, and go. Attempt two, boost almost missing... Very odd. Everything else seems OK I think initially.
Attachments
Capture.GIF
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 20:47

Another example with stick really really central. Seems hit and miss.

I did the same exact thing twice.

I suspect the low boost one is correct. And the high boost one is coming from elsewhere?
Attachments
Capture.GIF
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 21:28

I think I know where that odd erratic behavior accelerating from exact stick center is coming from, I may even have a simple way to fix it, but with only simulation I have no way to mimic the problem nor to see if my "fix" works. Accelerating and decelerating are defined thusly:\
Code: Select all
  IF (MovingForward AND ((M1Calc+M2Calc)>(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)<(M1Power+M2Power))) THEN
    Accelerating = TRUE
  ELSEIF (MovingForward AND ((M1Calc+M2Calc)<(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)>(M1Power+M2Power))) THEN
    Decelerating = TRUE
  END IF
 

Notice that there are a couple of conditions missing here - (1) when (M1Calc+M2Calc)=(M1Power+M2Power) and (2) when neither moving forward nor moving back. It may be sufficient for getting rid of this behavior to change this to:
Code: Select all
  IF (MovingForward AND ((M1Calc+M2Calc)>=(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)<(M1Power+M2Power))) THEN
    Accelerating = TRUE
  ELSEIF (NOT MovingForward) AND (NOT MovingBack) THEN
    Accelerating = TRUE
  ELSEIF (MovingForward AND ((M1Calc+M2Calc)<(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)>(M1Power+M2Power))) THEN
    Decelerating = TRUE
  END IF
 

Because I don't really know if this will work, or cause other problems, I'm going to post a new file for you to try. In fact, I'm going to post two new files. One with just this change, and the other with this change and the transition from "turn change" to "speed change" when turn <=5 instead of 15 - I'd like to have the least residual turn possible that gets rid of the balking during acceleration. Just test each of these with whatever parameters you've settled on with the one you've been testing. The first to see if it always gives boost accelerating from stick centered. The second to see if it doesn't re-introduce the halting acceleration (caused by stick not quite L-R centered).

It'll be a few minutes till these are ready.

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

Re: Some thinking and questions about Roboteq

Postby LROBBINS » 28 Nov 2015, 21:33

John 11-28-2015 temp5a = attempt to make sure acceleration for stick-centered always gets boosted

John 11-28-2015 temp5b = as above, plus turn change within 5 units of completion before switching to speed change
Attachments
John 11-28-2015 temp5a.zip
(42.04 KiB) Downloaded 127 times
John 11-28-2015 temp5b.zip
(42.13 KiB) Downloaded 131 times
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: Some thinking and questions about Roboteq

Postby Burgerman » 28 Nov 2015, 21:34

That's fine I have guests... :evil:


Its the low boost graph that is correct I think.
User avatar
Burgerman
Site Admin
 
Posts: 71117
Joined: 27 May 2008, 21:24
Location: United Kingdom

PreviousNext

Return to Everything Powerchair

Who is online

Users browsing this forum: jefferso, Superchunk and 379 guests

 

  eXTReMe Tracker