Asked — Edited
Resolved Resolved by Rich!

Do Pins Question

I read Rich's tutorial regarding the l298 h bridge which is prompting this question. There was a spin off link that Rich directed me too that actually showed a bit of code to control a stepper motor. I need to set up something like that, and so what I would like to do is set D1 on and off rapidly creating an actual pulse. PWM will not work in this situation. Anyways my controller is looking for 5vdc to fire a optoisolator (led). I am powering my ezb4 via 12vdc. The output of the D0 ports is 12vdc Correct? What voltage would come out of the white wire, if any? My stepper controller is a bit different than the l2d8 requiring only a pulse on one input and a on/off voltage for direction. The controller can work on 12vdc but requires the addition of 820ohm resistors on these inputs. Thanks for the help.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

United Kingdom
#1  

Why wont PWM work? PWM is basically a pulse When you say rapidly, how rapidly?

You could write a script to switch the digital port on and off quickly, simply with a code such as;


:repeat
Set(D0, On)
Sleep(10)
Set(D0, Off)
Sleep(10)
Goto(repeat)

That would turn the digital port on every 20ms for 10ms. The demand on the PC and on the wireless comms may be very high though.

As for the other part of your question, yes if you have 12v in you will have 12v on the Vcc pins. This is on every port of the EZ-B not just D0.

The voltage on the white (signal) pin is 3.3v however the current supplied by that pin is very small and cannot operate with a higher current demand than say an LED.

PRO
Synthiam
#2  

It sounds like @kamaroman68 is attempting to control a stepper motor directly from the EZ-B. I do not recommend that because the ez-b is a robot controller made to control robot hardware. It is recommended to connect a stepper motor controller to the EZ-B. The EZ-B is for doing robot specific controlling of other peripherals, such as motor controllers and servos.

For experimenting, you could write an EZ-Script to turn on and off the digital ports that would simulate a stepper motor controller - but it would consume a great deal of communication resources and is not a long term solution for a robot.

#3  

Thanks for the replies. Just for clarification purposes I am using a stepper motor controller that is normally used in automation, that normally operates via 12-24vdc but requires a pulse counting/ pulse output card in a plc. This controller requires 5 vdc on to produce "up steps" and then no voltage to produce "down steps" To make it step it requires an actual pulse. I called the manufacturer who explained to me PWM will not work with this controller , hence the actual pulsing. I was wondering if the white pin put out 5 volts so I could use that instead of adding resistors. This controller can be found at automation direct.com - stp-drv-4035, I cannot make a link to it for some reason. Thanks guys. Chris

#4  

No, white is signal only. You can't power anything from that pin. Here's what I would do, buy or build a TIP120 transistor switch. Use the white signal digital pin on ezb to turn it on and off using Rich'so script above. Use an external power supply that will give the correct voltage and run it through the tip switch and attach this setup to your motor. When the script turns on and off the switch your motor should see the voltage as your needed pulse. Hopefully the switch will operate fast enough for your needs.

United Kingdom
#5  

To be honest, I wouldn't use my script above. At 10ms between changing state it would clog up the comms and would place a huge load on the PC (plus what DJ said).

If a stepper motor driver wont work with it I would build a small circuit which will do the switching/pulsing of the logic to the pin that needs the pulse. A small 555 timer circuit may be able to do this fast enough and the EZ-B and scripting would only need a simple Set(D0, On) command.

#6  

okay, well that makes sense.when you explain it that way my idea will not work. Thanks for the clarity.

PRO
Synthiam
#7  

@kamaroman68 sounds like you chose the wrong stepper motor controller:) Sorry, there are a few thousand stepper motors that operate without parental supervision (i.e. some pulsing) and only one that requires pulsing. You seem to have selected the one that requires pulsing.

However, maybe that pulsing is the speed that the stepper motor will move? Perhaps the PWM tells the controller how fast to move the stepper? If that is the case then you can use the PWM.

But since this stepper motor is undocumented and foreign to the robot world, it will take some time to get it working

#8  

Thanks everyone for the replies, its not so much that I chose the wrong controller, its just the one I had laying around. I used to use these in sputtering machines where the conveyors were used with stepper motors and microstepping to provide ultra precise movement . Yes DJ you are correct the speed of the incoming pulses dictates how fast the stepper moves or in my case "climbs". I am actually using a linear stepping motor. (screw through the center of the stepper motor) I will figure this out. Thanks for the help.