Go Down

Topic: Cheap caterpillar robot platform restrained at custom office (Read 3556 times) previous topic - next topic

HermannSW

I have done >200 China orders (mostly aliexpress.com, sometimes banggood.com) in the last two years, mostly with free shipping. I ordered microcontrollers, motors, electronic components, ... and all (but two) arrived without issues at my home. They contained a stamp "freed from customs clearance" because they were too cheap.

Last week I got mail notification that one of my orders was restrained at Heidelberg custom office. They did not believe the value mentioned on the parcel (8$), and the size of the parcel got their attention. On the phone they explained that often plagiarising products are sent this way from China, and those are prohibited.

They were right with the value, the caterpillar robot platform did cost 22.90$ (only), but that was less than the value where I would have to pay German VAT.

I should bring my bill with details and open the parcel in order to decide how to proceed.

On Friday morning I took train to Heidelberg, presented the detailed bill, opened the parcel, and had to pay nothing, but could just take the parcel home. Reason was it was no plagiarism, and below the VAT threshold, any VAT below 5€ will not be taken. In Germany we have 19% VAT, which means that any product cheaper than 25.31€ or 28.08$ does not need VAT to be paid.

So I went back home with train, adding 14.30$ train tickets to the 22.90$. I have many different robot platforms at home, but this was my first caterpillar one.

A first functional test without microprocessor with 4V turning on same location went well:
https://www.youtube.com/watch?v=9Ygm0Oxhf8c&feature=youtu.be


Today I did a second "straight" test, again with only 4V of a single 25C LiPo (motors can take 3-9V):
https://www.youtube.com/watch?v=yUcnWbPxAoE&feature=youtu.be


Counting the tiles and single steping youtube video time showed 1.05m/s with only 4V:
Code: [Select]
$ bc -lq
sqrt(9^2+1.25^2)*0.315/(38/14)
1.05449957813359675047



Hermann.

Cactusface

Hi Hermann,
                  Very nice but how and why are you using one of MY videos, of MY Pololu tracked bot!!

This one: https://www.youtube.com/edit?video_id=9Ygm0Oxhf8c That used a PIC in the days before I got in to the Arduino...

OK so I can help if you need it, perhaps.
Regards

Mel.
Open your mind! But not too far, your brains might fall out.
Also like Photography, model building and my 300+ Cacti and Succs.

HermannSW

Hi,

I corrected immediately after posting, both links above are correct since then.

HermannSW

I did add a 2nd Lipo and measured straight speed with 7.5V.
Single stepping youtube video shows 9 frames per second.
Here you can see that caterpillar robot does more than 2 tiles in 2 frames.


This shows that robot speed is greater than 2.8m/s or 10km/h:
Code: [Select]
$ bc -ql
sqrt(2^2+(1/8)^2)*0.315/(2/9)
2.84053171257711009556
sqrt(2^2+(1/8)^2)*0.315/(2/9)*3.6
10.22591416527759634401


The wall crash less than a second later should make me rethink whether to do more of these ...

Hermann.

P.S:
Doing 640x480@90fps slowmo video with Raspberry camera would reveal more details.

HermannSW

