PINNED - Roboteq Controller - developing for powerchairs

Power wheelchair board for REAL info!

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

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 16:20

These are the different indicators I have now. The direction of the current has become correct, Speed ​​and current have different meanings.. The motors are not loaded. This is an open loop.
Attachments
7.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 16:26

I do nothing. Current.
Attachments
8.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 16:30

closed loop.
Attachments
9.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 13 Sep 2025, 20:03

These figures certainly show problems, especially in closed loop.

The first panel shows reasonable current values, but maximum speeds of 4000. If you are graphing RELATIVE speed (BSR values not the BS values), the maximum should be 1000. The script should use relative values, even if the graph uses absolute.

In the second panel, I'm glad to see that with no motor command the speed stays at 0, and that the internal sensors are reading values under +/-1 Amp, but I am surprised by the noisiness of the current values. I'm pretty sure that this will not be enough to be a practical problem. In other words, AFTER YOU HAVE CLOSED LOOP WORKING CORRECTLY, you should be able make a new "closed loop speed" version of the script by using
Code: Select all
M1Power = GetValue (_BSR,1)
instead of
Code: Select all
M1Power = GetValue (_MOTPWR, 1)
and
Code: Select all
M2Power = GetValue (_BSR,2)
instead of
Code: Select all
M2Power = GetValue (_MOTPWR, 2)
You will have to change this at many places in the script.

In the third panel, with closed loop, there is clearly something very wrong. At motor commands = 0, current and speed should never be far from 0, but you have current as high as 33Amps and speeds over 4000. What is the rated RPM of these motors? There is definitely something wrong either in (1) the controller itself, or (2) the wiring or alignment of the Hall sensors and motor phases, or (3) the configuration settings. I can't help you with this BUT UNTIL THIS IS FIXED do not operate in closed loop for more than a very few seconds at a time or you will destroy the Roboteq and possibly the motors.
Ciao,
Lenny
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 20:56

Lenny I misled you by not adding comments to the photo. I accidentally missed it.
1. all control serial port (without script)
2. command max, then command zero
I wanted to see the speed of the motors, the current of the motors, the motor commands.
These figures are the maximum power for the engine. I gave the commands to the engines one by one to each engine.
I apologize for confusing you.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 20:58

closed loop.
This is the motor current when the motor commands = 0
Attachments
8.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 21:05

These are the different indicators I have now. The direction of the current has become correct, Speed ​​and current have different meanings.. The motors are not loaded. This is an open loop.
First, the motor commands = 100
Then the motor commands = 0
Control without a script, through the roborun program, serial.
I made the commands to the motors sequentially.
First one motor 100 -0
Then the second motor 100-0
The difference between the two motors, the speed of the motors and the current
Attachments
7.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 21:08

The noise level in the current readings has always been like this.
To test the script I added these lines
Code: Select all
 IF (abs(ILeft)<10) THEN
         ILeft = 0
     END IF
      IF (abs(IRight)<10) THEN
         IRight = 0
     END IF 
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 21:11

closed loop.
I did the same actions, the engine commands 100 -0
Speed ​​difference
Motor current difference
Attachments
9.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 13 Sep 2025, 21:16

I think I fixed everything.
I won't do any closed loop tests.
Now I want to make sure once again that the problem is in the motor speed and currents, not in the motors themselves.
After updating the firmware, I see changes, some things are good, some things remain the same, some things have changed places.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Williamclark77 » 14 Sep 2025, 01:34

Vitolds wrote:Will, I only have hall sensors.


For testing, hall only is ok. I suggest good encoders + hall for final use. I also suggest running the auto calibration setup in Roborun after updating firmware or any wiring changes.

I'm glad that you are making progress.

This note is in the Roborun Utility manual. Take care when entering parameters depending on your computer
Attachments
Screenshot 2025-09-13 192332.jpg
User avatar
Williamclark77
 
Posts: 1182
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 11:09

Hi Vitolds,

I have a number of questions and comments about your last few posts. However, to reduce confusion I am going to send these one at a time and wait for your reply to just that one before sending the next one.

First question - what was the difference between these two figures that both say Open Loop?
closed loop 1.jpg

closed loop 2.jpg
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 14:06

This is a photo of a closed loop.
I made it for comparison, between an open and closed loop. With the same settings.
I did it like this.
Action 1:
1 motor - motor commands = 100, then motor commands = 0
I fix the maximum current and maximum motor speed.
Action 2:
2 motor - motor commands = 100, then motor commands = 0
I fix the maximum current and maximum motor speed.
Each time I paused for 2 seconds so that there were no sharp jumps.
The photo shows the difference in the speed of the motors and their currents.
The motors are not loaded (the gearbox is removed).
The difference is big and I don't like it.
The control is done through the roborun without a script.
Attachments
9.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 14:11

This is the state of rest of the engines, the motor commands = 0. (open loop)
It is clear that the current is not = 0. If you make a video, you can see the current surges.
I think that such surges in indicators are bad.
Attachments
8.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 14:15

I don't like it either.

On to my Second comment:

Your pictures of the Run tab show only numerical values, but you have not plotted the graphs of these parameters. You should also show the graphed lines (value vs. time) for the ones you want to follow so that we can get a dynamic idea of what is happening. There is a little arrow at the top of the graph area to start or pause recording. Are the values steady, noisy, or drifting over time? One can't see that with only the numbers for Value, Low and Max.

For example, a value vs. time plot of current (with open loop) would show whether the low and max values you got are rare and that most of the time the values are closer to 0.
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 14:16

