Your location:Home   News   News
CONTROL SOFTWARE EXAMPLES
 Jul 02, 2018|View:929

Below you will find some small pieces of code, mostly in C/C++, some in Assembly language for various processors and microcontrollers. This code is by no means complete, but is provided only to give a basic understanding of the software involved in controlling stepper motors both with and without the use of a hardware translator circuit.


Words of caution:


When making connections to either a PC parallel port, or I/O pins of a microcontroller, be sure to isolate the motor well. High voltage spikes of several hundered volts are possible as back EMF from stepper motor coils. Always use clamping diodes to short these spikes back to the motor's power bus. The use of optical isolation devices (optoisolators) will add yet another layer or protection between the delicate control logic and the high-voltage potentials which may be present in the power output stage. Whenever possible, use separate power supplies for the motor and the translator / microcontroller. This further reduces the chance of destructive voltages reaching the controller, and reduces or eliminates power supply noise that may be introduced by the motor.


If you're using a computer that has a parallel port as part of its onboard I/O, you may want to consider purchasing a parallel port card to use instead. I've seen them for as little as $9.99 at Fry's Electronics and other computer stores. Not only does this reduce the risk of permanently damaging or destroying your motherboard (it happened to a friend of mine!), but it will also allow you to experiment without the need for swapping cables or flipping a switchbox when you want to use your parallel printer, since your experiments won't be sharing its port. It is much cheaper to throw out a $10.00 parallel port card than it is to replace your motherboard!


Complete Software Control:


Under complete software control, there is no translator circuit external to the Parallel port or microcontroller. This scheme reduces parts count, component cost, and makes for simpler board design. On the other hand, it places the responsibility of generating all of the sequencing signals on the software. If the PC or microcontroller is not fast enough (due to code inefficiency or slow processor speed), or too many motors are driven simultaneously, things can begin to slow down. Interrupts and other system events can plague the control software more in this case. Despite the downfalls of addressing a stepper motor directly in this manner, it is definitely the easiest and most straightforward approach to controlling a stepper motor. This method of controlling a motor can also be useful where the hardware is not critical at first and a simple interface is needed to allow more time to be spent on the development of the software before the hardware is refined.


View More(Total0)Comment lists
No Comment
I want to comment
Content*
Verification code*
  

Send A Message

If you are interested in our products and want to know more details,please leave a message here,we will reply you as soon as we can.

name*
email*
tel
mess*

Contact Us

About Us

Changzhou Sunrise Electric Motor Company was founded in 2004 and is located about 200 km west of Shanghai.

We are experts within Brushed and Brushless DC motors, AC servo motors, Hybrid stepper motors and customized motor solutions. In addition, our logistical services are of the highest quality.
At Sunrise Motor, we value open communication between all parties to ensure the right solution for you.
Let our companies go hand in hand towards a profitable future. You benefit from more than 15 years of experience within electro-mechanical motor solutions when doing business with us.

The motors listed have been exported overseas through our sales representatives in North America and Europe. They apply to: application of printer, carve machine, medical instruments, entertainment lighting, textile machines, etc.

CopyRight © 2023-2024   Changzhou Sunrise Electric Motor Co.,Ltd  All rights reserved   Sitemap   All tags   Designed by Zhonghuan Internet