OK, I added an Arduino Uno with motorshield v1 to caterpillar robot platform. A first test did work, but the 7.5V from two Lipos in battery compartment got reduced too much (5.19V/5.36V from 7.5V by Arduino Uno and motor shield's L293D motor controller) for good speed.

I added a third Lipo, but battery compartment was already full by the other (bigger) Lipos. So I just piggybacked the 3rd Lipo:
https://www.youtube.com/watch?v=gj-LMJlrIm8&feature=youtu.be


There is still voltage reduction, down from 11.22 to 8.84V/8.70V for one of the motors (forward/backward). Not sure yet why the robot got slower at the end. Voltage dropped from 11.22V to 10.80V.

Hermann.

HermannSW

Yesterday I wanted to follow up on the slowdown at the end of the video.
I replaced the three lipos used with a single 900mAh 3S/11.1V 10.0Wh 25C lipo.


Again, after 20 seconds or so, caterpillars did not want to move.
I noticed that the L293D used for M3 and M4 got very hot.
Measurements showed that while 3S lipo had >12V, the motors got less than 1V at maximum.

So the motorshield v1 seems to be incapable of driving the platform motors, because it can deliver 600mA maximal per motor.

The caterpillar robot platform description does not say much on the motors (Motor model: 260). I found many "260" motor datasheets, and many may be the ones of that platform. A week ago I opened the platform and extracted one of the motors, but there is nothing printed on it that would identify the motor:


But all the different possible motor models have one feature in common, 1A or higher at maximum efficiency.

Will try motor shield v2 next, it has TB6612 MOSFET drivers with 1.2A per channel, and if that does not suffice, try the other 3 or 4 motor controller types I have at home.

Hermann.

P.S:
Good that I have L298N from image with caterpilar robot platform at home:
https://ae01.alicdn.com/kf/HTB17drxMVXXXXc2XVXXq6xXFXXXb/202035663/HTB17drxMVXXXXc2XVXXq6xXFXXXb.jpg?size=136667&height=1000&width=1000&hash=8522d51c237e26c9852e99c60752ef09

Its datasheet says that 2A can be delivered for DC operation (absolute maximum ratings).

HermannSW

OK, motorshield v2 with 1.2A per motor was good enough.
Unlike with motor controllers before, this time caterpillar robot did easily start even on carpet.

Here is youtube video of the complete run:
https://www.youtube.com/watch?v=a7HQCSIdXBM

And this is 4 times slowed down animation of lipo loss, which terminated the run:


Now on speed, there are 8 frames per second, and before loosing lipo 3 frames make a complete round.
This is the robot size: 7cm high 15.5cm wide 21cm long.

This is slowest speed for middlepoints of caterpillars first (in m/s and km/h, 4*a(1) is π):
Code: [Select]
$ bc -ql
0.155*4*a(1)
.48694686130641795195
0.155*4*a(1)/(3/8)
1.29852496348378120520
0.155*4*a(1)/(3/8)*3.6
4.67468986854161233872


And this is fastest speed, eg. at front point of left caterpillar:
Code: [Select]
sqrt(0.155^2+0.21^2)*4*a(1)
.81997975574047714161
sqrt(0.155^2+0.21^2)*4*a(1)/(3/8)
2.18661268197460571096
sqrt(0.155^2+0.21^2)*4*a(1)/(3/8)*3.6
7.87180565510858055945


OK, time for better mounting of 82g lipo, and then new runs ...

Hermann.

HermannSW

I did fixate the Lipo and did the runs again. Now the robot did loose a caterpillar tread:
https://www.youtube.com/watch?v=_b04mjMCdCk

I looked into why that happened on every run yesterday, today. And it turned out that the right motor fixing was broken. I did fix that temporarily by inserting a lego brick between motor and upper holes plate.


The small screw you can see above the lego brick was part of lipo fixation.
Here is the video, one pirouette is comprised of roughly 11 full rotations (=> single step video):
https://www.youtube.com/watch?v=GltfS-Lvq54

The 2s pauses between alternating direction pirouettes are for me, to be able to intervene if things go wrong. Surprisingly, how near the robot stays even after 1min and 8 pirouettes (less than 20cm apart from start, the motors and caterpillar systems must be nearly equal).

Hermann.

HermannSW

I tried to let robot run forward, then backward.Unfortunately the robot does not run straight from start.

Youtube video "No more caterpillar robot runs without sensors ..." says it all, lost motor cable in that run:
https://www.youtube.com/watch?v=ZLOXr_Qp_Zs&feature=youtu.be

Before that run I did record video with old Andoid smartphone, from our living room catwalk 2m above ground. That way the video capture a goode area of floor. Playing video in mplayer it says 15fps, and these are 5 single frame steps from initial frame (top rght), all copied into the first frame image:


These 5 frames allow to compute the speed as 3.3m/s or 11.85km/h (floor tile width is 31.5cm):
Code: [Select]
$ bc -ql
sqrt((3.25*0.315)^2+(1.25*0.315)^2)/(5/15)
3.29058173048474819373
sqrt((3.25*0.315)^2+(1.25*0.315)^2)/(5/15)*3.6
11.84609422974509349742


So next step is to keep motorshield v2, but switch it to 3.3V logic.
And to exchange Arduino Uno with Arduino Due.
And and use sensors:


Details on the setup were posted here.

Hermann.

HermannSW

In order to allow sideward sensors to see the wall and not the caterpillar tread, the Arduino Due had to be mounted on the upper hole plate. For fixing Due with screws the motor shield had to be removed, and therefore the sensors as well. This photo nicely shows the superglued sensors:


Next the sensors got tested along a test wall, and I did move the robot manually along that "wall" while recording all 3 sensor's data:


The diagram shows that only the front sensor sometimes gives "unexpected" readings (mostly because of 15° sensor angle). Definitely not a single reading is from the real wall (that is more than 2m away initially):


But the two sideward sensor measurements look really smooth, exactly what is needed.
(x-axis is samples taken, y-axis is distance in mm)

Hermann.

HermannSW

I wanted to complete the assembly, but a motor cable broke. There were three cables that were badly soldered, I tried to do better and all cable connections feel firm. Soldering was easier with left motor unmounted and on a higher level. I was not able to remove the right motor, since I resolved the broken motor fixing by superglueing it with robot platform:


This is the end result, motors and sensors connected, the big 3S 11.1V Lipo did fit diagonally:


In previous posting I said "No more caterpillar robot runs without sensors ..." meaning "sensor control". I did another run with sensors mounted, but not used:
https://www.youtube.com/watch?v=3pGEP9l5pWA&feature=youtu.be


What surprised me is the power of caterpillar robot (hear the sound in youtube video) although the sketch max speed is 100 and not 255. The only small departure from ideal programmed movement allowed to capture quite some for and back moves. The whole robot does weigh 587g in total.

Now its definitely time to make use of the sensor readings ...

Hermann.
Code: [Select]
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"

Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(4);
Adafruit_DCMotor *myMotor2 = AFMS.getMotor(3);

void setup() {
  AFMS.begin();  // create with the default frequency 1.6KHz

  myMotor->setSpeed(150);
  myMotor->run(FORWARD);
  myMotor->run(RELEASE);

  myMotor2->setSpeed(150);
  myMotor2->run(FORWARD);
  myMotor2->run(RELEASE);
}

void loop() {
  uint8_t i, m=100;

  myMotor->run(FORWARD);
  myMotor2->run(FORWARD);
  for (i=0; i<m; i++) {
    myMotor->setSpeed(i);  
    myMotor2->setSpeed(i);  
    delay(1);
  }
  delay(500);
  for (i=m; i!=0; i--) {
    myMotor->setSpeed(i);  
    myMotor2->setSpeed(i);  
    delay(1);
  }
  
  delay(200);

  myMotor->run(BACKWARD);
  myMotor2->run(BACKWARD);
  for (i=0; i<m; i++) {
    myMotor->setSpeed(i);  
    myMotor2->setSpeed(i);  
    delay(1);
  }
  delay(500);
  for (i=m; i!=0; i--) {
    myMotor->setSpeed(i);  
    myMotor2->setSpeed(i);  
    delay(1);
  }

//  myMotor->run(RELEASE);
//  myMotor2->run(RELEASE);
  delay(200);
}

HermannSW

Yesterday I learned how to do front ultrasonic range sensor measurements interrupt driven, which allows for some kind of multitasking (wall collision avoidance and at the same time navigation):
http://forum.arduino.cc/index.php?topic=469281.msg3213465#msg3213465

The first experiments with that code into robot driving at full speed look good, but robot did two wall crashes at full speed in between. One of the crashes even broke the ultrasonic range sensors superglue connections. After superglueing again, and resoldering two battery connector cables (that broke during the crashes), all is fine.

First I did "myMotor->run(RELEASE)" to stop, but realized that the robot did slide quite some distance by that method. Then I did "myMotor->setSpeed(0)" instead, which corresponds to a full break. This is a youtube video I made of such full stop runs, and a .gif animation showing the back wheelie at the end:
https://www.youtube.com/watch?v=eCCTLJCdhrQ


Hermann.

P.S:
I searched on whether battle tanks show similar full stop behavior, and they do ;-)

