Microbasic code library?

2 years 6 months ago #29533303 by Erik
Is there a code library somewhere on the web for microbasic? Something like there is for Arduino where you can find any code you need.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533306 by blake
Replied by blake on topic Microbasic code library?
Hi Eric,

We have some MicroBasic sample scripts available on our website in the Downloads Center

Our full description of MicroBasic is in Section 18 of our User Manual . Our full commands reference is in Section 19 of the manual.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533310 by Erik
Replied by Erik on topic Microbasic code library?
Thanks Blade!
I had to install Cinema Magician to view the files but at least it works.

I want to use this example but for the closed loop speed position mode (that's what i use for lawnmowing). My robot makes noise and sends pulses to the motors when the robot is standing idle, it tries to get on the exact position i guess but can't do it for some reason.

How can i use this example to use the speed position mode instead of speed mode?

' This script is provided "as-is", without warranty of any kind,
' expressed or implied, including but not limited to the warranties of
' merchatability, fitness for a particular purpose and
' noninfringemement. In no event shall Roboteq be liable for any claim,
' damages or other liability, arising from the use of the software."

' Changes configuration between open loop and closed loop speed mode depending on motor command.
' When command is 0, controller is switched to open loop to save energy. Switches to closed loop
' when non-zero command

print("starting ... \r")
top: ' label header
if(getvalue(_M, 1) <> 0) ' Read throttle motor command
setconfig(_MMOD, 1, 1) ' switch to closed loop channel 1 motor if command is different than 0
setconfig(_MMOD, 2, 1) ' switch to closed loop channel 2 motor if command is different than 0
else
setconfig(_MMOD, 1, 0) ' switch to open loop channel 1 motor if command is 0
setconfig(_MMOD, 2, 0) ' switch to open loop channel 1 motor if command is 0
end if
wait(10) ' wait 10 mS
goto top ' return to label header top:

Also it would be nice if other users can place their code on this forum as well so we all can learn from eachother...like Arduino does. It will be better for everyone if this was just on the forum and without needing that Magician file-viewer.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533311 by blake
Replied by blake on topic Microbasic code library?
The MMOD configuration command is described in our user manual on page 328-329.

It is not necessary to use Cinema Magician. MicroBasic .mbs files can be opened in the scripting tab of Roborun+ or in Notepad++

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533312 by LROBBINS
Replied by LROBBINS on topic Microbasic code library?
Or in pretty much any other text editor or word processor. For example, I use WordPerfect when I want to compare two mbs files or even two profile xml files.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533313 by Erik
Replied by Erik on topic Microbasic code library?
Alright, thanks.

I have a brandnew pc with win10 full version but it couldn't read the files...i let it find the solution and it came up with loading magician...don't even know if i still have notepad.

But it would be nice if there were many more examples and if other forumusers could post theirs as well..i still have to install the steering code you wrote LRobbins....my robot drives very well on very low speed but when i only use steering (command 2 in mixed mode) it makes a too fast turn. When i put drinks on it they slide off when making a corner. I have somebody who wants a robot to serve drinks/snacks so i'm testing mine for that now.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533314 by LROBBINS
Replied by LROBBINS on topic Microbasic code library?
The script I've written includes separate range settings for fore-aft speed and rate of turn, so you may find it useful. Do download the latest release at drive.google.com/open?id=0B3svXvyPGRgral9FU2lJZlpHdFU

Ciao,
Lenny

P.S. Win10 still has Notepad as well as Wordpad if you'd like a bit fancier formatting, but if you actually want to write code you should get used to using Roborun+ as it has various helpful tools such as syntax checking and so on.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533315 by Erik
Replied by Erik on topic Microbasic code library?
Yes i save your code already, cheers. I think for wheelchairs they also would like to make slow smooth turns on the spot instead of a fast one.

Roborun makes my laptop hot, the fans make noise what they never ever do, no matter what programs i run. So i don't use it much..And version 1.8 i don't use yet, i want you guys to find the bugs first haha.

I need software so my robot can drive a fixed route on it's hallsensors-countings in closed loop speed position mode. And on top of that the program has to learn the route from the commands i give by rc-transmitter. So i teach the route once by rc and it can drive that by itself after that.

Maybe there's a program like that for Arduino already so i can use that or i have to write it myself.

Please Log in or Create an account to join the conversation.

2 years 6 months ago #29533316 by LROBBINS
Replied by LROBBINS on topic Microbasic code library?
I am surprised that Roborun overtaxes your laptop. I have used it on laptops ranging from a 10 year old HP convertible tablet through my current Fujitsu T902 with no problems at all.

A note about v. 1.8. It has some useful new features, BUT you would also need to purchase a license to use it to download programs to a controller, so do not throw away your copy of 1.7. 1.8 still does have some display navigation problems with wide-screen laptops, but otherwise seems to be bug free.

This sounds like a very ambitious project. You write of speed position mode, but I think that is not what you want to follow a pre-defined route. It is a way to get constant speed operation at low RPM. To go to specific positions using counts you will need one of the position (absolute or relative) modes. I do not know if you will be able to combine that with the adjustable speed and turn rates and acceleration mixing that are in my script and certainly have no advice to offer for doing that.

Please Log in or Create an account to join the conversation.

2 years 6 months ago - 2 years 6 months ago #29533317 by Erik
Replied by Erik on topic Microbasic code library?
Roborun 1.7 is not in the downloadsection anymore....so if i didn't keep a copy of 1.7 myself i had no other choice than using 1.8 and would have to pay (for a license) if i upload code to it?
That's new for me and i guess i understand this wrong, isn't it? I had 1.8 installed but got strange problems so i went back to 1.7 which works fine.
So if i buy another new fbl2360 (for the guy who wants the servingrobot) i have to buy the license to use the scripts in the downloadsection?

My laptop has 16GB ddr4, pentium i7 quadcore, gpu with 2 GB and everything topspecs...yes it gets hot and the fans start running noisy after 10 seconds using Roborun...it's a Lenovo Yoga 720 topmodel. There's really something wrong with Roborun and they even didn't fix that.

Speed position mode (like i use now but still with rc-control) works perfect for very low speed (the robot is a lawnmower and sweepmachine)..Speed of 10 rpm is no problem and when i give a steeringcommand while blocking the robot it will use force to push me away since it wants to go to that postion from the steeringcommand. I assume that it wants to go to the counted position from the steeringcommand. Haven't tested it yet by a script because i got errors and strange behaviour when i only gave a motorcommand in the console...i don't want to waste time finding more bugs but the person who ordered this robot wants it to be automatic, not an rc-lawnmower so i'll have to fix that for him anyway.

Without speed control i can't use this robot for lawnmowing or floorsweeping. It will go 30 km/hr. And without positioncontrol it will drive over the lawn/driveway like a drunk chicken.

Blake advised me to use this mode for this robot and so far it all works well but on rc-control in closed loop speed position mode. I even can use lower than 10 rpm without any issue. I use it on 15 or 20 Amps now which is perfect for climbing ramps or doorsteps. Nothing gets warm so far but if i look at the 3 thin wires which go to the hubmotors i'm not sure if 20Amp isn't too much...i use a fuse of 10Amp for both motorchannels together and that has never ever blown...i don't know the specs of my motors, they came from a balanceboard with 10" hubmotors. At 20 Amps i sure have enough power for anything, can drive over any obstacle as long as the wheels aren't too small for it.

I do think that speed position mode is a mix of speed mode and position mode which is awesome...isn't it funny that we both don't know what each mode exactly is?? I have this controller for a year now and you also seem to be an experienced user.

I also have tried the other modes but that was before the wrote the new software for my controller, the old one caused a lot of erratic behaviour and also the manual caused me loads of issues by giving wrong info about the PID-settings for my motors. That's all fixed now by the roboteq team which is great.

IIRC you were using these controllers for wheelchairs right? I guess (not sure though) you can program the wheelchair to drive the route automatic, or just copy the route (the route to the parc for example) and the next day your wheelchair can drive itself while you sleep in it. Add some sensors to avoid crashes and there it goes haha.

My project is even more ambitious, i ordered a Udoo x86 Ultra which can run win10 and also has arduino onboard. That computer i'll connect to my Kinect2 camera and than i can finally do what i want. It will respond to voicecommands, gestures, can see 3d, recognise voices and faces and so on. So i can tell the robot to follow me and it will, or tell it to go lawnmowing or sweeping and it will. Or it can walk the dog through the parc while i sit at home and watch the images of it on my tv/laptop.

In speed pos mode it's not easy to pull the robot of it's position so it can walk a small dog when the leash is connected to the robot. If i had stronger motors i could use higher amps and then it can even walk bigger dogs i guess. But i bet that if i let it walk a small dog there'll be people here asking me to build one for them (they sure can afford it).

Now the robot can do lawnmowing on rc and the sweepingmachine (a trawler which it can connect by itself and also power it) but i still didn't connect it to the Arduino, still have to solder the interface. Than i'll place the Udoo X86 and the camera and the real fun will start. What i built now is all perfect, i'll put a pic here so you can see it.
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.147 seconds