Propeller versus Basic Stamp with a stepper motor.
Wolfbrother
Posts: 129
Hi all, I'm really lost on converting this working basic stamp program to a propeller. I need the propeller because I want to have multiple things running at the same time. My Stamp program outputs a pulse to a unipolar stepper driver model K179. In theory it's a pulse about 40uS wide and repeats every 1mS or so. The Parallax USB scope makes me think it's more like a 40uS pulse every 2.2mS. But that's ok because hooking it up to the stepper motor driver spins it just fine. The propeller translation actually behaves like the theory mostly, but I emprically changed the values to match the scope outputs. Looking at the scope output, it looks like the two outputs are close enough to make the motor work. Hooking it up the same way to the driver board however, the motor just sort makes a little move, but not a rotation at all. I'm using the Propeller Robot Control board and using a 5.6K Resistor to input to the board, because the documentation says the 5V·translators require 4.7K impedance on the output. I have tried shortening the propeller pulse and/or varying the frequency. The K179 controller is just CMOS chips feeding a gang of FETs. I have attached·my scope output and my two programs. Any ideas what I am missing/doing wrong?
On the scope output the blue trace is the Basic Stamp and the red trace is the Propeller.
Thanks,
Dave
On the scope output the blue trace is the Basic Stamp and the red trace is the Propeller.
Thanks,
Dave
Comments
One other option is to not use them and instead just use a series resistor straight from the propeller output pin. I think a couple of hundred ohm is enough to protect the prop but more should work fine too.
Graham
I tried various resistor values until wee hours of the night. I also tried a voltage divider with the lower leg definitely having almost 5 volts. Without the translators the propeller output is only 3.3V and this K179 board doesn't respond well to 3.3. But I did try my Propeller starter kit board and it didn't even make things buzz. I guess I am really wondering why the signals look the same and the response from the actual device is so different. Anybody who is familiar with the Prop Robot control board have any similar experiences with the steppers or the translators?
Thanks,
Dave
You might try setting up a transistor switch with the 3.3V output on the prop to trigger the pulses on the 5v board since it's all output only. I guess a pull-up might be worth a shot too as long as you don't exceed what the 5V translator can sink.
Make sure everything has the same ground before you do this.
cool problem!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent!
Send $1 to CannibalRobotics.com.
I put it on a DSO where I work. The pulses on that actually look pretty good. The propeller pulse was a bit wider than the stamp, but within 10uS. So I adjusted the wait to narrow it a touch. Since that pulse goes into the 4093 trigger, I don't think there's much issue there. I also don't see much of a change with the scope loaded or unloaded. I am carrying the common grounds all the way. Thanks for the thoughts.
But seriously when interfacing TTL to CMOS, one uses a pull-up. BUT! The TXB0108 is an NMOS/PMOS construct, not TTL.
And, the Ti documentation of the TXB0108 sez:
"Pull up or Pull down Resistors on I/O Lines-
The TXB0108 is designed to drive capacitive loads of up to 70pF. The output drivers of the TXB0108 have low
dc drive strength. If pull up or pull down resistors are connected externally to the data I/Os, their values must be
kept higher than 50kΩ to ensure that they do not contend with the output drivers of the TXB0108.
For the same reason, the TXB0108 should not be used in applications such as I2Cor 1-Wire where an
open-drain driver is connected on the bidirectional dataI/O."
So I'd be tempted to try a pull-up connected to the CMOS power supply on the motor controller side.
Also, National Semiconductor has this to say about TTL to CMOS.
http://digital.ni.com/public.nsf/allkb/826C981B3D0D3A9786256DD300188620
Fairchild has this to say about NMOS to CMOS, page 5 shows a pull up.
http://www.fairchildsemi.com/an/AN/AN-314.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent!
Send $1 to CannibalRobotics.com.
Maybe there is some sneak current somewhere causing a build-up of charge.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent!
Send $1 to CannibalRobotics.com.
I did some quick checking and here is what I see...using your original posted code on the BS2 I see a 40uS pulse at 2.24mS intervals. The extra time is from loading and execution of the instructions in your loop.
When I run the Propeller code I get a 52uS pulse every 2.26mS.
Looking at the documentation for your controller it seems that it requires at least 8V for the supply voltage for the controller. Are you supplying that? Also, it requires a separate supply for the steppers...where are your supply sources coming from? The controller should have a common ground with the Propeller or BS2 board of course. The power supplies should already connect to the proper ground where you connect them to the controller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
I agree on the times and intervals you said. The biggest question for me is why does the stamp circuit run so well and the propeller one doesn't? On the controller I am running a separate bench supply, supplying 8V for the CMOS and the separate side is supplying the voltage for the motor, the grounds are tied together on the supply and carried though on the stepper driver to either the stamp or the propeller board. I'm just stuck.
Thanks,
Dave
So your BASIC Stamp and Propeller boards are getting power from somewhere other than where the controller and Steppers come from?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
Yes the both the propeller and the stamp are getting sourced from wall warts. I have tied all DC grounds together though.
I must admit to being at a loss. Since I don't have your Stepper Motor controller I am unable to duplicate any more of your system. One last thing I did think about though was where did you pick off your scope trace? Were you watching the trace at the output of the Robot Control Board or at the input of the stepper board? Check it at the input to the stepper board since that is after the resistor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
Since the stamp is working, I may be figuring out some way to use the stamp to drive the stepper and the prop board to interrogate where the stepper is and have it drive all the other motors. I really wouldn't have guessed what a puzzle this one is.
Thanks,
Dave
So did you check the scope signal at the stepper controller with everything connected and running? That is the signal I would be interested in seeing. Also, while this problem can be discouraging, it probably is something simple we're all missing. Usually when I try to recreate a problem I try to simulate everything involved. But I can't really simulate your stepper controller from here. I am tempted to look in my parts bins at home and see if I have the CMOS chip so I can get right to the heart of this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent!
Send $1 to CannibalRobotics.com.
First, thanks for all the support, it really does help me. It certainly makes me think before I post something because I would hate to figure out that I had a super simple thing that I kept ignoring.
I ordered a couple of the chips that are on this K179 board. The board uses sockets for all of them so that's a quick test. Maybe one of the chips is weak, my best guess is it would have to be the Schmitt Trigger if any.
There's a 7805 on the K179 board which I checked and it's pretty good at 4.95V, I have the input to that 7805·at 7.2V to simulate a battery pack, because my original idea was to use a battery on this project. I never lowered it from that level. What I am going to try next is to level shift the 5V out of the Stamp to the 3.3 V level like the propeller outputs and see how that goes. Pretty much that's about all I can think of.
My plan B is to use the stamp to run autonomically and set an interface to tell the prop when it's at either end of it's extension. So the propeller would drive the servos and the outer 7.2VDC motor that spins the whole arm.
Lastly, I have checked the signal on the scope with the whole setup. I can't post it because it's an old analog scope. My computer is on another table separate from the assembly bench I have so I can't use the USB scope either.·But, it looks really about the same as the setup without the K179/motor on it, which is what I would expect since the logic chips should be pretty high input impedance.
There's not a single reason the Propeller can't do this. So, whatever is going on we're certainly interested in getting it fixed. Please post your results once you've done the tests you mentioned.
Best Regards,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
It's working now. I took it all apart and put it back together and it still didn't work. I replaced the robot control board with the spare one I had as well. Still nothing. I had spares of the CMOS chips on the K179 board. I started by just replacing the CD4093 schmitt trigger and it that was the one that seems to be bad. I can't say that it's really bad since it worked for the higher voltage signal of the Basic Stamp, but it certainly couldn't work with the 3.3 V out of the propeller. Even with pull-ups on the output it wouldn't trigger. I'm not quite sure what to think about that, but I do guess it explains why the two signals would look the same and not perform the same. Thanks to everyone who helped with this, the community sure is helpful. I'll be doing the mechanical portion this week and then merging all the code towards the end of the week. I'm really happy about that.