Basic Micro ARC-32 boards

Documents? :open_mouth: :laughing:

If I were to start guessing, I would start adding a 2 after each command.
ENABLEHSERVO2
HSERVO2
GETHSERVO2
HSERVOWAIT2
You can always try setting the compiler for the board and try compiling it like that and see where the dust lies…

Kurt

Did you get your sample yet? I’m curious about the progress of this board.

Nope :cry: I have not seen one. If I had one, I would hopefully be much better than just guessing :laughing: I have not heard anything new about it since Nathan’s (AcidTech) earlier post.

I believe that Nathan and Dale are busy moving to a larger place.

They have also been working on updating the manual. A recent post by Dale (Basic Micro) stated that he should be working on the manual again starting next week and work on it until it is done. :slight_smile:

During this update of the manual they are also cleaning up some stuff to make the Atom and Atom Pro code more compatable. This is a quote from Nathan from another post up on BM forum:

Kurt

Thanks for the information kurte. I’m sure the sample will come when things settle down a bit. I look forward to seeing more on the arc32.

Yeah yeah… I know there isn’t any official documentation. :stuck_out_tongue: I was just hoping to get some hints of how it work. I’ve not tried the HSERVO way by just adding the “2”. I’m wondering if the HSERVO2 command are more compatible with the SSC32, especially thinking of the group effect.

Maybe I just have to try it out then… :unamused:

Try it zenta… try it! :laughing:

I just did…

But the Studio 1.0.0.15 didn’t like my HSERVO2 command… :angry:

Error: FILE C:\PROGRAMFILER\BASICMICRO\BASICATOM-PRO IDE\MYPROGS\SENSOR TEST\ARC32 HSERVO2 TEST.BAS(LINE 6) : [TOKEN HSERVO2] : Unknown Command

I remember Nathan said that the 1.0.0.15 should support the HSERVO2. Funny, the ENABLEHSERVO2 command seemed to be accepted.

The code I tested:

[code]
ENABLEHSERVO2

HSERVO2 P12\2000\100,P13-1000\100[/code]

Maybe enablehservo2 simply changes the implementation for HSERVO command. That is when you do a simple enablehservo it works like a standard Pro40 but when you use hservo2 it uses the new hardware…

Just a guess

Kurt

oh wait… :blush:
I forgot the brackets…

[code]ENABLEHSERVO2

HSERVO2 [P16\2000\100,P17-1000\100][/code]

Didn’t get the same error this time:

Error: FILE C:\PROGRAMFILER\BASICMICRO\BASICATOM-PRO IDE\MYPROGS\SENSOR TEST\ARC32 HSERVO2 TEST.BAS(LINE 6) : [TOKEN P16] : Syntax Error: Expected variable

variable? why?

This compiles…

Kurt

P.S. - Yah sometimes their error messages are less than clear…

Yes, the HSERVO work fine on ARC32.
This time I tried this code:

[code]servo1 var byte
servo2 var byte

servo1 = 16
servo2 = 17

ENABLEHSERVO2

HSERVO2 [servo1\2000\100,servo2-1000\100][/code]

And got the error: Error: FILE C:\PROGRAMFILER\BASICMICRO\BASICATOM-PRO IDE\MYPROGS\SENSOR TEST\ARC32 HSERVO2 TEST.BAS(LINE 14) : [TOKEN \] : Syntax Error: Expected variable list

Variable list… Ok, I think I’m done doing trial and error. The HSERVO2 must probably require another command format.

as I mentioned, maybe there is no HSERVO2 command, they simply use the HSERVO command.

For example if I switch back to BAP28 and try to build

[code]ENABLEHSERVO

HSERVO [P16\2000\100,P17-1000\100]
ZSERVO [P16\2000\100,P17-1000\100]
[/code]
Obviously there is no ZSERVO command and I get the error:

Error: FILE C:\USERS\KURT\DESKTOP\LYNXMOTION\XXX.BAS(LINE 4) : [TOKEN P16] : Syntax Error: Expected variable

You probably got a point there.

But:

So this is wrong then?

Have you tried it with simply the HSERVO command and plugging in 1 of your 100s of servos, and see if it works? :slight_smile:

