|
Post by matthew on Feb 28, 2018 20:06:33 GMT -7
Hi Max,
I decided to try and figure out how the MP-6500 accelerometers that came with the Dobot communicate. I was able to get an oscilloscope and tap some of the lines corresponding to the SPI bus. I was able to see the SCLK and SDI(MOSI) signals when the Dobot queries the MP65, which seems to be a rare event (eg. only when using the Homing command).
However the strange thing is that the chip select pin never goes low, and as a result the SDO(MISO) pin never transmits anything. There's no corresponding pin for the chip select on the board header either. This can't be right because if it were true the Dobot wouldn't be able to receive any measurements or calibrate itself. Yet I can't seem to see any indication that this happens on the oscilloscope.
I'm wondering if you might have any troubleshooting advice for me.
Thanks, Matt
|
|
|
Post by Max on Feb 28, 2018 22:33:03 GMT -7
Assuming you're still talking about magician here...
That actually makes sense that it is a rare event because accelerometers is a terrible way to estimate pose with the precision that dobot needs, especially these cheap ones.
Which board header are you talking about, the MCU board or the accelerometer boards? And why do you think there is no pin for chip select, is there marking of some kind that I don't have on mine?
I agree that it can't be right, unless it is actually two I2C signals that you observed, which I seriously doubt for several reasons.
Pictures would be great here to be on the same page.
|
|
|
Post by matthew on Mar 1, 2018 6:09:34 GMT -7
Sure, here is a picture of the board I am referring to: i.imgur.com/1tALiws.jpgThe MP65 is on its side, with pin 1 on the top side right corner. The header I'm referring to is at the top, which has 20 pins and I was only able to find 3 pins corresponding to the MP65 CLK, SDI, and SDO. The other pins seem to be tied to other functionality. Here's an oscilloscope trace of the clock/SDI: i.imgur.com/iZEWEak.jpgi.imgur.com/d2ftSvE.jpgInitially I was thinking that the chip select would be tied low, and the two accelerometers of the arm would be daisy chained over the remaining 3 wires, but given what I saw I am not so sure now. As a side note, do you think that the accelerometers you mention in open-dobot would do a better job of estimating pose with precision when sampled more often? Thanks, Matt
|
|
|
Post by Max on Mar 1, 2018 15:14:35 GMT -7
I will refer to those pictures as follows: imgur.com/1tALiws - pic1, imgur.com/iZEWEak - pic2, imgur.com/d2ftSvE - pic3 To be sure - did you check both rows of pins on the header (all 20 pins on the header that is at the top on pic1)? The other row isn't accessible when the board is like on the pic1, you need to unscrew it. Signals on pic2 were acquired over a longer period and then zoomed in, which is why the resolution isn't great and it's hard to say what it is. The bottom signal may actually be chip select. The top one looks like data. If there are more than two inputs on the oscilloscope better do all four at the same time to see how they relate to each other. Top signal on pic3 looks like clock and the bottom one could be either data of chip select - hard to say not knowing whether two screenshots show same two lines or four different lines. If those are four different lines then you got everything you need: MISO, MOSI, CS and CLK.
|
|
|
Post by matthew on Mar 8, 2018 19:46:00 GMT -7
Hi Max,
Thanks for your advice in troubleshooting.
To clarify, pics 2 & 3 show the same two signals; 2 shows a larger time period, and 3 shows the first byte transfer.
To make sure there weren't any mistakes, I double checked all the header pins, both with a multimeter to check connectivity and an oscilloscope to look for data-like signals. I also checked the pins in multiple locations, like on the main board header as well as the accelerometer board header. I still found that only two lines were transmitting signals.
I am fairly confident that, at least for the Magician, the MP65 accelerometers are actually using I2C. To support this theory, the signal in pic3 which shows the first byte transfer corresponds to the MP65 I2C address (0b 1101 000X).
This might also explain why the signals are degraded in pics 2 and 3, because of motor interference.
What do you think about this?
Thanks, Matt
|
|
|
Post by Max on Mar 9, 2018 15:14:09 GMT -7
The interference captured on pic3 looks more like on SPI bus to me, from my observations while reverse-engineering dobot1. On i2c I had much worse picture due to open drain nature and only managed to reduce it with ferrite beads.
Logically though, it makes sense given pic2 and pic3 are the same signals with different scale and the fact that you have checked all 20 pins.
That means you can't use stock dobot source code and would instead need to do something with the mp6050 driver in open-dobot. I haven't looked how close registers in mp6500 are to mp6050 but I suspect you should be able to reuse a lot of mp6050 code.
|
|