PWM Current Control using BS2sx
Carlos Formigal
Posts: 2
Hello Guys,
I have been working with stepper motor to control my milling machine. I'm considering to build a Stepper motor controller using the Basic Stamp. The motor that I need to control needs to be powered by 5 Amp and because the torque varies with speed the current must be set constant. One way to do this is to PWM the current that drives the 4 trannsistores that control each motor phase ( the motor are unipolar with 4 phase).
The question that I would like to address to this forum is:
It is possible to send at the same time a PWM signal to two ports of the B2sx and how could this be made?
I need to power up to phase at the same time by PWM.
With regards to everyone.
Carlos
I have been working with stepper motor to control my milling machine. I'm considering to build a Stepper motor controller using the Basic Stamp. The motor that I need to control needs to be powered by 5 Amp and because the torque varies with speed the current must be set constant. One way to do this is to PWM the current that drives the 4 trannsistores that control each motor phase ( the motor are unipolar with 4 phase).
The question that I would like to address to this forum is:
It is possible to send at the same time a PWM signal to two ports of the B2sx and how could this be made?
I need to power up to phase at the same time by PWM.
With regards to everyone.
Carlos
Comments
If the speed with the Stamp isn't sufficient for the option as you described, you could surely use the Propeller with two(or more) cogs outputting pulses as needed. The Propeller could have a pot as well determining the PWM duty cycle, and/or rate.
For info on the chopper circuit, this link is a great read:
http://pheatt.emporia.edu/projects/stepper/currentcontrol.pdf
Thanks for the reply. I'm really considering to use the Stamp, but seems that I can not PWM two ports at the same time. Another alternative is to use a PIC, but the Stamp capabilities to be easily programmed is blinding me. The Stamp would be use also to integrate a RPM counter in the milling or in the lathe.
The circuit that you suggest is the traditional one. I was considering in develop a PC program where I could tune the motor performance, much alike the circuit that is the the http:\\www.hobbycnc.hu. In this way the circuit would not be motor dependent.
With regards,
Carlos
A Visual Basic app could be easily put togerther that could monitor RPM, output a PWM(speed/duty cycle factor etc) to the SX's. There is a download and simulator for the SX language called SX/b that you could look at and get a feel for the similarities in programming.