Problem BAP beta or Vista or?

Thanks, that is one strong possibility. The other may be that I am just getting unlucky timing wise in my code and when the -1 is being sent, the atom pro may not be waiting the full time in the serin. When I get back to it, I may try to add more handshaking, maybe in the loop the bap outputs a prompt to the PC and the PC outputs something right after that. Or some such thing.

But currently trying to see why the HSERVO being generated by the TV brat does not appear to making the servos move the way I expect them to. There may be two servos reversed (an ankle with a hip maybe), but for example the step function is moving real slow through the functions and the angles and the like do not look at all right. Like it is trying to put a foot through the BAP board that is hung off the back of the brat and the max angle of any of the servos should only be 20 degrees, but it is trying to move a lot more, until it hits the limits of the brackets…

The requested moves (calls to movement) look like:

[code]Movement: -7.0000000000 20.0000000000 20.0000000000 7.0000000000 -20.0000000000 -20.0000000000 500.0000000000
-1166(46) 3331(133) 3331(133) -1166(46) 3331(133) 3331(133)

Movement: 7.0000000000 20.0000000000 20.0000000000 -7.0000000000 -20.0000000000 -20.0000000000 500.0000000000
1166(93) 3331(0) 3331(0) 1166(93) 3331(0) 3331(0)

Movement: 7.0000000000 -20.0000000000 -20.0000000000 -7.0000000000 20.0000000000 20.0000000000 500.0000000000
1166(0) -3331(266) -3331(266) 1166(0) -3331(266) -3331(266)

Movement: -7.0000000000 -20.0000000000 -20.0000000000 7.0000000000 20.0000000000 20.0000000000 500.0000000000
-1166(93) -3331(0) -3331(0) -1166(93) -3331(0) -3331(0)

[/code]
Note these tables are Right Ankle, Knee, Hip and then Left Ankle, Knee, hip and speed

The first line is the degrees. The second lines are the actual values passed to hservo with the number in parentheses the speeds. Each movement takes several seconds and appear to go through several gyrations. I will try to convert this output to a simple test program.

The real question is, is this issolated to my BRAT?

James has two BRATs set up for the TV remote control. He can test your code as a reality check. :smiley:

You didn’t happen to use the same configuration as the original article did you?

righthip con p15
rightknee con p14
rightankle con p13
lefthip con p12
leftknee con p11
leftankle con p10

Thanks Jim, I actually moved off of the default servos as I was trying to free of the hardware serial port. Actually it would be good for James to try your current brat code with the current beta and see if it is working properly or not. IE if you hit button 2 on the remote does it make a reasonable step.

Here is an extracted code that simply calls movement with the calculated, values for speed and servo location. He should easily be able to change the servo pin number constants and the number of servo groups to make it work on the default pins…

Note, I think I am still using all of the default calculations. I was wondering about the calculations from Angle to HServo value that used a constant of 166.6 steps per degree as the HSERVO value in the manual goes from -12000 to 12000 so if I wanted 90 degrees it would give a value of 14994… But that could simply be a documentation issue…

Now back to the code:

[code]debug con 1
; Try TV Remote Brat taking one step forward with HSERVO. Nothing else in the program

;System variables
righthip con p11
rightknee con p10
rightankle con p5 ; was p9 but that is speaker
lefthip con p8
leftknee con p7
leftankle con p6

;Interrupt init
USE_HSERVO con 1
HSERVO_GROUPS con 3
ENABLEHSERVO

; We simply want to emulate the gosub movement command for one step forward
; we will precalculate all of the speeds and the like
; if(command = 1 or command = 116) then ;(Button 2 or joystick up) Walk Forwards
; RA RK RH LA LK LH SPEED
; gosub movement -7.0, 20.0, 20.0, 7.0,-20.0,-20.0, 500.0]
; gosub movement 7.0, 20.0, 20.0, -7.0,-20.0,-20.0, 500.0]
; gosub movement 7.0,-20.0,-20.0, -7.0, 20.0, 20.0, 500.0]
; gosub movement -7.0,-20.0,-20.0, 7.0, 20.0, 20.0, 500.0]

;Movement: 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
gosub movement [0,0, 0,0, 0,0, 0,0, 0,0, 0,0]
pause 2000

;Movement: -7.0000000000 20.0000000000 20.0000000000 7.0000000000 -20.0000000000 -20.0000000000 500.0000000000
gosub movement -1166,46, 3331,133, 3331,133, -1166,46, 3331,133, 3331,133]

