![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I have been working on some code to drive two steppers from step/dir inputs on a pic 16f628a. it also has full/half step modes. Its written in C, compiled using the open source SDCC To control actual motors, its a simple task of hooking up some FET's or power transistors to the outputs and drive bipolar motors. and of course hooking up the inputs to a pc parallel port and running EMC2 etc.. some improvements I would like to make: -Use a pic16f88 with analogue feedback to regulate current, maybe attempt microstepping, like the linstepper but using fets and pwm -Use the USART and write a driver for EMC2 to allow 3 steppers to be controlled from one chip. anyone have any experience in this? maybe EMC already supports rs232 output? |
|
#2
| |||
| |||
| Usually to get current feedback you could use a shunt resistor with a known millivolt output per amp of current - like 50mv/amp so you know that an analog output of 2 amps would produce a 100mv "drop" across the shunt that you would feed back to your AD (Analog to Digital device) if you wanted to request the current reading. If you were setting limits on current for over current purposes you could feed this analog voltage back to a Magnitude Comparator (like an LM339) this would give you a more immediate over-current protection (real time instead of having to process the analog signal to digital conversion) Don't know what EMC2 is, know of the PIC MPU's but have never used one always stayed with the more conventional stuff like the Z80, 8088, 80286 CPU's but my guess would be that yes you could write a drive in "C" using ASCII code and knowing the protocol of the receiving device -- like start bits, stop bits, parity checking, baud rate, non-printable ASCII code that may be required like CR (carriage return) and LF (line feed). I write code in VB for many serial devices -- a good book on the subject would be Jan Axelson's "Serial Port Complete". Hope this helps. Norm P |
|
#3
| |||
| |||
| Would there any issues with timing by running 2 motors from one pic and using just the internal oscillator? is there a limit to how fast the motors could spin other then what their limit is anyway? |
![]() |
| Tags |
| pic motor stepper control |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mechatronics 3 Axis Stepper Motor Driver | Chaka | LinuxCNC (formerly EMC2) | 8 | 02-10-2009 01:21 PM |
| Dual Z axis and Dual Spindle | Adamj12b | Mach Software (ArtSoft software) | 3 | 08-28-2008 03:15 PM |
| 3 axis stepper motor driver using a single PIC | david90 | PIC Programing / Design | 5 | 04-05-2008 09:22 PM |