Vroom vroom

Posted on September 19, 2014

0


ATTENTION: THE Lisbon Mini Maker Faire 2014 OPENS TO THE PUBLIC TOMORROW, SATURDAY. GET YOURSELF REGISTERED ONLINE AS A VISITOR SO YOU DON’T HAVE TO WAIT IN LINE AT THE VENUE. IT’S FREE OF CHARGE, BUT YOU HAVE TO REGISTER FIRST.

And now, back to our soap opera. 🙂



The time has come to finally connect the whole system, motors included, and give it a nice pop.

Impressive as it may seem, we will only know what this thing can do once we test it on the floor, with load. But right away, something fishy is becoming apparent: the communication between the RasPi and the bridges is not as smooth as it should be… can you spot the trouble?

There is definitely something wrong there, the I²C bus becomes “locked” from time to time (the green lights stay on longer/stronger than they should – not visible on video), causing the power bridges to misbehave. But you can hear that the motor has “hiccups” at least twice on this video. They are obviously receiving some erroneous instruction packets. The readings I’m getting back at the RasPi are also garbage from time to time, so the problem occurs both with Write and Read operations. My current policy is to have the RasPi Read/Write both bridges 20 times per second, as follows:

  1. Write: “seek” register zero (2 bytes);
  2. Read: get all 8 registers (9 bytes);
  3. Write: set register PWM to desired value (3 bytes).

Total flow = 14 bytes x 20 x 2 = 560 bytes per second, x 8 = 4480 bits/s (plus overhead bits for Start/Stop Condition and Acknowledge in the I²C protocol). That’s a lot of opportunity for errors. 🙂

Because we’re still hacking up the first implementation, there is no proper error-checking in our communications protocol (I’ve been using known values from the bridge registers to double-check Reads on the RasPi side, but the bridge has no way or code for doing the same on Write ops yet). We probably should have included it right from the start.

Now we need an oscilloscope here… we can’t let people ride on an unsafe vehicle at the Faire, can we? 😉

(to be continued…)Lisbon_MMF_logos_Banner_big

Advertisements
Tagged: ,