Hey all,
So I am trying to drive my stepper with a DM542T and the Teensy 3.5
I was using an arduino but I want to use higher microstepping than just 1/2 steps so naturally I moved up. The code was working fine on my Arduino so I moved all the pins over hoping that the Teensy would work right out of the box but to no avail. I realized that the 3.3v pins are probably what are causing the issue and when looking at the data sheet for the driver it seems I need a minimum of 4V. So I went on Amazon and got some logic level shifters. These should push my 3.3v signal up to the 5v I need. After wiring it up and hitting it with a multimeter, I indeed got the 5v I needed but the stepper wouldn't budge. Further investigating found that when my leads are connected to the driver my voltage reads 2.6v but when disconnected and only on multimeter it will read 5v. I was able to measure this by using a blink sketch making the pin high every 2 seconds. So I am not sure why this is happening other than there must be a resistor in the way that is messing it up. But even if there is one it was working fine with arduino 5v so I am not sure what the difference would be? I also disconnected the leads from the driver and connected them to an oscilloscope. I found I was indeed sending a 5v pulse when using my AcellStepper code but again my assumption is when it hits the driver for whatever reason the voltage goes too low. Are there other reason that you guys can think of that would give me this issue? Is there a simple solution like giving the logic converter 9v instead to overcome whatever the reason for the large drop? Also should there be a pulldown between my signal and ground? When I was doing the blink sketch it would take like 1/2 a second to go from 0 to 5v but I can only image what havoc this could cause when there is a fast pulse. Not sure why it wasn't a problem on the arduino then?
const int stepsPerRevolution = 200*16; // change this to fit the number of steps per revolution
#include <AccelStepper.h>
// Define a stepper and the pins it will use
AccelStepper stepper(AccelStepper::DRIVER, 9, 8);
//AccelStepper stepper(1, 9, 8);
//number of steps to each position from 0
//long pos1 = 11810L*8;
//long maxspeed = 3937L*8;
//long accel = 4000L*8;
long pos1 = 2362000;
long maxspeed = 7874;
long accel = 8000;
void setup() {
Serial.begin(9600);
stepper.moveTo(pos1);
stepper.setMaxSpeed(maxspeed);
stepper.setAcceleration(accel);
//while(!Serial);
delay(1000);
}
void loop() {
//Serial.print("hi");
stepper.run();
}
You have a huge paragraph in your Original Post and I can't make sense of it. Have you tried reading it back to yourself - preferably aloud - to see if it would make sense to someone who knows nothing about your project or your problem.
Post a link to the datasheet for your stepper driver.
Make a simple pencil drawing showing how you have everything connected and post a photo of the drawing.
You are driving opto isolators, they need 20mA or so, and your level shifters can't provide enough current
I suspect, neither can the teensy digital pins (not an expert on this).
Just use NPN transistors as inverters to drive the opto-isolated input cathodes, anodes commoned to +5V.
So 1k base resistor from teensy pin, emitter to ground, collector to cathode side of opto, anode side to
+5V. These drivers have a series resistor built in.
Mark,
I believe I followed your schematic but I seem to be running into a problem where I am constantly getting 5v. I am using an NPN darlington transistor - TIP 120 since this is the only NPN I had. I set up the wiring as the picture below. Is there some obvious error that I made that make the circuit default at 5v constantly?
I am reading ~ 500 ohm between collector and emitter, that doesn't seem right.
Okay so now I am stumped. I moved from using the logic shifters over to an opamp. With that and a 10v battery I can switch from 0 to 10v. So when running the arduino (as can be seen above) I see discrete pulses I can also see these same pulses when using the 3.3v directly from the teensy pin(not pictured). But when I go through the op amp to boost the voltage the oscilicope just shows a constant voltage at 10v and then drops to 0v when the stepper would stop moving. I tried reducing the speed down to 8Mhz on the teensy to see if it had the same waveform and it had "A" waveform but it looked different from the arduino or 3.3v teensy you will notice that the voltage is also dropped to around 3v(pictured below). This did move the stepper when hooked up but not the right speed or distance(too low). To get more information I ran a sketch to see what the max switching speed I can get with the current setup before the waveform started to make a mess. I used a blink sketch and I can see the square waveform from 0 to 10 all the way down to about 20 microseconds. After that it starts to have a lower voltage and look hairy. I get a similar voltage drop to the 8mhz acellstepper code with the blink code at 10 microsecond delay. But the blink code has a higher frequency(faster than the acell stepper). Is this problem due to the fact that the opamp circuit is too slow?
Observations:
Teensy 120Mhz direct from pin (3.3v) looks identical to arduino
Teensy through opamp at 120 Mhz makes constant 10v - switching too fast?
Teensy through opamp at 8Mhz more discrete pulses - I am assuming this is due to less speed required for the opamp so it makes the pulses
Teensy blink 120Mhz has max 20 microseconds delay - Is the AcellStepper using fast than 20ms?
Okay so it looks like the op amp circuit is too slow to do the switching.
I am thinking that I should switch over to a 74HCT125 which should be fast enough since everyone uses them for neopixels but I am not sure there will be enough output current to trigger the octocoupler, thoughts? On the data sheet it says continuous output current +-25ma.
So I am trying to drive my stepper with a DM542T and the Teensy 3.5
I was using an arduino but I want to use higher microstepping than just 1/2 steps so naturally I moved up.
The code was working fine on my Arduino so I moved all the pins over hoping that the Teensy would work right out of the box but to no avail.
I realized that the 3.3v pins are probably what are causing the issue and when looking at the data sheet for the driver it seems I need a minimum of 4V.
So I went on Amazon and got some logic level shifters.
These should push my 3.3v signal up to the 5v I need.
After wiring it up and hitting it with a multimeter, I indeed got the 5v I needed
But the stepper wouldn't budge.
Further investigating found that when my leads are connected to the driver my voltage reads 2.6v but when disconnected and only on multimeter it will read 5v.
I was able to measure this by using a blink sketch making the pin high every 2 seconds.
So I am not sure why this is happening other than there must be a resistor in the way that is messing it up.
But even if there is one it was working fine with arduino 5v so I am not sure what the difference would be?
I also disconnected the leads from the driver and connected them to an oscilloscope.
I found I was indeed sending a 5v pulse when using my AcellStepper code but again my assumption is when it hits the driver for whatever reason the voltage goes too low.
Are there other reason that you guys can think of that would give me this issue?
Is there a simple solution like giving the logic converter 9v instead to overcome whatever the reason for the large drop?
Also should there be a pulldown between my signal and ground?
When I was doing the blink sketch it would take like 1/2 a second to go from 0 to 5v but I can only image what havoc this could cause when there is a fast pulse.
Not sure why it wasn't a problem on the arduino then?
Sorry I had to do it.
Can you please post a complete copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
I have seen you take the trouble to do this more than once - many thanks. However it would be even easier to read if you add a blank like between paragraphs - like this
So I am trying to drive my stepper with a DM542T and the Teensy 3.5
I was using an arduino but I want to use higher microstepping than just 1/2 steps so naturally I moved up.
The code was working fine on my Arduino so I moved all the pins over hoping that the Teensy would work right out of the box but to no avail.
I realized that the 3.3v pins are probably what are causing the issue and when looking at the data sheet for the driver it seems I need a minimum of 4V. So I went on Amazon and got some logic level shifters. These should push my 3.3v signal up to the 5v I need.
After wiring it up and hitting it with a multimeter, I indeed got the 5v I needed
But the stepper wouldn't budge.
Further investigating found that when my leads are connected to the driver my voltage reads 2.6v but when disconnected and only on multimeter it will read 5v.
I was able to measure this by using a blink sketch making the pin high every 2 seconds.
So I am not sure why this is happening other than there must be a resistor in the way that is messing it up.
But even if there is one it was working fine with arduino 5v so I am not sure what the difference would be?
I also disconnected the leads from the driver and connected them to an oscilloscope.
I found I was indeed sending a 5v pulse when using my AcellStepper code but again my assumption is when it hits the driver for whatever reason the voltage goes too low.
Are there other reason that you guys can think of that would give me this issue?
Is there a simple solution like giving the logic converter 9v instead to overcome whatever the reason for the large drop?
Also should there be a pulldown between my signal and ground?
When I was doing the blink sketch it would take like 1/2 a second to go from 0 to 5v but I can only image what havoc this could cause when there is a fast pulse.
Not sure why it wasn't a problem on the arduino then?
Hi,
Can you please read your posts back and see how difficult they are to read.
Please PUT YOUR SENTENCES in POINT form.
Okay so now I am stumped.
I moved from using the logic shifters over to an opamp.
With that and a 10v battery I can switch from 0 to 10v.
So when running the arduino (as can be seen above) I see discrete pulses I can also see these same pulses when using the 3.3v directly from the teensy pin(not pictured).
But when I go through the op amp to boost the voltage the oscilicope just shows a constant voltage at 10v and then drops to 0v when the stepper would stop moving.
I tried reducing the speed down to 8Mhz on the teensy to see if it had the same waveform and it had "A" waveform but it looked different from the arduino or 3.3v teensy
you will notice that the voltage is also dropped to around 3v(pictured below).
This did move the stepper when hooked up but not the right speed or distance(too low).
To get more information I ran a sketch to see what the max switching speed I can get with the current setup before the waveform started to make a mess.
I used a blink sketch and I can see the square waveform from 0 to 10 all the way down to about 20 microseconds.
After that it starts to have a lower voltage and look hairy.
I get a similar voltage drop to the 8mhz acellstepper code with the blink code at 10 microsecond delay.
But the blink code has a higher frequency(faster than the acell stepper).
Is this problem due to the fact that the opamp circuit is too slow?
We need to see your circuits...
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
There is no schematic to give, I have the teensy signal pin and the stepper driver input. I need to figure out a way to step up the 3.3v to 5v with enough speed to do micro stepping and enough current to trip the octocoupler.
tyscof:
There is no schematic to give, I have the teensy signal pin and the stepper driver input. I need to figure out a way to step up the 3.3v to 5v with enough speed to do micro stepping and enough current to trip the octocoupler.
If you have wires connecting teensy and stepper-driver and stepper and power supplies then you have the material for a circuit diagram.
Tom..
TomGeorge:
If you have wires connecting teensy and stepper-driver and stepper and power supplies then you have the material for a circuit diagram.
Tom..
Hi,
Where is your gnd connection from teensy to driver?
How are you powering the teensy?
Where is the stepper and its connections.
You have to be aware that you are in troubleshooting mode, and the more info you can provide the easier it is to give you accurate and precise solutions.