| Author |
Message |
bazaria
Joined: 29 Aug 2006 Posts: 8
|
30 Sep 2006 19:14 pid ic |
|
|
|
|
Hi,
I am looking for a single chip to control a motor. This chip should have 3 PWM outputs and an encoder inputs with programmable control rule.
I found all that in a single chip LM629 but I can't find a normal way to program it. May be you can direct me to some other chip that is more comfortable to work with?
|
|
| Back to top |
|
 |
ashad
Joined: 28 Mar 2006 Posts: 307 Helped: 9 Location: Singapore
|
22 Dec 2006 15:49 pid controller ic |
|
|
|
|
hi,
use the SG3525 IC for controlling the DC motor
|
|
| Back to top |
|
 |
barfi
Joined: 11 Dec 2006 Posts: 40 Location: tehran
|
22 Dec 2006 17:39 mc3phac board |
|
|
|
|
I have some useful expriences with Lm629 and LM628 and their programming and initializing are easy and straightforward. but as I remember it was for controlling Dc motor type not for 3 ph motors!!!!
you can use Mc3phac for controlling 3 phase ac motors from freescale.
check it out!
|
|
| Back to top |
|
 |
bazaria
Joined: 29 Aug 2006 Posts: 8
|
02 Apr 2007 19:48 operational amplifier pid encoder |
|
|
|
|
The advantage of LM628 is in being capable of driving the motor and controling it's speed/position using an encoder feedback
I would appreciate any material regarding this device
|
|
| Back to top |
|
 |
maggots
Joined: 04 Apr 2007 Posts: 87
|
06 Apr 2007 4:23 schematics pid motor |
|
|
|
|
I want to know how to command lm629?
like I want to full speed or half speed?
and I afraid in my country this IC can't found....i want to where to buy it..?
thx for the information
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
29 Jan 2009 14:25 lm675 applications |
|
|
|
|
| help me.. i need some example for programing lm628 with pic16f877a..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
14 Feb 2009 3:27 lm628 source |
|
|
|
|
| I have a bunch of assembler code I've written for DSPIC 33f256gp710 and DSPIC30F4011 that controls the LM628. If you're seriously interested, I'll convert to .pdf and post it. Some of the code runs the HCTL1100 motor controller too. I had attempted to upload it yesterday before realizing that .txt files won't upload.
|
|
| Back to top |
|
 |