https://www.youtube.com/watch?v=qCk_l-IRyJg


https://www.youtube.com/watch?v=2RGDCovCM8M&feature=youtu.be&t=73


P.P.S:
Same caterpillar back wheelie as above, but slowed down by factor of 15:

HermannSW

I did remove (temporarily) the 3 ultrasonic distance sensors for doing some sensorless high speed (PWM=200) U-turn experiments:
  • it was fun
  • I learned quite something
  • I really need to go on with sensors



The high speed (PWM=200) U-turn was done by flipping direction of one motor while keeping speed. This would turn in place for stand still robot. But with high speed the direction flipped motor caterpillar has to brake first. The turn phase delay was slightly too high, so that the robot did more than 180° turn.
https://www.youtube.com/watch?v=KCX1hXY8tos


In a second run (with same sketch as before) the robot keeps doing pirouettes without stop. Arduino Due does definitely generate the needed PWM signals, but the sketch code is not followed anymore:
https://www.youtube.com/watch?v=F1Z_IXKrgqA

What is this state of Arduino Due? Crashed? If so, how get the PWM signals still generated? By timers?


Finally I got this video that I could not have planned for (the 587g robot did backward roll 10cm above ground!):
https://www.youtube.com/watch?v=JeWtuEtzvQM
This animation shows the last 20 frames, slowed down by factor of 4 with backward roll at the end:


