Hi Ben Roy!
Please have a look here: viewtopic.php?f=76&t=21359 It was not possible for me to continue in the tread?
As far I understanding concerning this stepper component, is that it is possible to control the motor directly via fet transistor or Step & Direction.
I imagine that, the Step & Direction mode is to control a moduledriver for the steppermotor. Could be one like this : https://www.ebay.com/itm/5PCS-A4988-Ste ... Swl9BWKyv1
I have tested Roy´s program, and made one by myself. Converted to an Aduino and a Pic16f876. But it doesn´t get any puls out?.
I suppose that the I should get a frequency output on the dedicated pin depending on the delay in the loop? I don´t get any. Have I misunderstod something, by using this?
Thank´s in advance
Jorgen
Stepper motor. Step & direction!
Moderator: Benj
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Stepper motor. Step & direction!
- Attachments
-
- 18F26K22_TWO_STEPPERSConvert 876.fcfx
- (21.94 KiB) Downloaded 228 times
-
- Stepper Puls Mega.fcfx
- (7.83 KiB) Downloaded 232 times
-
- Stepper Puls 876.fcfx
- (8.34 KiB) Downloaded 238 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Stepper motor. Step & direction!
Hi Jorgen,
I've had a look at the C code generated by the component and it looks ok to me. You can maybe take the enable icon out of the loop and place before but I don't think this would cause any issues.
Here is the simplified component code for the IncrementStep function, I could make the delay adjustable via a property if this is the cause of the problem.
I've had a look at the C code generated by the component and it looks ok to me. You can maybe take the enable icon out of the loop and place before but I don't think this would cause any issues.
Yes you're correct here the Step and Direction mode is used with a stepper motor driver IC or module.As far I understanding concerning this stepper component, is that it is possible to control the motor directly via fet transistor or Step & Direction.
I imagine that, the Step & Direction mode is to control a moduledriver for the steppermotor. Could be one like this
Currently in the code the output pulse is only high for 1us. Could this be the problem and maybe we are trying to pulse the output too fast?I suppose that the I should get a frequency output on the dedicated pin depending on the delay in the loop? I don´t get any. Have I misunderstod something, by using this?
Here is the simplified component code for the IncrementStep function, I could make the delay adjustable via a property if this is the cause of the problem.
Code: Select all
void IncrementStep()
{
if (ENABLED)
{
// DirectionPin = 1
SET_PORT_PIN(A, 1, 1);
// StepPin = 1
SET_PORT_PIN(B, 0, 1);
DELAY_US(1);
// StepPin = 0
SET_PORT_PIN(B, 0, 0);
}
}
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Stepper motor. Step & direction!
The A4988 driver IC seems to have a minimum pulse width of 1uS so this should be ok but is maybe a bit close for comfort.
I'll make the delay into a property so you can tweak the value if needed.
Edit, this has now been added and pushed to the update system.
I'll make the delay into a property so you can tweak the value if needed.
Edit, this has now been added and pushed to the update system.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Stepper motor. Step & direction!
You are amazing.
Again thank`s Ben. I make an Update later today, and a test, you hear. I did not know that the puls is so short, honestly I was only checking the output with a scoope, so my timing and trig was maybe to short.
Br.
Jorgen.
Again thank`s Ben. I make an Update later today, and a test, you hear. I did not know that the puls is so short, honestly I was only checking the output with a scoope, so my timing and trig was maybe to short.
Br.
Jorgen.
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Stepper motor. Step & direction!
Hi Ben!
Again succes from you
Working perfect. Very nice detail to be able to change the "Ontime" Working. Thanks.
Br Jorgen.
Again succes from you
Working perfect. Very nice detail to be able to change the "Ontime" Working. Thanks.
Br Jorgen.