Code: Select all
dim as integer i
shell "stty -F /dev/ttyS0 speed 9600"
sleep 1000
if open com( "/dev/ttyS0:9600,n,8,1,cs0,cd0,ds0,rs" as #1 ) <> 0 then
locate 1, 1
print "Unable to open com port"
end
end if
sleep 2000
do
print #1, &b00100010; &b00000010;
sleep 100
print #1, &b01000100; &b00000100;
sleep 100
print #1, &b00010001; &b00000001;
sleep 100
print #1, &b10001000; &b00001000;
sleep 100
loop
I built it from scratch, I got ideas from what I've seen online.phishguy wrote: BTW - your CNC platform looks pretty cool. Did you build it from plans, or did you design it yourself? I've always wanted to build one. But, I've never had the time, money, or fabricating equipment and skills.
I have all the specks for each piece if you want them. It might take a bit to get them all organised though lol.
Thats kind of what I'd like to do. Right now I'm trying to get FB to talk to the PICAXE. I'd like for the PICAXE to use a line algorithm and just receive coordinates.Dinosaur wrote:Hi all
It looks like you are timing and switching each phase changeover.
My experience with trying to switch the phases on the stepper motor;
1:You spent to much cpu time timing and controlling the phases.
2:You can't achieve the speed of rotation.
3:Resolution of Timing isn't good enough for smooth operation.
So, I would get a very cheap stepper board like this one
http://www.oceancontrols.com.au/KTA-179.html
which doesn't need the massive heatsinks.(unless that is your power supply) I use a similar motor
http://www.oceancontrols.com.au/MOT-128.html with the above board.
Then use the serial port with the PicAxe or other PIC and let the it do the clocking for speed only. So, tell the PIC "Motor(n) , Fwd, speed, Nbr of steps"
You can then use the PC to calculate the trajectory and update the pic via serial, allowing an acceleration curve as well as a decelleration.
Let the mundane job of phase control be done by a dedicated chip/board.
Regards