;Movement: 7.0000000000 20.0000000000 20.0000000000 -7.0000000000 -20.0000000000 -20.0000000000 500.0000000000
gosub movement [1166,93, 3331,0, 3331,0, 1166,93, 3331,0, 3331,0]

;Movement: 7.0000000000 -20.0000000000 -20.0000000000 -7.0000000000 20.0000000000 20.0000000000 500.0000000000
gosub movement [1166,0, -3331,266, -3331,266, 1166,0, -3331,266, -3331,266]

;Movement: -7.0000000000 -20.0000000000 -20.0000000000 7.0000000000 20.0000000000 20.0000000000 500.0000000000
gosub movement -1166,93, -3331,0, -3331,0, -1166,93, -3331,0, -3331,0]


pause 2000
gosub movement [0,0, 0,0, 0,0, 0,0, 0,0, 0,0]

loop
goto loop

;Should never need to edit anything below this line. Add user subroutines above this and below main.
lefthippos var sword
leftkneepos var sword
leftanklepos var sword
righthippos var sword
rightkneepos var sword
rightanklepos var sword
lhspeed var word
lkspeed var word
laspeed var word
rhspeed var word
rkspeed var word
raspeed var word
movement [rightanklepos,raspeed, rightkneepos,rkspeed, righthippos,rhspeed, leftanklepos,laspeed, leftkneepos, lkspeed,lefthippos,lhspeed]

