![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Open Source Controller Boards Discussion for Open Source CNC type Controller Boards and other related items. (for personal use only) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| Anyone up for a collaboration project? The best open source servo driver ever! ![]() Let's talk specifications: Written in C/C++. Based on Amtel AVR ATmega48, 88, 168 (differ only in memory sizes). Easily portable to other models by using port/pin defines. Minimalistic board design. Programmed on board with ISP. Inputs/outputs: Enable input. Step/dir or quadrature input. Encoder input 1x, 2x or 4x. Current sensing with A/D converter. Fault output. Auto tuning button. Reset button. Control: 2 PID loops, torque loop controls output PWM, position loop controls torque. Autotuning with Ziegler Nichols method. Settings: Max current limit (over the limit = fault). Max continuous current limit (over the limit for 1? second = fault). Max error limit (over the limit = fault). Max PWM output. Step multiplier 1-10. Safety: Missing encoder check (Max? PWM output for x loops without any encoder interrupt = fault). Because the driver is open source and built for a specific use by each user, the settings is set at compile time by defines, and therefore you would not need any RS232, only 1 button to initialize the autotuning and 1 button for reset! It would reduce the size and cost of the driver a bit, as you don't need DB9 connector, the MAX232 ic and the supporting components! It also reduces the memory requirement for the µC as you don't need a communication protocol. Comments? |
|
#2
| |||
| |||
| I have written the encoder input earlier! It works by setting interrupts for the 2 encoder input pins: Rising edge on pin A, nothing on pin B = 1X Logical change on pin A, nothing on pin B = 2X Logical change on pin A, logical change on pin B = 4X Code: ISR(INT0_vect)
{
if(bit_is_set(PIND, PD2))
{
if(bit_is_set(PIND, PD3))
{
ProcessVariable--;
} else {
ProcessVariable++;
}
} else {
if(bit_is_set(PIND, PD3))
{
ProcessVariable++;
} else {
ProcessVariable--;
}
}
}
ISR(INT1_vect)
{
if(bit_is_set(PIND, PD3))
{
if(bit_is_set(PIND, PD2))
{
ProcessVariable++;
} else {
ProcessVariable--;
}
} else {
if(bit_is_set(PIND, PD2))
{
ProcessVariable--;
} else {
ProcessVariable++;
}
}
} |
|
#3
| |||
| |||
| I have done some coding now. I dropped the quadrature input, enable input and PORT/PIN defines. Implemented: Save and Load PID parameters from eeprom. Step/Dir input with step multiplier. Encoder input, 1X, 2X and quadrature. I have only used notepad so i don't know if it will compile! Code: #define F_CPU 20000000U //20 MHz External Oscillator #include |
|
#4
| |||
| |||
| I think you may want to look at a different autotuning method than ZN. I have used ZN manually and within emc there is a PID with ZN tuning built in. It gets you sort of close - but in the end a bit of manual tuining is required. (I don't know what is out there) Good luck sam |
![]() |
| 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 |
| servo driver for yaskawa | chriswp | Servo Motors and Drives | 5 | 02-11-2009 04:17 AM |
| Phelps CNC Servo Driver | dgoddard | General Electronics Discussion | 0 | 08-28-2008 03:05 PM |
| Servo driver | karl1 | General Electronics Discussion | 21 | 03-21-2007 08:51 AM |
| Basic driver for an AC servo | phantomcow2 | Servo Motors and Drives | 1 | 12-18-2005 11:57 PM |
| have anybody making servo driver? | masaV | Servo Motors and Drives | 0 | 06-20-2005 03:10 AM |