Maybe they listened and tried to make it easier for people to have programs that work on multiple platforms. That is you should be able to go from a BAP28 to a BAP40 to an Arc32 without having to redo everything. However assuming this is correct, if memory serves me correctly on a BAP28 if you do a HSERVO[p10\500] and do the same on a BAP40, they will not position to the same place. That is the command is influenced by the processor speed. This is talked about in the thread: viewtopic.php?f=4&t=3224&start=17

Well now back to my playing… Received my $10 RC remote. In the process of tearing it apart. Then will see how hard it would be to make a real cheap DIY remote (other than the price of the BAP and LCD). May see if I can find enough places on the case that make sense to stick 20 push buttons to emulate the keypad… Of course I could try to tear the joysticks out and use a different case, but…

Now back to the regularly scheduled channel… :slight_smile:

Kurt

Wait, hold this channel for just a sec. Got a picture of this $10 hackable remote? :laughing:

I will probably take this to a more appropriate thread, but I thought I would see how hard it would be to build another remote, so I was looking for the gimbals and found: hobbypartz.com/4warcratr.html
For the price I thought what the heck, see what I can do with it. So far I have must of the guts out of it. Will see if I can fit the BB2 with BAP and XBEE on sparkfun regulated explorer. There are 3 other switches on the front that hook up to nothing. There is a battery holder that holds 8 AA batteries. May see about rigging it so it takes a few less to drop the voltage down… Not enough room to hold a 16 switch keypad or sliders, etc, but can probably add some pots and several switches… Will need to hack my transmitter code to work, but that should not be hard…

We will see. This is a low priority… Will continue on a better thread once/if I get any where…

Kurt

100? Good guess :wink:
Yes I did try ENABLEHSERVO2 and simply using the HSERVO with servos connected. And that worked fine. But I was hoping to see a group move command, like the one we get from SSC32. With the HSERVO command the servos doesn’t reach the goal position at the same time.

Yes the SSC-32 makes it automatic. However it is not hard to do with the HSERVO command as well. The best place to look is at the BRAT code with the function called Movement, with its few sub functions. For each servo passed in the HSERVO command you can pass in a SPEED variable. This is in some funky value, like how many units to increment per SERVO refresh pass and there is something like 50 refreshes per second… You might also look at the movement function in the Rover with Arm code as I can not remember if this version was converted to Integer math… (Or maybe I am the only one that has that one… :wink: )

In a nutshell it works like this:

  1. Remember your last posisition for each servo in the move. Note: the Brats movement remembers angles…
  2. Calculate the Delta for each servo
  3. Calculate the speed for each servo depending on the time value passed in.

a) The function in Movement does it by first finding the max delta and then figure out the largest speed value
Max Speed = (Max delta * steps per degree)/(Time / 20.0) (this is all done in floating point)
For each servo then speed = DeltaAngle/MaxDeltaAngle * MaxSpeed

b) This can be simplified for each servo as: (DeltaAngleStepsPerDegree20)/Time -

Note: this is how I do it as I got rid of floating point and remember the value of angle*steps per degree and I keep it in 10ths of a unit…
Also off topic note: I understand all of this stuff pretty well now as I am currently implementing something similar to this on my Axon2 Brat, which is implemented in C. I currently have the basics of it working, with it taking to the remote with XBEE and walking, but currently it is doing each movement in the main loop, which is helping me debug. Next step is to have it return before done, but each call through the loop will check to see if it is done and then issue new command. Then the next step is to move that to timer interrupt… Sort-of fun as all 7 servos are on hardware PWM pins, plus XBEE and USB to debug terminal are all running with hardware USART… Again I will open up a different topic on this…

Kurt

Thanks for the input Kurt! Do you know how much this function cost for the overall speed of the mcu?

Sounds like your having fun :wink:

Would you mind sharing your ARC-32 version of the Phoenix code? I’m mostly interested in the HSERVO(2) routines.

Maybe there should be made a HSERVO2.bas file that could be included in a project file for easier use?

Since I already had to take some pictures for Jim of my T-Hex today, I just had to take a little picture of my red board connected to a LCD:

:smiling_imp: