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 Burgerman » 14 Feb 2019, 11:57

I think he is using a stupid BMS by roboteq which is pretty much identical to every other BMS in that it does all the same crap we dont want or need. So once you move all the safety parameters to setting that dont kick in and stop the chair, then it doesent do anything at all... So not needed!

The other thing it does is help charging. And its as bad at charging as every BMS is. But he is connecting this to the roboteq controller, and its not working. So by removing battery I think he means disconnecting the battery from the BMS... Or something. So maybe a can bus setting or similar.
User avatar
Burgerman
Site Admin
 
Posts: 47391
Joined: 27 May 2008, 21:24
Location: United Kingdom

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Feb 2019, 12:48

look at the photo posted by me
Roborun version (2.0 1.22.19) and controller firmware.
CR1225 can be installed in the GBL controller.
Analog channel 4 is not working.
Now I am making GBL settings in Roborun 1.8.
In version 2.0, the script does not start the engine №2. The team from the console (!G 2 100) works, the script does not (sample script in the photo).
Vitolds
 
Posts: 460
Joined: 26 Mar 2014, 22:12
Location: Moscow Russia

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Feb 2019, 12:57

Burgerman wrote:I think he is using a stupid BMS by roboteq which is pretty much identical to every other BMS in that it does all the same crap we dont want or need. So once you move all the safety parameters to setting that dont kick in and stop the chair, then it doesent do anything at all... So not needed!

The other thing it does is help charging. And its as bad at charging as every BMS is. But he is connecting this to the roboteq controller, and its not working. So by removing battery I think he means disconnecting the battery from the BMS... Or something. So maybe a can bus setting or similar.

Burgerman stop talking nonsense.
I understand the problems of all BMS, but 90% of people do not want a lot of wires.
15s no one charge.
Vitolds
 
Posts: 460
Joined: 26 Mar 2014, 22:12
Location: Moscow Russia

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 14 Feb 2019, 14:57

That's odd, Roborun+ V2.0 is not present on the Roboteq download page. Did they send that specially to you or was it once available for download and then later removed? If so, perhaps someone discovered that V 2.0 is buggy.

What is that button cell CR1225 used for? Just to keep the real-time clock running when the controller is not powered? Obviously having it there or not shouldn't affect basic operation.

OK, what you call Channel 4 is AIn4 in the Roborun configuration tab. What do you have hooked to it and how do you have it configured?
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 14 Feb 2019, 15:43

they sent me 2.0
AIn4 - Yes
I sent the video to robotek, waiting for an answer from them.
Lenny, I understand how to connect roboteq, a joystick is connected.
The fact is, I removed the battery CR - Roborun 1.8 - firmware 2.0 (not betta) = 232 works (USB worked stably), _G works, 2 motor works. I do not want to understand more the firmware of GBL and Roborun, GBL works and that is good.
I think that Roborun 2.0 is a raw version of the program. I can send you a video by email
Vitolds
 
Posts: 460
Joined: 26 Mar 2014, 22:12
Location: Moscow Russia

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby yysnet » 17 Mar 2019, 13:42

[quote="LROBBINS"](2) Motor compensation without current sensors. There is no simple way to sense motor current in brushless motors.

Fortunately for a large number of modern FOC based controllers current measurement is natually within algorithm.
yysnet
 
Posts: 4
Joined: 17 Mar 2019, 13:36

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 17 Mar 2019, 15:25

yysnet,

Can you point me to something that shows how field-oriented control can be used to get motor current?
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby yysnet » 17 Mar 2019, 21:22

When using sinusoidal drive mode, such as in FBL2360, that is virtually a field oriented control or FOC mode. Read _A will give you motor current readings. Safety wise if this reading is faulty the FOC will not work properly anyway.
yysnet
 
Posts: 4
Joined: 17 Mar 2019, 13:36

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby yysnet » 17 Mar 2019, 21:49

or _MA if you would like to use this current for torque control or compensation...
yysnet
 
Posts: 4
Joined: 17 Mar 2019, 13:36

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 18 Mar 2019, 09:21

I'm afraid I still want more information. Is _MA a measured current or an estimated current? If estimated, how accurate is it at low RPM? (Assuming that the motors have an encoder/resolver/sin-cos sensor and are not relying on just the Hall sensors, in which case FOC is not going to work well at low speed anyway.)

Even the brushed motor controllers can estimate motor current from battery current, but the Roboteq firmware's estimation algorithm gives a constant value below 20% PWM. I have been able to improve on that, and my algo works pretty well for motor compensation as long as the power to weight ratio of the vehicle is fairly low, but it really sucks at low speeds if the motors are very powerful with respect to the load.
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby yysnet » 19 Mar 2019, 00:29

Agreed! Have designed a large number of of motion controllers and recently come across this one and found the performance sucks... Probably they will have to sacrifice the performance with easy usage.

The FOC works in any speed. For low speed compensation or kick start, simply use MA for your calculation. I would say the position tracking for sinusoids commutation in this controller are ok for encoder but poor for hall sensors.

FYI MA is a calculated current from measurement that will actually generate torque and moves the motor. This is slightly less than motor current as not all currents are used for generate the torque.

One of the big problem for this controller is limited processing power and control loops needs to be highly optimised for a correct deltaT that matches the control model. In other words heavy loops may not be executed every 1ms.
yysnet
 
Posts: 4
Joined: 17 Mar 2019, 13:36

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Williamclark77 » 28 Jun 2019, 14:40

I'm working on the Arduino display to show the AH used. Since this is Roboteq script related I'm putting it here so others can find it easier..

Lenny's amazing script already has this code to turn Roboteq's internal amp reading to an amp hour amount:

Code: Select all
IUsed:
   IF SuppressPrinting = FALSE THEN
      PRINT ("\n", "READ BATTERY CURRENT AS 10X AMPS \n")
   END IF
   I = GetValue (_BATAMPS)
   DeciAmpSeconds = (I*TimeBetweenAmpHrReads)/1000
   IF SuppressPrinting = FALSE THEN
      PRINT ("\n", "READ stored DeciAmpSecondsUsed \n")
   END IF
   DeciAmpSecondsUsed = GetValue (_VAR, 1)
   DeciAmpSecondsUsed = DeciAmpSecondsUsed + DeciAmpSeconds
   DeciAmpHoursUsed = (DeciAmpSecondsUsed/60)/60
   SetCommand (_VAR, 1 , DeciAmpSecondsUsed)
   IF SuppressPrinting = FALSE THEN
      PRINT ("DeciAmpSecondsUsed = " , DeciAmpSecondsUsed, "  TenthsOfAmpHr used = " , DeciAmpHoursUsed, "\n")
   END IF
   SetTimerCount(1, TimeBetweenAmpHrReads) 'reset timer for next current reading
   SetTimerState(1, 0) 'start timer
   IF GetTimerState (2) = 1 THEN
      IF SuppressPrinting = FALSE THEN
         PRINT ("Value of DeciAmpSecondsUsed sent to display device \n")
      END IF
      PRINT ("999", " " , DeciAmpSecondsUsed , "\n") '"999" lets Arduino know that next number is cumulative durrent
      SetTimerCount(2, TimeBetweenAmpHrOutputs) 'reset timer for sending AmpHr info to display device
      SetTimerState(2, 0) 'start timer
   END IF
RETURN 'End of "IUsed:"


Using it in the Roboteq script will save me a lot of figuring out. What value do I tell the Arduino to look for over serial? "?IUsed"? The Roboteq manual tells how to do runtime queries of values that it manages, but I'm not too sure of getting one from the script? I only plan to have the Arduino query the Roboteq serial every 100 ms. That should be plenty fast enough to give smooth looking readings without overwhelming the Roboteq's serial.

PS.

Lenny,

I tried to download your CANbus system from Google Drive following a link you posted a while back to see how you did it. It gave this message:

Image
WcMade.com - Get nearly anything you need made
Williamclark77
 
Posts: 1012
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 28 Jun 2019, 17:48

I don't know how I deleted the CANbus folder on Google Drive, but I noticed that a few days ago and put it back. However, I just realized that I hadn't set it for open sharing, so I've now taken care of that too. BTW - I have completely stopped maintaining the stuff I'd put on github. Roboteq had asked me to make a github repository to make collaboration easier, but no one ever chimed in and I got tired of working with yet another unfamiliar user interface. I am already finding it confusing enough to maintain my own local copies, archives, & backups for CAN and analog versions and, obviously, have managed to screw up the Drive uploads. If I could figure out how to delete the github repository I would, but github doesn't make doing that obvious.

