Ardiuno powered Scout

Hi everyone,

Im Matt from the UK and have just taken delivery of an LM scout.

Ive built it all up with HS422 servos, an SCC-32 and the brain is an Ardiuno Mega.

I have the servis ‘under my control’ as it were, and have got it setting to a nice rested position as well as standing tall, now its on to walking…

I have had a loo at the source of the other chaps (the one with vids) which is in basic Atom. Can anyone lend a hand translating it to C for the Ardiuno?

I know a bit iof basic and C (degree in comp sci a few years ago…) but didnt want to start if it simply wasnt going to work.

Translating the movement subroutine so far I have:

Original Atom basic:
Movement [SeqIndex]
For Index = SeqPos(SeqIndex) to SeqPos(SeqIndex + 1) - 1
TmpServo = Steps(Index) >> 11
TmpValue = Steps(Index) & 2047
if LastServo = TmpServo then
TmpValue = TmpValue << 5
if DejaVu then
Pause TmpValue
LastServo = 99
else
serout p15,i115200,“T”, DEC TmpValue, 13]
DejaVu = DejaVu ^ 1
endif
else
TmpValue = TmpValue + 500
serout p15,i115200,"#", DEC TmpServo, “P”, DEC TmpValue]
DejaVu = 0
LastServo = TmpServo
endif
next
return