#ifdef DEBUG
serout S_OUT, i2400, |
sdec (rightanklepos), “(”, dec raspeed, ") ",|
sdec (rightkneepos), “(”, dec rkspeed, ") " , |
sdec (righthippos), “(”, dec rhspeed, ") ", |
sdec (-leftanklepos), “(”, dec laspeed, ") ", |
sdec (-leftkneepos), “(”, dec lkspeed, “) “, |
sdec (-lefthippos),”(”, dec lhspeed, “)”, 13, 10]
#endif
hservo [lefthip\lefthippos\lhspeed, |
righthip\righthippos\rhspeed, |
leftknee\leftkneepos\lkspeed, |
rightknee\rightkneepos\rkspeed, |
leftankle\leftanklepos\laspeed, |
rightankle\rightanklepos\raspeed]

hservowait [lefthip,righthip,leftknee,rightknee,leftankle,rightankle]

return
[/code]

I used the current beta, and the BRAT code, and all the commands work

I used your code, and the bot takes a step forward. I’m not having any problems with either bit of code, or the Atom-Pro IDE beta

Great. Did you try it with the same Servo numbers or I am guessing that you updated it to your servo numbers.

So it is my assumption that it is either:
a) My hardware/software has become flaky. I will try downloading the beta software again.

b) Maybe which servos are used. I will rearrange to the original brats configuration and see if things get happy. I will probably try this first as it is the easiest…

Thanks again

Yeah… I changed them around, forgot to mention that…

Oh yeah, I also commented out “HSERVO_GROUPS con 3” which prevented the program from working… (at least for me)

That probably should have been in the original reply… :confused:

Which version of the IDE are you using?

If I use 8.0.1.6 I get the results I mentioned. If I use 8.0.1.6exp, my test program appears to work, but when I go to the brat, I get the beginning of the first step and then it is like it hangs as also servos go limp.

EDIT: If I run 8.0.0.0 which I still have loaded on my machine. They both work fine. So my guess is still problems with HSERVO command

Well… I thought I was using 8.0.1.6exp, but it seems as though it didn’t install even though it said it did… :confused:
It says I’m still using 8.0.1.3…

I’ll give it another shot tomorrow, sorry about that, my mistake :blush:

You have to be real careful when you install multiple version of the IDE. You could end up with a mish mash of different versions of different files which could be explaining a lot of your problems. Note that 8.0.1.6Exp is for people to test there already working code on to see if the expiremental version of HSERVO in it works. If you code doesn’t work with 8.0.1.6 it is not going to work with 8.0.1.6Exp.

I also tested the brat code in the IRPD thread and everything worked as it was posted(remote and servos functioned as it should have).

I HIGHLY recommend you completely remove all versions of the AtomPro IDE. Then install just one version at a time until the problems you are seen have been correctly diagnosed.

P.S. I hate Install Shield but it’s pretty much the only game in town. :frowning:

You could install each IDE. After each is installed move all the files installed to the AtomPro IDE directory in the ProgramFiles folder somewere else(or just rename them appropriately). No files are installed anywere else so you don’t have to worry about that. You just want to make sure that other installs don’t install over top of each other leaving random versions of files. For some reason Install Shield(even those I set it to always overwrite older versions) still insists on sometimes leaving older files. Thats why I always recommend uninstall the old version before installing the new one.

In between each of these runs I did a complete uninstall of the Atom Pro IDE. I have 8.0.0.0 still up there as you used a completely different directory. (I also keep 8.0.0.0 around as HSERVO and serial output worked well on the earlier beta)

I do have the downloads for different versions in my download directory, so I can switch to different releases. I wish you had an option in your install/uninistall that would allow you to save your personal preferences. Things like history, comm settings and the like, but that is a different story.

I have sent you an email with a video of the brat trying to run the simple program earlier in this thread, which is the same as pressing the 2 on the remote (or take one small step forward). I have verified that the same code works as expected on 8.0.0.0. James(Fish) said it worked on 8.0.1.3, but I believe that this was a version that hservo trashed registers which one symptom was serouts hanging the machine.

It would be good if you could try running the simple test program on 8.0.1.6 so you can debug it… Note: last night I did reconfigure my brat again to be back to the default pins that Jim posted and commented out the HSERVO_GROUPS, unplugged the other servo and I2C components and it still acts very wierd!!! I guess I will probably move on to something else until this is resolved.

Thanks

Ok, now that I actually have 8.0.1.6exp installed, I can say that I couldn’t get either program to work…

When I use your code, it looks like the robot has a temper tantrum and then goes limp :laughing:

and when I use the BRAT code, it goes into seizure mode when you press a button

Thanks, that is the same as I was seeing! Yes it sure was having a temper tantrum. I sent Jim an email last night with a poor quality video of it. I had a higher quality one but did not want to sent 10+MBs. When I tried it on 8.0.1.6 it did not go limp but stayed in the tantrum :laughing: for awhile…

Hopefully AcidTech will have a chance to look at it soon as it is confirmed on a couple of machines.

Kurt

I’ve seen the video and I’ve seen James results. They are not acting the same. We are going back to 8.0.1.6 and testing more with it.

Ok, I tried both programs using 8.0.1.6 (not exp this time)

Kurte’s code and the BRAT code (when I tried to make it take a step) both made the robot curl up and swing the right leg while moving the right ankle to odd angles… weird…

I am also using 8.0.1.6 at present, and am seeing somewhat erratic behavior. I get the Hip and Knee servos locked into place pretty well, but they oscillate a bit and do not settle down until I attempt to move the servos manually.

I have seen my brat’s ankle servos do as you describe, but they are not doing that now after I rearranged my code a bit. I can get completely different behaviors, depending on where I have things arranged in my code. This acts like a memory accessing problem of some sort - maybe something is getting over written that shouldn’t be.

8-Dale

Been chatting with Nathan. He is aware of a problem with hservo and 8.0.1.6. He told me he will look at it tonight. I personally programmed one of our BRAT’s with 8.0.1.3 and it’s working, but I don’t remember what problems 8.0.1.3 had. I’m just trying to get you an IDE to use in the meantime.

Sounds good. I believe 8.0.1.3 was one of the builds that HSERVO appeared to work on it’s own, but a serout may hang the processor. Something about a register being corrupted in hservo.

I have had the best luck with 8.0.0.0, but I don’t think that one is available anymore. But hopefully he will find the problem tonight and have the fix for it.

In the mean time I may spend some time on the Rover, trying to hookup the 4 inputs from the two encoders and see if I can reliably determine how far it has gone.

(I am a little worried about one of the encoders as the power line to the servo fell out when I was building the rover and while I was resoldering it back in (Jamb in to below the encoder board and try to get solder in from above, The motor runs, but I am afraid I may have damadged the encoder). But that is another story…

They’re out of stock, but I have a few laying around, so let me know. I will take care of it. 8)

Thanks Jim, you are a great company. I finished making the connectors, and have them hooked up to P16-P19 with 18 and 19 connected to the first encode level of each encoder. I will try using IRQ2 and IRQ3 to get these. At first one did not look like it was working but I think my Oscilloscope connection below it or my poor job of making connectors may have gotten in the way. But once I pushed it down some more it appears like both are working :smiley:

Now it is off to coding! Thanks again and I supposed I should not hijack my own thread.