The deciAmpSecondsUsed is stored in VAR 1, and deciAmpHoursUsed is just that. I don't know if Roboteq has anything other than PRINT for sending information over serial via a script. I've never needed to do that as I send everything by raw CAN. As a PRINT, I guess it would be:
Code: Select all
PRINT (deciAmpHoursUsed,"\n")
and you'd have to figure out how to have the Arduino parse that correctly. Do note that all Roboteq variables are 32-bit, which in Arduino has to be specified as long (though just truncating it to the normal Arduino 16-bit size is probably OK too as long as you aren't doing any calculations with it -- assuming that both use the same bit order, not big-endian in one and little-endian in the other.) Although C has lots of tools for manipulating serial strings, and the Arduino version has some convenient wrappers for those, I find manipulating serial strings more confusing than constructing and extracting CAN messages, probably because it's just not something I've done much of (except inside the Display module's real-time-clock procedures).

I've actually never used the IUsed subroutine so who knows what bugs it contains. In my system I just use CAN to query _BATAMPS and do the accumulation in Master. I've tried to keep the Roboteq main loop as lean as possible since it gets only slices of otherwise unused processor time and it already has to do a lot for motor compensation, acceleration mixing and so on.

There was an error regarding VAR 1 in the analog script used to make the "with acceleration pot" variant, however, and you'll have to patch that. Look for the lines:
Code: Select all
  IF LoopCycles MOD 500 = 0 THEN
  '   PUT ANYTHING HERE THAT YOU WANT DONE ONCE EVERY 500 LoopCycles
    SetCommand (_VAR, 1, 1) 'makes sure serial watchdog is satisfied
  END IF

and remove the SetCommand (_VAR, 1, 1) line. It serves no purpose, isn't needed for anything AND will keep resetting VAR 1 to a value of 1 roughly twice a second. Vitold spotted this error and called it to my attention recently. Thanks.

We start a two-week vacation next Monday and I probably will not be opening the computer as often as usual then, so be patient if I seem uncommunicative.
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Williamclark77 » 28 Jun 2019, 19:47

Thank you. I'd rather query battery amps and do it in the Arduino also. I dislike Google Drive. I don't like some Google applications and most any Apple stuff period.

Don't check in here on my behalf. Enjoy your vacation. I doubt I'll even get that far in the next two weeks. My custom made circuit boards are due next week. I have no idea if they'll be usable. They are simple, but combine learning new software (Autodesk Eagle free) with having no idea what I was doing and my expectations are not that high. I already have the components and can solder quite well when I can put the board within easy reach of my club hands and poor trunk control. However, I can not do wiring or assembly, so that will wait until my better 3/4 is both in the mood to assist and has the time. I bought a real soldering station a few months ago that I haven't even tried yet.
WcMade.com - Get nearly anything you need made
Williamclark77
 
Posts: 1012
Joined: 21 Mar 2013, 01:18
Location: South Mississippi, United States

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby stevelawiw » 13 Jul 2019, 16:27

Hi Lenny,
I can't get access to your google drive, I get a 404 error could you let me know how to access it please?
stevelawiw
 
Posts: 399
Joined: 21 Jul 2012, 20:55
Location: Isle of Wight, UK

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 13 Jul 2019, 17:27

Steve,

Please wait a few days until I get home and have a chance to check that everything there is up to date. (The changes are relatively minor, but there have been some.) I will then post a fresh link.

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

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby stevelawiw » 13 Jul 2019, 18:37

Hi Lenny, thanks no rush, sorry if I disturbed you
stevelawiw
 
Posts: 399
Joined: 21 Jul 2012, 20:55
Location: Isle of Wight, UK

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 13 Jul 2019, 21:27

No disturbance, it's just that living out of a suitcase while meandering about in two countries is not conducive to straight thinking.
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 26 Jul 2019, 10:24

Shareable update now posted on Google Drive

I have just uploaded the latest version of "Wheelchair CANbus controller". If I have done things correctly despite the fact that today's heat makes my brain feel like mush, you should be able to download it at:
https://drive.google.com/drive/folders/1ysOoYG8mwlvJy0023XwJUgclYXbO1ulS?usp=sharing

Please let me know if you can not access it!

NOTE: (1) The analog-only version has had only limited testing and I have gotten little feedback on behavior of either the analog or CAN versions with brushless motors.
(2) Vitold has asked for simple example Arduino and Roboteq programs for retrieving one value from a Roboteq controller via CAN. I will be working on that today and will add them to GoogleDrive as soon as they are done and tested.
(3) DO NOT DOWNLOAD FROM Github. The files there have not been updated. Roboteq asked me to make a Github repository to make collaboration easier, but no one has posted there and I don't want to spend my time maintaining it. If I knew how to delete a Github repository I would do so, but I do not see how to do that. (If any of you know how to delete a Github repository, please let me know).
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby woodygb » 26 Jul 2019, 10:29

An expert is a person who has made all the mistakes that can be made in a very narrow field.
Niels Bohr
User avatar
woodygb
 
Posts: 5737
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby woodygb » 26 Jul 2019, 10:55

Please let me know if you can not access it!
..Yes :thumbup:
An expert is a person who has made all the mistakes that can be made in a very narrow field.
Niels Bohr
User avatar
woodygb
 
Posts: 5737
Joined: 12 Mar 2011, 18:45
Location: Bedford UK

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby stevelawiw » 26 Jul 2019, 12:24

Thanks Lenny
stevelawiw
 
Posts: 399
Joined: 21 Jul 2012, 20:55
Location: Isle of Wight, UK

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 26 Jul 2019, 13:51

Thanks Woody for pointing me toward where Github hides the tools for deleting a repository -- done.
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 28 Jul 2019, 12:00

ANOTHER UPDATE WITH CAN EXAMPLE PROGRAMS
I've added two short programs that illustrate Arduino and Roboteq syntax CAN messaging without needing to wade through the entire wheelchair stuff. They are:

in the Arduino zip -- "CAN_VOLTS_example"

and in the Roboteq zip -- "simple CAN Volts example.mbs"

"CAN_VOLTS_example" posts a 'to Roboteq' query message asking for battery volts once a second and receives and prints the reply.
"simple CAN Volts example.mbs" receives that query and creates a 'to Master' CAN frame containing battery volts and sends it out on the bus.

The Google Drive link is: https://drive.google.com/open?id=1ysOoYG8mwlvJy0023XwJUgclYXbO1ulS
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 28 Jul 2019, 17:27

If any of you had the misfortune to already download the files, do it again. I discovered an error and have corrected it and updated them. The link remains https://drive.google.com/open?id=1ysOoYG8mwlvJy0023XwJUgclYXbO1ulS
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 28 Jul 2019, 17:59

Hello lenny
I understand you correctly that it works only with your library?
Vitolds
 
Posts: 460
Joined: 26 Mar 2014, 22:12
Location: Moscow Russia

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 28 Jul 2019, 19:51

The Volts message only programs don't need any of my specific library files. You do have to have a CAN library compatible with the MCP controller/transceiver chips as well as the (standard Arduino) SPI library. The WC_CAN library in the uploaded files has a lot more than just CAN.H and CAN.C, but you certainly can use it with the example program. (It may be best to use WC_CAN rather than a CAN library downloaded from elsewhere as I may have made some changes - I don't recall that I did, but my memory is not too reliable.)
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 28 Jul 2019, 20:11