Now my C code:
void movement(int SeqIndex){
int TmpServo=0;
int TmpValue=0;
int LastServo=0;
int Dejavu=0;

// For Index = SeqPos(SeqIndex) to SeqPos(SeqIndex + 1) - 1
for(int Index=SeqPos[SeqIndex];Index<SeqPos(SeqIndex+1);Index++){
TmpServo=Steps[Index] >> 11;
TmpValue=Steps[Index] & 2047;
if(LastServo==TmpServo){
TmpValue = TmpValue << 5;
if(Dejavu){
delay(TmpValue);
LastServo=99;
else
Serial1.print


I thought Id stop there before I go to far down the wrong route, especially if someone has a ‘gait list’ of frame positions, or can someone extract the gait list from the sequence at the start of the bas file. 9For reference, the bas file I am working from is the one provided here:

viewtopic.php?f=20&t=2827

Any help much appreciated!

Cheers, Matt

Ok,

I have decided to buy the atom Pro and Bot Board and use the other chaps software for the gaits and so forth.

The Arduino will ‘command’ everything over general digital IO as I believe the Basic Atom Pro only has 1 USART which will be talking to the SCC-32…

Attached is a small vid of the robot standing up and crouching on Arduino and SCC… I think I blew a knee servo as well as it just twiches, but plug in another servo and its fine so I have also ordered one of those to replac it. They are only HS-422s so quite weak I believe (I am running a 5v supply) so if I start to see some good results I will spend some more money and upgrade the knee, ankle and hip servos to give the length for ‘lifting’ strength…

Updates in a couple of days when the Atom and BB2 arrive :slight_smile:

Matt

Fail… No vid. :frowning:

ergh iuts bigger than 2mb :frowning:

Just post it on youtube and then you can send us a link here. :stuck_out_tongue:

youtube.com/watch?v=iuZ-GDaqijY

My neck hurts…

Otherwise, cool. :stuck_out_tongue:

Any pin on the Atom Pro can be a serial port.

lol cheers… Looking forward to receiving my botboard. I think I will send the RS232 out to my PC and record the gates, make them into a seqiuence and use the arduino to then relay them to the SSC.

Bit of a waste of £80, but no one seems to have any gates or sequences anywhere, apart from what the chap did in BasicAtom stuff… unless someone can read from this source and make me a sequence list of servo positions??

Attached is his source.

Cheers for the help!
Matt
runturnwall.bas (8.84 KB)

Ah excellent, I can save some IO then :slight_smile: Maybe it would be better having a standalone motion controller…
I can always have a ‘pass through’ command, such that the arduino can send an SCC command via the botboard for an interupt etc movement…

Ok,

So I have installed my botvoard and loaded the gait code… removed the battery checks and sharp distance checks so the robot should ‘walk’

Its doing some random things… Its ‘trying’ tp walk I can say that much, but this all so far seems like a big waste of effort!

Does ANYONE??? Have a gait list (of servo positions) that uses the recoomended servo connections as per the LM 6DOF assembly instructions as I just cannot seem to get this thing to walk and it is VERY frustrating!

Cheers in advance…

Could you provide an image or two of the bot taking care to provide close ups of the boards and wiring? There are a lot of things in this area that can mimic code issues. In other words it might be a power supply related issue making it look like the code is the problem. Troubleshooting is a process of elimination. Let’s establish you don’t have any wiring or jumper issues.

Jim,

Thanks for getting back to me.

It does the stand up and bow part of the routine, so I can assume that the comms as well as servo wiring is ‘ok’.

I’m going to rego through the atom code and check that my modifications havent caused an issue.

I’ll post a vid shortly chaps :slight_smile:

Cheers

Looks like the problem lies with the SCC… a couple of the servos are ‘lifeless’ and have tried working servos from other channels on those dead channels and no effect from them. All channels are set to 1500 to give them centering load…

New SCC I think… argh!

Ok…

So I traced my so called SCC fault to a servo pluged in the wreong way round, doh!

Did this, and am now setting the robot to ‘stand’ (position/movement 13 in the gait code).

I am now going to physiucally move the servo spindles such that the ‘stood position’ matches the video stood position, that should sort the ‘base’/offset calibrations for my servos.

Out of interest, the HS-422 seems not really up to the job for this Biped, any reccomendations, baring in mind im not on an infinate budget and have soend nearly £500 already to get to this point!

Matt

The 422 is one of the weakest Hitec servos. The 5485 is a decent servo, but even it is slightly on the anemic side. You could use it if you tethered the power, I.e. no battery on board. The 5645 is the servo of choice for the Scout. Very sorry to say it’s $54.99 each. The better choice would be the 5685 which is the same thing only it accepts 7.4vdc directly. It’s $56.95. Sorry man…

Jim,

Thats not really too bad to be honest. I’ve seen some servos that are $200+

I think i will buy 6 of the 5685 (for the knee and 2 servos either side giving it ‘lift’ power) as the twist of the hip and ankle are under a lot less momental stress.

Its my birthday next week, so the mrs now knows what shes getting me!!

Cheers Jim,
Matt

These are the servos I’m going to go for as per your advice. Its shocking really how weak the 422 is compared to it, more than 3x the torque!

On the plus side I have 6x422s for sale if anyone wants then for tilt pan heads or something that dont require much power?

Matt

I’m watching this with interest, I’m using a Scout with TowerPro servos (I know they aren’t good, but I got them for $5 each and can afford to blow a few, and I know they are jittery as hell, I just want to test some code)… I’m using an Arduino Mega too, directly driving the servos from a Motor Shield.
I have a 7.4v LiPo battery for the servo’s (a hefty one) and separate LiPo for the electronics. The plan is to have the weight as low as possible.

I already have it standing and holding position (though it does have ‘Parkinsons’ due to the servos) and aim to get an IMU and Gyro included with a Kalman filter to stabilise the unit before I start to make it walk.

I guess I need to accept a degree of error due to the servos (they aren’t that bad really) but if it stands up on it’s own I can start to experiment with COG and walking.
My ideas for movement are a set of subroutines that will accept a parameter, MoveForward 1cm, TurnRight 1 degree etc. Once that is completed I may port the code to a smaller Arduino on an I2C link to the Mega (a co processor shield) which will then operate a sensor tier and possibly wireless to another mobile unit or computer.

The purpose of this unit is to test code and get better at programming (it’s been years since I did C in anger and I prefer 6502 assembler), prove my theories and assumptions and ultimately deliver a map of any room it is placed in (wall detection, object detection and placement etc) so I may need more processing than the Arduino can provide, but, it’s a goal and I think many projects fail or stall because there wasn’t a stated goal to start with.

Beowolf,

Did you ever get very far with your project?

I am just about to order some decent servos for mine, however I may go over to a hexapod chassis as getting this thing to ‘gait’ properly is nightmare!!

Matt