After overshooted U-turn, Robot first shooted over laptop power supply, then clashed vertically against plastic box, then kept driving upwards (front 30cm above ground, back 10cm above ground) and finally lost grip to plastic box and did (incomplete) backward roll.

This is the relevant part of the sketch:
Code: [Select]
...
  myMotor->run(FORWARD);
  myMotor2->run(FORWARD);

  for(i=20; i<m; ++i) {
    myMotor->setSpeed(i);
    myMotor2->setSpeed(i);
    delay(8);
  }
  myMotor->setSpeed(m);
  myMotor2->setSpeed(m);

  myMotor2->run(BACKWARD);
  delay(210);

  myMotor2->run(FORWARD);
  delay(1200);

  myMotor->setSpeed(0);
  myMotor2->setSpeed(0);
...

Hermann.

HermannSW

Currently I am having stability problems with the robot/Due/motor shield, the robot may have crashed too often with high speed into walls or other obstacles. I replaced the Due, and replaced the motor shield, but still only 1 of 6 times the sketch executes at all and completes ... more debugging needed.

What I did before that happened was to get a 90fps slowmo video (640x480 with Raspberry camera) of caterpillar robot high speed (PWM=200) overshooted U-turn. The youtube video shows up 3.6(=90/2) times slowed down, so even if you set youtube player speed factor to 2 that is 1.8 times slower then originally. In case you set youtube player factor to 0.25 you can see the video slowed down by factor of 14.4. That allows you to see how exactly the high speed U-turn by just reversing direction of one motor while keeping the speed (for some time) works -- I love that U-turn:
https://www.youtube.com/watch?v=fUrNFXME7Mo

Here are seconds 11-16 of youtube video (3.06s - 4.44s at original speed) extracted by makeagif.com. The whole U-turn takes 47 frames or 0.52s at original speed (counted by single frame stepping the youtube video, with '.' and ',' keys):


And here is the simple sketch:
Code: [Select]
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"

Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(4);
Adafruit_DCMotor *myMotor2 = AFMS.getMotor(3);

void setup() {
  int i, m=200;
  
  AFMS.begin();

  myMotor->run(FORWARD);
  myMotor2->run(FORWARD);
  
  for(i=20; i<m; ++i) {
    myMotor->setSpeed(i);  
    myMotor2->setSpeed(i);
    delay(8);
  }
  myMotor->setSpeed(m);  
  myMotor2->setSpeed(m);  

  myMotor2->run(BACKWARD);
  delay(210);

  myMotor2->run(FORWARD);
  delay(600);
  
  myMotor->setSpeed(0);  
  myMotor2->setSpeed(0);
}

void loop() {
}


Hermann.

P.S:
Positions at start of U-turn, at 90° at 180° and final point of turn before going straight again. Initial speed before starting U-turn is 21cm in 9 frames @90fps, or 2.1m/s:

HermannSW

In order to further debug the stability issues this time I switched the robot platform as well. I used the left of these two Arduebots:


Here is a 90fps slowmo video I did of a U-turn run with Raspberry camera, with PWM=150. No overshooting of U-turn this time, most likely because speed is not high:


Even with PWM=150 the stability issue occurs, and after I increased to PWM=200 nearly every run is a problem and does not end as the sketch requires (crashes into wall, start with some slow speed and then keep that forever, does not react on Due Reset button press, Due power needs to be disconnected).

Summary:
Switching Due, motorshield v2 and robot platform did not remove the stability issues. Issue occur much more often with PWM=200 compared to PWM=150. Good news seems to be that both robot platforms are OK. It seems that motorshield v2 becomes instable with higher motor voltages. I even removed the power jumper with the caterpillar motor shied and powered motors with 3S lipo 12V, and the Due wia USB; even with that setup the instability issues occured. So it seems both motorshield v2 I tested have a problem.

Action:
Replace the motorshield (I like the form factor) by two IRF520 Mosfet motor controllers -- they have no problems and an ATTiny85 can reliably drive 20.6V (5 Lipos):
https://twitter.com/HermannSW/status/848632449395548160


Hermann.

Go Up