This is an open loop.
I did it like this.
Step 1:
1 motor - motor commands = 100, then motor commands = 0.
I record the maximum current and maximum speed of the motor.
Step 2:
2 motors - motor commands = 100, then motor commands = 0.
I record the maximum current and maximum speed of the motor.
I paused for 2 seconds each time to avoid sudden jumps.
The photo shows the difference in the speed of the motors and their currents.
The motors are not loaded (the gearbox is removed).
The photo shows that the maximum current is greater in an open loop than in a closed loop. The maximum speed remains the same. The difference in maximum speed remains.
And here it is bad.
Attachments
7.PNG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 14:20

Yes, of course we need graphs, I agree.
I will no longer do tests in a closed loop, so that we do not get confused.
This test was a quick check. Now I need to understand who is to blame, the controller or the motors.
I think we should ask Will to do the same quick test for the motor speed and their maximum current. We can compare the controllers.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 14:23

Today I will install a program for recording video from the screen. It will be clearer.
Attachments
мотор.jpeg
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 14:34

Now my motor which had a low maximum speed looks like this. I check it.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 15:17

Third comment:

To remove noise in current measurement you did this:
currenr.jpg

Yes, this completely removes noise for current < 10 Amps, but it also completely removes current values less than 10 Amps. DO NOT DO THIS!

There are situations where motor current < 10 Amps is meaningful. Two examples:

1-Going straight ahead at full speed on level ground. In this case, the steady motor current may be just 5 Amps (more or less depending on efficiency of the whole device: motors, bearings etc.). BTW you should use the MotorCompensation: subroutine in open loop)

2-In a steady forward turn and then move the joystick slightly toward center. MotorCurrent will drop or even go negative momentarily and when it's less than 10 Amps, there can be no motor compensation (and TurnMis: might behave strangely too.)

If you do need to reduce noise (and I'm not sure you need to), a better way to do it is to average several readings. Here's some pseudo code for how to do this. I leave it to you to rewrite this for the two motors in Roboteq microbasic syntax.
Code: Select all
TotalMotorAmps = 0
FOR (I = 1 to NumberOfReadsToAverage)
TotalMotorAmps + MotorAmps
ENDFOR
MotorAmps = TotalMotorAmps/NumberOfReadsToAverage

If you try different values of NumberOfReadsToAverage and look at the graph line of MotorAmps vs. time you will see how many reads you need to average to get a smooth line. It may be 2 reads, or 3, or 10, but these calculations take very little time.
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 15:48

I wanted to make you a proposal after I sort out the problems I mentioned above.
But you beat me to it.

Code: Select all
Measures and reports the motor Amps, in Amps*10, for all operating channels. For brushless
controllers this query reports the RMS value.
IF (abs(ILeft)<10) THEN
         ILeft = 0
     END IF
      IF (abs(IRight)<10) THEN
         IRight = 0
     END IF 

0.7*10 = 7
I remove noise up to 1 amp.
This is temporary, I'm not saying that it should be left like this.
I suggest doing the current reading in the same way we read the joystick. In the SetThrottleSteering subroutine.
Do the same for motor 1 and motor 2.
But here's the idea with
Code: Select all
IF (DampingMotorAmps > 1) THEN
       ILeftMotorAmps[JSRead]=ILeft
       IRightMotorAmps[JSRead]=IRight
    JSRead = JSRead + 1
Well, and then on with the code.


I like it
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 15:53

But this might be necessary if all controllers with internal current sensors read it like this.
This is the second thing I wanted to ask Will to do on his controller.
I'll make a video of the current sensor noise, the noise is much louder than the joystick.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 16:05

Working with a current sensor can be beneficial in another way. We can control the current and not let the controller go into protection. All this at the script level.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 17:13

The rolling average done in SetThrottleSteering: is not what you want for noise reduction. A rolling average (averaged over several loop cycles) is used there to damp joystick response. For noise reduction you need a simple average of multiple reads done one right after the other. Here's an example in Arduino C++ taken from my Master module script:
averaging.jpg

However, I do not know whether reducing MotorAmps noise is necessary at all. Whether the noise affects chair behavior depends on two things: the magnitude of the noise and the frequency of the noise. The chair has mechanical inertia and the electronics has processing-time inertia. If the noise frequency is high, those inertia effects will filter out the noise. So, once again, you need to have Roborun plot the motor current values over time.

Here's a picture of the Roborun Run tab with a black circle indicating the refresh rate for maximum resolution and a white circle on the arrow you need to click to get it to graph the values over time.
roborun graph.jpg

Show me the graph of Motor Amps 1 and Motor Amps 2 as you move the joystick, and we'll go on from there.
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 18:15

I'll do it, I need to assemble the motor. I'm waiting for new bearings.
I think that it is not controlled by a joystick, but by a command from the roborun program. It will be more accurate.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 18:23

You can use the Roborun sliders,
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 18:29

I tried to write it. But Google Translate, combined with 'Intellect', translates terribly.
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 18:33

What did you try to write?
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Sep 2025, 18:47

LROBBINS wrote:You can use the Roborun sliders,

What I use, commands - sliders. Or I enter values ​​manually.
Attachments
3.JPG
4.JPG
Vitolds
 
Posts: 672
Joined: 26 Mar 2014, 22:12
Location: Moscow

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Sep 2025, 18:57

You just drag the sliders with your mouse (or touchpad, or touchscreen).
LROBBINS
 
Posts: 5807
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

PreviousNext

Return to Everything Powerchair

Who is online

Users browsing this forum: LROBBINS and 530 guests

 

  eXTReMe Tracker