TekUT
Joined: 17 Jun 2008 Posts: 413 Helped: 23
|
15 Feb 2009 16:18 lm629 timing forum |
|
|
|
|
| patweadock wrote: |
| I have a bunch of assembler code I've written for DSPIC 33f256gp710 and DSPIC30F4011 that controls the LM628. If you're seriously interested, I'll convert to .pdf and post it. Some of the code runs the HCTL1100 motor controller too. I had attempted to upload it yesterday before realizing that .txt files won't upload. |
Nice stuff, I think if you can post it this can be very useful.
Thanks for your effort!
Bye
Pow
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
19 Feb 2009 18:52 lm629 programmimg |
|
|
|
|
| patweadock wrote: |
| I have a bunch of assembler code I've written for DSPIC 33f256gp710 and DSPIC30F4011 that controls the LM628. If you're seriously interested, I'll convert to .pdf and post it. Some of the code runs the HCTL1100 motor controller too. I had attempted to upload it yesterday before realizing that .txt files won't upload. |
can u upload program to control lm628 please.. thanx..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
22 Feb 2009 2:57 lm675 |
|
|
|
|
Here is the code. It's pretty well documented, but feel free to ask questions. I thought I'de have to creat a .pdf, which cost$, but finaly found the attachment button, I hope it works. I'll try to get the schematic drawn and uploaded soon. I also have similiar code I wrote for the DSPIC30F4011, I can post that too, if interested. I made an offer for a nice arm robot today on ebay. It doesn't have a controller, but the one I built would work well. I have been trying to build an arm robot, but it's difficult to do with the parts I have available. I did build a CNC mill, good for making circuit boards, but the dremel tool that is it's cutter doesn't do well with aluminum. Thanks for your interest, please reply if you see anyway I might improve it. Pat
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
23 Feb 2009 1:11 lm628 clock forum |
|
|
|
|
| Pat, thanx for the code.. it gave me some idea to program lm628.. i'm currently built a mobile robot to test encoder and precision motion controller.. i'm using pic basicpro and pic16f877a.. how u connect 6 Mhz crystal to lm628? i'm having trouble to read and write 2 byte pair at port d (lm628).. any suggestion..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
23 Feb 2009 2:57 lm628 code |
|
|
|
|
I'm using an 8 MHz powered resonator, because I have lm628-8. Just put a cap (about 10nF) on each leg of the crystal, both caps going to ground, then connect one side of the crystal to the clock input. (I could send you an 6 MHz resonator if you can't fet one). You should have an LCD display and keypad connected to the microcontroller and working, before attempting to debug the motor control circuit. This is why I have "troubleshooting IDs" in the code, so it will display a number if, for instance, it doesn't reset successfully, then I can tell where the program stopped. Once you know it Reset ok, use the same method to develop the rest of the code. The code I uploaded will work if your circuit is similiar enough, I'll try posting a scematic tomorro. I used PortE for the LCD, PortD for byte to lm628, PortG for various control signals, PortF for the keypad, PortA to select which lm628 - this is done thru a 74ls138 decoder, the first 3 bits of PortA decode to 8 chip selects. I'm appending code for DSPIC30f4011 now. This was my first attempt and a little more simple, though the circuit was different. I also used a 74ls138 to strobe the columes of the keypad, and a 74ls151 to read the rows. Please continue to ask questions, I want you to succeed. Pat
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
23 Feb 2009 4:53 pid ic |
|
|
|
|
I've attached a crude schematic for the code above. I drew a crystal with caps to show how you might connect it, note that I specified 68pF instead of the 10nF I suggested before. The LM628 code starts at "homall", about half way thru the program. There's also code to read quadrature encoder signals A, B, & IND at "enc" just before "homall". The "enc" routine uses another circuit (not shown) which reads thru bits 7, 8, & 9 of PortD. Pat
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
24 Feb 2009 1:47 lmd18200 atmega128 motor schematic |
|
|
|
|
thanx for ur help pat.. i've bought lcd to debug my program.. it seem that my problem is to write 2 pair of data byte (16 bit to port d of lm628),how do i know that i've succeed to write that?
then another problem.. it is necessary to use 'power' op amp such as lm12 and lm675.. i found that those ic not sell at my place.. then i try normal op amp,lm324 but my motor did not run even though the output of op amp is 12v.. any solution pat..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
24 Feb 2009 2:48 lm675 application |
|
|
|
|
What type of DAC are you using? You need to write one byte at a time to the lm628, then after writing two bytes, you need to check the busy bit (bit zero of the status byte) then wait for busy bit to go low before the code proceeds. You also need to check busy bit after writing an instruction. If you check the status byte, you can tell if the data was accepted by checking the "command error" bit #1. The 324 op amp won't provide enough current, you need a power op amp or a set of complimentary transistors in "push-pull" operation to provide at least a few hundred milliamps, depending on the motor and the torque required for your application. Can you obtain parts like these?
I looked at the datasheet for pic16f877, I understand you're using PortD for the LM628. What bits are you using for RD, WR, PS and Reset? Perhaps you could use PortB for the LCD and PortC for the keypad. Then use PortE for keypad control signals Rd/WR, En and RS. You could use PortA for the LM628 control signals and have two bits left over to select one of 4 axis. Can you post a schematic of your circuit? Maybe I could suggest some code if I could see the circuit.
Also, after looking at the datasheet, I realized that you must connect both pins of the crystal, one to "clock in" and the other to "clock out", then connect the two 68pF caps from the pins to ground.
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
24 Feb 2009 4:35 hctl1100 atmega |
|
|
|
|
here the schematic.. the DAC i just use simple r2r resistor network.. no op amp yet..
port declaration using picbasic pro..
DEFINE OSC 20
TRISB =%00000000
TRISC =%00000000
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 4
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
RST VAR PORTC.0
CS VAR PORTC.7
RD VAR PORTC.6
WR VAR PORTC.5
PS VAR PORTC.4
HI VAR PORTC.3
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
24 Feb 2009 19:54 timing du lm629 |
|
|
|
|
Using an R2R ladder, you could just connect it's output to the base of a large transistor, but you would only be able to drive the motor in one direction, still good enough to test the encoder though. I'm not familiar with picbasic, though I did use ms basic years ago. Is that part of MPLAB? The declarations look a little like C code, I notice you havn't defined TrisD here. If you translate parts of my code to picbasic, it may compile differently. Look at the subroutines from "posmove" to "getc", these are the routines that communicate with the lm628, after the reset is done.
Again, my last post confused about where you wanted to connect the crystal, just one leg to the clock input of lm628. I'm appending a schematic of how you might connect a transistor. I drew a couple of biasing resistors and suggested values, these may not be nessacary, or you may have to experiment with the values. I drew 2 schemes, one for NPN transistor and the other for PNP, depending on what you want to use.
I made the mistake once when I first started using these, of soldering wires to the socket for the lm628 while it was in the socket. I zapped the quadrature connections.
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
24 Feb 2009 20:21 33f256gp710 |
|
|
|
|
I've appended a picture of the layout I have. The board on the left is the microcontroller, the board on the right is the dual lm628 board with current amps, heat sinks and a couple of motors attached. The one in the middle has 4 lm629s surface mounted, with lmd1802 current amps and differential line recievers for the encoders. I found it in the trash, three of the channels still worked! Pat
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
25 Feb 2009 2:49 pid dc motor routines |
|
|
|
|
wow.. i'm looking forward to use big PiC like your.. actually it is easy to use with picbasic but it just suitable to use with pic16 family.. actually i use port D to connect to data/command port at lm628 and i always change the value(trisD =$FF or $00) to read and give output.. yesterday i found lm675 at online store at my place and it very expensive compare to PIC16f877a.. at last i decide to use another PiC to convert from DAC port at lm628 to PWM value.. pwm driver i just use mosfet irfz44n.. i hope it will work..
pat,i not familiar actually with assembly for PiC.. it take a time to understand your code.. can u show me only code for hardware reset subroutine.. and some explanation.. do u know the easy way to get 3 filter coefficient,Kp,Ki,Kd for lm628.. thanx..
|
|
| Back to top |
|
 |
Google AdSense

|
25 Feb 2009 2:49 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
pico
Joined: 30 Sep 2001 Posts: 285 Helped: 6
|
25 Feb 2009 5:40 lmd18200 on atmega |
|
|
|
|
LM628/LM629 User Guide
http://www.eurotech.fi/products/manuals/lm629_user.pdf
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
26 Feb 2009 0:59 intergrated circuit pid |
|
|
|
|
| pat? any solution..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
26 Feb 2009 2:04 pid profile motor |
|
|
|
|
| I'm away from my home computer for a couple of days but....When you're initializing your microcontroller, keep the "reset" signal to lm628 high. Then, when starting the reset routine, bring reset and CS low, goto delay route for a 20 milliseconds, Then bring reset high again, read and compare the status byte to hex "84", if equal reset was successfull, if not, compare status to "c4", if equal, you're successfull, if not try displaying the status byte to see what went wrong, or just go back and try again from initializing the micro. If you can't display the stat byte, just leave it in a loop at the read lm628 routine and measure the voltages on the data pins to determine the states. If reset was successfull, you then must reset the interupts (command "1d) before writing motion commands. After writing "1d" (reset interupts) you must again read the stat byte and compare it to "c0" or "80" to assure that was successfull. I don't have access to manuals or home computer until tomorro, I'll try to write a detailed sequence of events / commands.
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
27 Feb 2009 1:32 pid integrated circuit |
|
|
|
|
I've attached a detailed listing of the reset routine. a few things to consider;
* I'm not using "HI" from LM628, instead, I'm testing the bits of the status register, this alternative method is described in the LM628 Prog Guide
*W8 (working register #8 ) is used to pass data / status back from the "getc" (get command) and getd routines.
*w9 used to pass data / commands to wrtd (write data) and wrtc routines
* I use an optical sensor for home flag that is connected to "index" pin of LM628, so I test "index set" bit 3 of status byte to see when home is sensed,, then "stop" routine, then "define home" command to zero position registers of LM628.
I'm assuming you are a little familiar with assembly code, it's written in the format;
COMMAND ARGUMENT1, ARGUMENT2 ;comments
where sometimes ARGs 1 and 2 are source and destination registers, or a constant and destination register, or a register and bit number. I've defined most of the commands in this listing.
I can't think of a better way to describe this to you, please question if needed, or suggest a better way. If this is OK, I'll describe the other routines this way when you're ready.
It would be better if you could get an LM629 istead of additional pic for PWM, the 629 outputs PWM.
The PID (Proportional, Integral, Derivative) constants are input during the LFIL (load filter) routine, I'm only loading the proportional constant right now, until I can profile the servo performance under load conditions, which is how this is usualy determined (under load). I can explain what these are for, though it may be better to consult some web document about this.
|
|
| Back to top |
|
 |
kender
Joined: 19 Jun 2005 Posts: 1231 Helped: 88 Location: Stanford, SF Bay Peninsula, California, Earth, Solar System, Milky Way
|
28 Feb 2009 3:00 pic16f877 cnc jog interface schematics |
|
|
|
|
| Curious, are ICs similar in function to LM628/629, but with a serial interface (such as I2C or CAN)?
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
28 Feb 2009 3:56 stepper motor jog seq picbasic |
|
|
|
|
No, I'm pretty sure there are no ICs for motor control with integral serial comm. Typicaly, mass marketed ICs integrate functions only if it's used that way most of the time, can be manufactured with compatible technologies and cost is not dispropoprtionate to value added. Probably could order up an ASIC though. PMC ( http://www.pmccorp.com/products/products.php ) makes motor controllers that are bus compatible (ISA, VME and PCI ), and a comm module would also be on that bus in say, industrial enviroment. But if anyone knows of a motor control IC with serial comm, please let us know. Pat
Last edited by patweadock on 28 Feb 2009 21:52; edited 1 time in total |
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
28 Feb 2009 21:34 ic pid |
|
|
|
|
| sorry for late reply,i just finish solder the circuit.. and troubleshoot.. and now i can concentrate more on programming.. the due date for my project is 16 march.. i hope i can finish it sooner.. still there is trouble with lm628.. when writing 16 bit data in data port of lm628,how long the delay that i should use between high byte and low byte? there is 3 input for encoder (in,A,B),which port should i use,i'm using 1 channel encoder..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
28 Feb 2009 23:07 pid oamp |
|
|
|
|
I've attached code with comments and timing diagram with parameters written in and reference in code comments (like T8, T15..). If you understood the previous "code describe", you should have no trouble with this. Please ask if it's not clear.
The quadrature pins (A,B, Ind) on lm628 should connect to the motor encoder. You could also read them with the microcontroller, there is a routine in my code to display their states as " A, a, B, b, I, i" on the LCD. But if it's working right, you should just be able to read position from lm628 (command "0A") which would give you the results of the encoder counts. There's also a routine in my code that displays position automaticly after you jog the motor. It calls "WrtDWrd" to display position after detecting that the jog direction button is not pressed and stopping motor. This is why the "getD' (get data) routine reads 4 bytes from the lm628, because the position register is 2 words (32 bits), this is commented pretty well in the attachment. Pat
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
04 Mar 2009 4:46 mc3phac applikation |
|
|
|
|
| pat,i've tried using a code similar to your but i still failed to reset interrupt because the value C0hex or 80hex not shown even though i try looping.. for reset is ok because lm628 gave value C4hex..
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
04 Mar 2009 19:05 use lm628 with lmd18200 |
|
|
|
|
You are having very similiar experiance to mine when I was developing this code. I was getting status of c2 after reset (position error). So I ignored status and tried to move motor. It would start moving but not stop when I released the jog key, or it would stop and print position to LCD that would indicate it only moved 1 or 2 quadrature clicks. My problem turned out to be that I had soldered the A, B, & Ind wires from the encoder to the socket for LM628 while the chip was in, and burned out those inputs to my LM628. At first I suspected the encoders, so I wrote that code to read and display encoder stats. They worked fine, so I tried replacing my LM628 and everything was good.
Perhaps you have a similiar issue. If it reset OK, it is communicating correctly, so the status byte should provide some clue to the problem. Also, try displaying status byte after Reset Interupts, and then go to relative velocity move routine regardless of status and observe the motor behaviour, that may provide clues as well. Please let us know. Pat
|
|
| Back to top |
|
 |
inifinitrix
Joined: 30 Jul 2006 Posts: 80 Location: MALAYSIA
|
05 Mar 2009 2:04 74ls151 projet |
|
|
|
|
| sometime it show value c2hex too but it usually show c4hex value.. i put 5v on index and B input,A input i connect to encoder..
|
|
| Back to top |
|
 |