Australia
Asked — Edited

BV4213 Stepper Motor Controller

I bought four BV4213 I2C Stepper Motor Controllers to use with the EZ-B. I am not a programmer. Can you help me with physical connection to the EZ-B and how to control the steppers from ARC. Regards, Phil


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

PRO
Synthiam
#1  

Hey Phil! Welcome!

Would you be using the steppers for driving your robot? I'm asking what role it will play in your build because that depends on how you can connect to it.

Australia
#2  

Hi DJ, I have a box full of good 4 & 5 Wire steppers, ex ink jet printers, so I thought I should put them to good use. Main goal is stepper control. Step x forward and step x reverse, with velocity control. Bit like my Roomba, shoots across the room, sees a wall, slows down then reverses. By watching the Roomba it seems to calculate the distance to the next wall.

Using in conjunction with the sonic radar. Possible?? Regards Phil

PRO
Synthiam
#3  

The roomba is actually alot dumber than people think. The programming is really (and i mean REALLY) simple. And there is a reason why...

I'm sure initially, iRobot spent a bunch of time attempting to "floor map" and that idea was trashed. If you use the ARC software with a robot and use my Floor Map Control, you will see why.

Even with the accuracy of stepper motors, the distance travelled can't be accurately determined when turning. Turning is the big issue, due to wheel slip while rotating.

How the roomba actually works is like this... It's really only "mapping" are a few variables. One is the "longest distance travelled in a straight line", the other is the shortest, the other is how many turns VS distance. These numbers are easily referenced to determine how far the roomba drives before stopping and beginning it's circle clean (which is never in the middle of the room, but close).

It's only close due to luck:) ... There are many websites where people speculate on the programming of the roomba. But it's funny because they add some intensely complicated "Assumptions". If the roomba did attempt to actually store a 2D perspective of the environment, the product would be a sure failure.

Reference my K-9 and original Wall-E hack. K-9 was an exception with a 3D environmental mapping module that was used to reference it's surroundings. It worked great for a few minutes until everything went out of whack. I attempted to do very intense computations to constantly correct the enviromental map by comparing with the distance sensor. IR distance sensors have a pretty short range and are far from accurate. They are great for object proximity detection, but not distance detection.

I spent too many years with the enviromental mapping code. Finally gave up and determined the smartest approach is not "understanding its environment", but instead "reacting to its environment". This means the robot runs within simple conditions that have specified or normalized tolerances. The simplicity of that method gives the robot the appearance of enviromental understanding. Reference my Omnibot for that.

The Roomba is a great example of simple programming that gives the illusion of complicated environmental understanding.

As for your stepper motors, currently you would need to reference the BV4213 documentation for the I2C commands. Create ARC scripts that send the appropiate I2C commands.

Australia
#4  

Hi DJ Ok, scrap the room map idea.

How to control the steppers. I can stumble through scrips if I have an example to hack. How do I wire the I2C to the EZ-B? Do I need to add pullup resistors? The EZ-B manual says 220 ohm resistors provided, but I cannot see them on the board. Regards Phil

PRO
Synthiam
#5  

The resistance for the i2c is embedded on the board. The microcontroller has internal pull up resistors. My I2C implementation uses bit bashing and a pile of assembly code for effeciency. The I2C hardware embedded within the micro doesn't use the pull up resistors so i wrote my own. Software is easier than adding more hardware :)

The script help manual (in the scripting control) has the command syntax. You specify the address of the device, or reference the devices manual for the global address. Then you pass either ascii, numeric or hex codes for its commands.

Australia
#6  

Woohoo, Thanks DJ. I didn't want to let the smoke out of the EZ-B.:) Will let you know how I go. Thanks again, Phil

Australia
#7  

Can anyone give me a script example to control the BV4213 from ARC. I have tried and cannot get it to work. eg: sendI2C (0x42,0x20) Default address for the BV4213 is 0x42, 0x20 is continuious rotation. Nothing. The data sheet says: Name: Step Continuous Format: S-addr,0x20,Stop Please help :-(

Australia
#8  

After much hair pulling and frustration I found the solution. Upgrade to the latest ARC and firmware. It finally works. It was not me, there were bugs in I2C implementation.