Maker Pro
Maker Pro

A stepper motor, I2C bus and a Raspberry Pi

Our task is to make a robot that can move through a maze, and i am specifically in charge of the wheels and their code. The machine should be able to drive on its own, but we are ofcourse sending single commands to it from a terminal until we make it work. All 4 of us are IT students and electronics is neither our strongsuit, nor is it really within the scope of our assignment that this headache should befall us. But even so...

Me and one other guy was sitting one day fixing stuff, everything was finally working fine after we tried a different set of batteries, But then we descided to change to things:

1. I moved 4 commands in order, into a coding segment that would choose one of the 4 commands depending on what number-input was given from the terminal.
2. Since both wheels started turning after we swiched to different batteries, we descided to put the ones we had in the charger for what ended up being less than 4 minutes.

Trying to start the code yelded an "I/O Error" which certainly made sense since fire and brimstone spewed out of the batteries (okay just smoke, but a broken batterypack none the less) To our amazement, the battery socket had its negative pole melted CLEAN out!
hddxFsD.jpg

We got a new socket and retried connecting everything, but we still had the same "I/O Error" problem. So we started testing.. First off, a picture of our setup:
iAex53S.png


The Raspberry Pi runs a program that connects to a certain address though the I2C-bus and thus communicates with the TMC222 Motor Controller to command a wheel to turn around, all of which worked fine before. It is worth noting that we have a 50 page datasheet for the TMC222 available.

Things we have tried to do for it all to work again:

1. The Raspberry Pi can run other segments of arbitrary code and shows no change aside from the "I/O Error" we keep getting with the motorcode.
2. The daughter board when mounted on the Raspberry Pi and with the voltage divider on top seems to output the correct voltage value when we measued the voltage across all the outer wires on each of the 6 bus outputs, as shown here:
CRJjqoL.jpg

3. The voltage divider also gives off the same voltage value when measured directly
4. We measured the resistance through the white cables (of which we have 3) on each of the 4 wires, and found that one of them had a single wire that did not seem to give a proper value. We remade the cable from parts we could obtain, and now all 3 cables showed a minuscule resistance from one end to the other on all 4 wires.
5. We tried to make the Raspberry detect both of the TMC222 motor controllers, and also tried the same thing with a 3rd one from another team, neither of the 3 seemed to be detectable.
6. We made the cables for the batteries ourselves, and they give off a proper reading of 13.5v
7. We refit the motors themselves with cable extensions well before this error to solve a different problem, and we have successfully sent commands to either wheel, 1 at a time. Note: While the wheels might have suffered damage of which we have not identified yet (and we have no spare wheels to test), we are quite certain that the TMC222 should be detectable though the I2C-bus whether or not there are wheel attached to it.
Here is some more pictures of which components we have:

Raspberry, daughter board and voltage divider:
A6aInj8.jpg


TMC222 and the wires that connect to it:
RKCaihx.jpg


All parts connected:
IgVa8ld.jpg


It should be noted that we are not supposed to make the cables ourselves. All our job is, is to figure out how to connect these components and what code to write on the Raspberry Pi. Please be gentle with your eletronic language, we are IT students after all.
 
"1. The Raspberry Pi can run other segments of arbitrary code and shows no change aside from the "I/O Error" we keep getting with the motorcode."

===> Isn't it the easiest thing for you to find what generates the "I/O Error" message in the Raspberry Pi code itself?

"5. We tried to make the Raspberry detect both of the TMC222 motor controllers, and also tried the same thing with a 3rd one from another team, neither of the 3 seemed to be detectable."

===> If possible do the other way around:
try your TMC222 at the other team.

===> Also,
you can try to run your code on another Raspberry Pi(yours may be defective "I/Owise") with your own TMC222.


===> A "voltage divider"?
It is probably a step down DC to DC converter,any part number on it?

===> In general,
to prevent such "fire damage" you should use a fuse on the + battery wire.
A car style fuse holder and fuse is an easy thing to add.

===> Please,do post the TMC222 datasheet.
 
We are already aware that the I/O error originates from an attempt to send data through the I2C bus, which fails. The same code has worked before.

We will try the tests you mentioned and report back here.

A different test we tried was to take our Raspberry Pi and put it on another teams robot while we tried contacting it. We still got the same I/O error. So either their external hardware is also faulty or the problem is something else. We suspect that the Pi is damaged, even if it can run non-I2C code just fine. I have attached the Datasheet for the TMC222.

The problem persists as of yet.

EDIT: I will get back to you with the partnumber you asked for.
 

Attachments

  • TMC222_datasheet.pdf
    448.7 KB · Views: 103
Update with the "partnumber":
Here is a closeup picture of the so called "step down DC to DC converter" (the little red device in the bottom):
egq3ZxC.jpg

There are no datasheet for this, and all the partnumbers we can see are the ones visible on this picture here. We just got it from our professor, and we even had to solder the pins for each corner onto it ourselves.
 
UPDATE: Because monday came around we went to the professor and asked to get a new Raspberry Pi to use for tests. Even though he said that "in all my years of assisting students with this project, i have never once seen a hardware failure. Just test all components, it is surely something else". After connecting the new Raspberry Pi, everything worked like a charm!

No visual damage can be seen on the old Pi, but we still suspect that some of it's pins have short circuited in some way.
 
well,
Good news,this scenario was found than:

"===> Also,
you can try to run your code on another Raspberry Pi(yours may be defective "I/Owise") with your own TMC222."

That means the I2C interface on it is faulty h/w wise.
If you are interested for educational purpose ,
it can be traced and debugged and maybe fixed(unless the Broadcom chip is faulty).

The "step down DC to DC converter" is indeed that.
look here:
http://www.ebay.com/itm/Super-LM259...749978?hash=item25a90950da:g:mKYAAOSw~gRVkqvx

Looks like you set it's voltage to 4.22v, why that voltage?

The board it is mounted on is probably an I2C spliter/level-shifter.
Have you got it's schematics?

Have you got the schematics of the TMC222 board itself,not only the IC on it?
 
The so called "I2C splitter" seems like it was made on site here at our university, im not sure the schematics is publicly available anywhere. Nevertheless, it barely has any components on it, 3 resistors, 2 diodes and a button.

We only have the schematics for the TMC222 chip unfortunately.

We attempted to set the voltage of the step down converter to 5v, but for some reason this changes once we run it, and weirly enough, turning the little screw does not change the voltage measured. It is not high priority, but we are wondering why it is like this. We probably COULD figure out what the status is for the old Raspberry Pi, but we are busy as it is, so we will not prioritize this.
 
Top