Servers by jDrones

ArduRover on real competition R/C 1/10 car on real circuit: missions. FAR FROM WORKING


(Webillo Disperso) #1

Hi.

I am trying to emulate on an ArduRover missions working on an Arducopter over a real R/C circuit. The car is a competition 1/10 one (with steering servo and ESC), although I start limiting throttle pulse width on the controller (SERVO2_MAX=1580), although this can be done as well on the transmitter.

Transmitter used is a Futaba T3VCS three channel radio. Steering (ch1) and throttle (ch2) are assigned normally, and ch3 on a knob is used to change mode. Note that since I don’t know to arm the rover with a ch1+ch2 sticks combination, the rover is always armed (ARMING_REQUIRE=0).


I use Mission Planner as GCS. Car controller is a clone Pixhawk v2.

As examples of missions to emulate (Copter) over the real car R/C circuit:
Example 1 mission drone
Example 2 mission drone

Drone controller is also a clone Pixhawk v2. Transmitter is a Futaba T7C and receiver is a FrSky TFR4-B, with PPM output (no PPM Encoder needed). It has two GPS’s; first one has a 5988 compass (external one). I try to use same electronics and configurations on the Copter and Rover. Drone and car communicate with GCS with 3DR radios.

The car receiver is a Futaba R603FS. Its outputs are connected to a PPM Encoder: ch1 and ch2 normally, and ch3 to ch5. On the controller MODE_CH=5. The PPM Encoder output is connected to Pixhawk PPM input. Pixhawk main outputs 1 and 2 are connected to car steering servo and ESC.

The car Pixhawk has connections to two GPS’s. GPS1 has a LIS3MDL compass; for whatever the reason it is not recognized, so I don’t connect its I2C SCL/SDA signals and use instead a module with a 5888 compass (external), with its dot oriented front-right (Roll180), the same as in the drone. Second compass is the Pixhawk one (internal), the same as in the drone.

The car has also two sonars at the front (chinese analog and I2C, both with HC-SR04).

The steps for making everything work would be:
1). Basic car movement (modes Normal, Acro and Steering). Works (latency is clear in car handling).
2). Guided and Auto modes (compasses and GPS’s working; missions). FAR FROM WORKING.
3). SmartRTL mode.
4). Sonars (front obstacles avoidance).

If missions work, speed would be increased, and accelerometer lateral measurements would be used to reduce speed as needed, so as to improve lap time.

But I am completely stuck at 2: nothing works, and is really far from working. For example, on Guided mode the car turns and goes opposite to desired point. This sounds as a compass problem, but:
-Compasses (external and internal) are almost the same in drone and car.
-I copy the configuration on drone and car (same external one orientation, (Roll180)).
-Calibration on drone and car succeeds (both external and internal compasses).

Sounds as if rover doesn’t know how to translate desired actions towards the steering servo for whatever the reason.

Questions:
-Am I missing something?
-Any wrong or missing parameter below?
-How can I start to make Guided and Auto modes to work?

Any help deeply appreciated. Thanks for reading.

GCS messages:
EKF2 IMU0 in-flight yaw alignment complete
PX4v2 004B0036 3436510A 32393637
PX4: fc469199 NuttX: 1bcae90b
APM:Rover V3.2.3 (261f998f)

Relevant parameters:
AHRS_EKF_TYPE,2
AHRS_GPS_USE,1
AHRS_ORIENTATION,0
ARMING_REQUIRE,0
BTN_ENABLE,0
COMPASS_EXTERN2,0
COMPASS_EXTERN3,0
COMPASS_EXTERNAL,1
COMPASS_ORIENT,8
COMPASS_ORIENT2,0
COMPASS_ORIENT3,0
COMPASS_PRIMARY,0
COMPASS_TYPEMASK,0
COMPASS_USE,1
COMPASS_USE2,1
COMPASS_USE3,0
CRUISE_SPEED,2
CRUISE_THROTTLE,50
EK2_ENABLE,1
EK3_ENABLE,0
FRAME_CLASS,1
FS_ACTION,2
FS_CRASH_CHECK,0
FS_GCS_ENABLE,0
FS_THR_ENABLE,1
FS_THR_VALUE,910
FS_TIMEOUT,5
GCS_PID_MASK,1
GPS_TYPE,1
GPS_TYPE2,1
INITIAL_MODE,0
MAG_ENABLE,1
MODE_CH,5
MODE1,0
MODE2,1
MODE3,3
MODE4,4
MODE5,10
MODE6,15
PILOT_STEER_TYPE,0
PIVOT_TURN_ANGLE,30
RC1_DZ,30
RC1_MAX,2014
RC1_MIN,1008
RC1_REVERSED,0
RC1_TRIM,1545
RC2_DZ,30
RC2_MAX,1906
RC2_MIN,1049
RC2_REVERSED,0
RC2_TRIM,1511
RC5_DZ,0
RC5_MAX,1970
RC5_MIN,1069
RC5_REVERSED,0
RC5_TRIM,1340
RCMAP_PITCH,3
RCMAP_ROLL,1
RCMAP_THROTTLE,2
RCMAP_YAW,4
RNGFND_TYPE,1
RTL_SPEED,0
SERVO_RATE,50
SERVO2_MAX,1580
SPEED_TURN_GAIN,50
TURN_MAX_G,1
TURN_RADIUS,0.9
WP_OVERSHOOT,2
WP_RADIUS,2
WP_SPEED,0

