CMPS14 Compass

Well the official work has started on determining if the CMPS14 will replace the MMA, DOGS2, Brick, BNO055. Also make the code much simpler, as well as reducing the settings to basically just 1.

The CMPS14 is based on the BNO080 with custom firmware from Hillcrest Labs. They factory calibrate it and has very simple access to its derived Heading/roll/pitch. it is I2C based so until a final design is complete it can be run off the connector for the MMA. Simple.

So i mounted the CMPS on a small board, and a nano. Put it on the dash of the truck and drove around. It was very stable with minimal drift, the roll was rock solid. There would be no requirement for any filtering or fudging the numbers, read and send to AOG. This is great.

I did notice pulling hard around a corner the heading did jump to some random value, not sure what that was about, but could basically drive 30km in a straight line down the highway/gravel roads etc bouncing along and the heading remained the same. This is a big leap forward.

I wrote a simple ino to be used in the machine port for now to read the CMPS. Modified Drive version to ignore everything and just use those readings for Heading and Roll. Tractors are plugged in so hope to test AgraBot today with the new code and IMU. Cautiously optimistic at this point.

https://www.robot-electronics.co.uk/files/cmps14.pdf

7 Likes

Here is the code for CMPS. As you can see no special library. All you do is access the device 0x60, tell it you want data from register 2 (heading) and register 1C (roll), then send that off to AOG, and that is it!!

arduino_cmps12_i2c.ino (2.1 KB)

 #include <Wire.h>

#define CMPS14_ADDRESS 0x60  // Address of CMPS12 shifted right one bit for arduino wire library
#define HEADING 2           // Register to read 8bit angle from

unsigned char high_byte, low_byte;
int Heading, Roll;
float heading,roll;

void setup()
{
  Serial.begin(38400);  // Start serial port
  Wire.begin();
}

void loop()
{

  Wire.beginTransmission(CMPS14_ADDRESS);  //starts communication with CMPS12
  Wire.write(0x02);                     //Sends the register we wish to start reading from
  Wire.endTransmission();
  
  Wire.requestFrom(CMPS14_ADDRESS, 2); 
  while(Wire.available() < 2);        // Wait for all bytes to come back
  
  high_byte = Wire.read();
  low_byte = Wire.read();
  
  Heading = high_byte;                 // Calculate 16 bit angle
  Heading <<= 8;
  Heading += low_byte;

  heading = Heading;
  heading*=0.1;
  //heading -= 18.0;

  Wire.beginTransmission(CMPS14_ADDRESS);  //starts communication with CMPS12
  Wire.write(0x1C);                     //Sends the register we wish to start reading from
  Wire.endTransmission();
 
  Wire.requestFrom(CMPS14_ADDRESS, 2);  
  while(Wire.available() < 2);        // Wait for all bytes to come back
  
  high_byte = Wire.read();
  low_byte = Wire.read();
  
  Roll = high_byte;                 // Calculate 16 bit angle
  Roll <<= 8;
  Roll += low_byte;
 

    //Serial Send to agopenGPS **** you must send 10 numbers ****
    Serial.print("127,231,0,0,");
    
     Serial.print(Heading);
    Serial.print(",");
    Serial.print(Roll); 
         
    Serial.println(",0,0,0,0");
    
    Serial.flush();   

  
  delay(100);                           // Short delay before next loop
}
3 Likes

Hi people, hi Brian.
These results look promising !
If I understand well, the next big step is to try to work with two (or one) f9p and this IMU at the same time to get the best of both worlds ? Blending of all these data would have to be made on board (by an ESP32 ?), to keep feeding AOG with a generic stream of data. Right ?

Exciting news, will be watching to see how this progresses. This would then replace the MMA and the Brick V2, it would be mounted on the board? Any concerns with power or being inside causing interference?

Yes, with a stable imu a lot more is possible, like correcting for drift

If it gives good heading and roll would there be any need for 2 F9P?

Well my drive thru the country showed the better the placement, the better it works - no surprise there. Pretty sure that is why Trimble has that box on the roof…

1 Like

I would tend to say no to dual for 99.9% of agriculture with a good imu

4 Likes

It should help to keep the overall cost fairly low, I guess.
Any idea already about where the blending of F9P and IMU data should be done ? Is it in AOG like today with one F9P + BNO055 + MMA, or on the CPU on the PCB ?

That would be easier to answer if everyone used the F9P. But that is not the case. So going forward for versatility I’m thinking the best is in AOG.

Right now antenna offset, roll, heading is done in AOG except for dual antenna

2 Likes

The bno055 was a little bit joking with me, sometimes. So I tried dual, I recognized a more stable heading. So there was no longer a need for me to place the antenna on the the hood and I was able to drive with a smaller lookahead with PureP. (The smaller the lookahead the bigger the force to abline.)

I will receive 2 cmps soon so I will join the tests. I plan to design an assembly method that would dampen vibrations, I noticed that the IMU is very sensitive to it. Cerea has it worked out, they use some drone shock absorbers.

4 Likes

I think the BNO085 is actually A BNO055 with custom firmware from Hillcrest running on an Arm processor alongside it. Both CMPS14 and the Adafruit BNO085 breakout therefore have the Hillcrest firmware running on them.

The CMPS14 has an additional external controller further processing the output.

Here at least, the CMPS14 seems even cheaper than the Adafruit board.

1 Like

Well i took it for a spin in the deep snow. Worked very very well. While i am always cautious about saying we go with it, i wait for others to try as well. Anyone who has, has said it works much better then anything we have used so far.

https://www.youtube.com/watch?v=35BZzLw1tFg

6 Likes

That is brilliant to see. Especially your comment about fast reacting but stable roll. Something that has caused me some issues on our rough ground.

Interesting developments… Looks very promising… Think the instant direction feedback from dual is hard to replace entirely though?

Well the imu is actually very much faster then the 10 hz gps. I was using very little correction from the GPS and was mostly imu. Backing up worked perfectly.

I should mention the new version of drive i was using here has a very different position/heading function in it then AgOpenGPS.

2 Likes

Interesting…Could be the end of any reason to run dual then? Would certainly be alot simpler, as it doubles the number of potential issues / things to get right for new setups…

Id certainly like to give it a go a my setup pretty much only works with dual well, but with the normal cross track error on hills etc.

Part of the problem was using the steer axle as the pivot point. Today’s run was using the back wheels as the pivot point using stanley. So the back wheels determine cross track error.

Much better

Looks like robotshop is the only North America source for it? AliExpress is an option but also more money.