In any case, even if you don't have a CAN shield for an Arduino (most of the commercially available ones have the same chips I used - and the sample programs don't use things like the "sleep" pins so e.g. an Adafruit shield should work), these two programs are simple enough that I am sure that you can read through them and see how the CAN messages are built, sent and read. I know that you have the coding skills to do that!

The full multi-node CAN bus programs are another kettle of fish because they have all the coding for controlling a chair - a lot to chew on there.
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby Vitolds » 28 Jul 2019, 22:37

Thank you Lenny.
For those who want to repeat everything in this topic, here's a good thing so as not to get injured and sharply turn off the controller if something goes wrong.
If you purchased the controller, then you are able to understand how to connect this cord.

Image
Vitolds
 
Posts: 460
Joined: 26 Mar 2014, 22:12
Location: Moscow Russia

Re: PINNED - Roboteq Controller - developing for powerchairs

Postby LROBBINS » 28 Jul 2019, 23:24

The CANbus system has a mini audio jack that has to be short circuited for the system to get power. When I first tested the system on Rachi's chair I just put in a shorted plug attached to a shoe lace looped around my wrist. If the chair decided to go off on its own, the plug would pull out just like on that switch you posted. After testing, I replaced that with an SPST toggle switch; not as good in an emergency though it did handle that when a current sensor failed before I figured out how to test for failed sensors in the script. Mostly, it's a simple way to completely recycle the system if the normal on/off programming doesn't work. It's mounted underneath the joystick so it can't be flipped unintentionally, but is still easy to get at. It cuts the low current 24V circuitry and therefore opens the high-current contactor and SPDT relay that powers the Roboteq logic so it turns off all of the micro-computers, including the Roboteq, but the jack and switch themselves only have to withstand a fraction of an Amp.
LROBBINS
 
Posts: 4552
Joined: 27 Aug 2010, 09:36
Location: Siena, Italy

PreviousNext

Return to Everything Powerchair

Who is online

Users browsing this forum: duke1, flagman1776, Google [Bot], teabag, woodygb and 22 guests

 

  eXTReMe Tracker