Rest: moreless default.


(rmackay9) #2

Webillo,

Thanks for the detailed post.

Normally the COMPASS_ORIENT should be 0 instead of 8 (Roll180) although it could depend upon the GPS/Compass manufacturer.back in the old APM days Roll180 was required but with the Pixhawk family it’s normally zero.

I think it would be good to disable the range finders (set RNGFND_TYPE 0) until we get Guided or Auto working properly.

Two possible causes come to mind:

  • the compass heading is off. If you connect with the MP and look at the map, does the vehicle appear to be pointing in the correct direction?
  • the SERVO1_REVERSED parameter is backwards.

If you can download an post a dataflash log (a .bin log) then I can have a look and see what’s going on.

Thanks for giving Rover a try!


(Webillo Disperso) #3

Thanks for your answer.

Pixhawk mounting on both is normal (arrow forward).

These are the external compasses on both drone and rover:

External compasses chips are 5883 or 5983, and are oriented equally (as seen I’ve tried two compasses on the car with same results). Dot is at front-right (I think Roll180). All point to sky (see that at the drone it is at the GPS antenna PCB side).

This are compass definitions on Mission Planner (same):

Everything works well on the drone, but a static test with both parallel and facing north gives:


Good on drone but far from good on rover.

¿Does dot at front-right and chip upwards for external compasses correspond to Roll180? If not, why everything works on the drone (PosHold, Auto, RTL)?

Now I have SERVO1_REVERSED=0; steering stick to right makes car turn right. If changing to 1 steering is reversed (not good). Of course, transmitter in normal position (sticks facing me).

I don’t mind now about the sonars; in fact I have tried with both disabled and/or disconnected.

I am sure I have a big error somewhere. What can I log that could show it?


(rmackay9) #4

Ok, this is a classic compass. I haven’t seen one like that in years. These days the compass is normally included in the GPS module. In any case, nothing wrong with using this hardware - it should work and the Roll-180 could indeed be correct.

The heading being off by 45degrees is not as bad as I was expecting. 45 degree error shouldn’t cause the rover to drive in the wrong direction. This 45 degree error could be caused by having metallic parts near the compass, a bad compass calibration or the EKF’s heading estimate can be incorrect if the rover is carried around a lot before it is driven (we have a software fix coming for this last issue).

If you have a dataflash log that would be best. In particular I want to see the STER (steering) and THR messages. From the STER message, the desired and achived turn rates are most interesting.


(Webillo Disperso) #5

Thanks. I’ll try to do the logs next Sunday.

Recall that I am using the internal and an external compass on both drone (inside GPS1) and car (small separate I2C module, since it GPS1 LIS3MDL isn’t recogniced (I have tested it with an Arduino and it works)) Pixhawk’s. For internal ones COMPASS_ORIENT2=0 (Pixhawk’s oriented as their arrow indicate, AHRS_ORIENTATION=0). I have looked at the internal drone compass. It has written on it 303H, so it should be a LSM303DLHC (ST Microelectronics). It is facing down, opposite to connectors side. If rolling it 180º its dot position is the same as the Honeywell 5883/5983 on external compasses photos above, so external COMPASS_ORIENT=8 or Roll180 for both (supposing same rules for Honeywell and ST).

However, I am always seeing car heading off, after several calibrations and testing in different places. Drone heading is always correct. On above screen capture (desktop captured using a laptop and an external monitor) the car was above the drone and parallel, so any magnetic distortion should affect both.

From above, car Manual and Auto modes work correctly, but on Steering mode steering is erratic: the steering servo moves slowly, steering angles are small, and the car is difficult to handle. Does this give any clue?


(Webillo Disperso) #6

Magnetic Interference: probably this is why car orientation fails (and has a remedy).

This is how a traditional compass is distorted when it is near brushless drone and car motors (stopped):

Note that car motor has stronger magnets.

This is how a traditional compass is distorted when it is near a brushless car motor:

When the motor moves, the distortion is reduced on the average.

So the solution is clear: on the car don’t use the internal Pixhawk compass, and place the external compass (in the GPS or as an I2C small module (GY-271)) at the front bumper:

The distortion is hard to appreciate.

Also:
Magnetic Interference
CompassMot — compensation for interference from the power wires, ESCs and motors


(rmackay9) #7

Ok, thanks for the info. I think for now we don’t support the compass-mot on Rovers. It’s possible to add but not there at the moment.

Re the results in steering mode, definitely that log will help diagnose this. The first step is to determine if it’s a control problem or a heading estimation problem. It could be either …