Output Gcode realtime to serial port (for scara)
- perlmonkey
- Offline
- New Member
-
- Posts: 3
- Thank you received: 0
I have a scara robot with its own controller, uses ac servo motors - it would be a real pain to get a new driver so that I can use step/dir pulses to run it. I'd like to just output the current gcode line from EMC and interpret it at the controller over the serial port. I write code for this robotics company so that's no biggie.
I just need to know if EMC can output the current gcode line to a serial port.
...or if anyone's done anything like this before any advice would be welcome.
ps, I tried step/dir connected to the PLC inputs of the controller, but uh, no. The Controller forces a 50% min overlap of motions and decelerates to 0 between each step.... so this will never work.
Regards,
PM
Please Log in or Create an account to join the conversation.
or i may be missing something .. their are many apps that can drip feed a txt file to a serial port , but you would then need a motion controller as an interpreter
i personaly would and have in the past used emc to run analog servo drives, without any problems . even the newer pwm servo drives can be used also
Please Log in or Create an account to join the conversation.
Hi,
I have a scara robot with its own controller, uses ac servo motors - it would be a real pain to get a new driver so that I can use step/dir pulses to run it. I'd like to just output the current gcode line from EMC and interpret it at the controller over the serial port.
I assume that the robot currently takes joint position commands on the serial port, and does not transform cartesian axis positions into joint positions?
The only reason I can see to use EMC2 in this situation is to take advantage of the kinematics that can do that transformation (and it is a good reason).
I don't think it has been done. However it might not be too difficult.
I would start by writing a test driver in comp that simply outputs a valid byte sequence to the serial port using outb(), if that works then add input pins for joint positions, and extend the comp driver to output a valid byte stream for the robot.
I am sure that it will be harder in practice.
linuxcnc.org/docs/html/hal_comp.html
There is a HAL serial port driver, but it only attempts to write to individual pins. It might be a useful starting point, though.
git.linuxcnc.org/gitweb?p=emc2.git;a=blo...4b9387abd24a7ac6d707
Please Log in or Create an account to join the conversation.
- perlmonkey
- Offline
- New Member
-
- Posts: 3
- Thank you received: 0
1. Though the robot controller has an rtos, the only method to check state on the parallel PLC inputs is a loop, so there would be latency involved resulting in "missed steps".
2. Even if I use the serial port to read the actual GCode I'll still be using the robot's motion controller, so might as well just feed GCOde to the robot manually.
3. If I could get the PLC inputs timing so that I could run off of step/pulse, for a compound joint or cartesian move, say 2 axes at once (x,y), the robot moves x first then moves y. There is no way to combine the moves so that the velocity profiles overlap 100%. The moves are limited to 50% overlap. I even tried creating a task for each axis and controlling each independently based on PLC io, but the compiler won't allow this.
I could accumulate pulses and calculate a start and end position in 3d-space, but EMC would move on to the next move before the motion is complete....
So, I may give up on this for now; well, I'll probably use our native programming language instead of GCode... sadly.
My last option is to replace each AC servo with a stepper motor. The concern there is $$$$. I'd like to hear if anyone's used steppers in a scara robot successfully with EMC before I go and purchase motors and a driver board.
The google search for steppers begins.
PM
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- perlmonkey
- Offline
- New Member
-
- Posts: 3
- Thank you received: 0
I am personally familiar with steppers, but not so familiar with AC servo's, so I don't know if anyone makes a board to drive them with step/pulse. Not sure if AC servo wiring is the same across all motors. I'll google, but anyone know of a supplier? Zaxis is 300w, arm1 is 100w, arm2 & roll axis are 50w.
What is analog velocity mode... is this an option in EMC?
Please Log in or Create an account to join the conversation.
i'd presume this is how the joints are configured . oh and yes this is a option in EMC , most industrial machines using servos of the older generation use this method ,
give some information on the machine and the AC servo's fitted , i'm sure someone will be able to identify
or post a picture of them
Please Log in or Create an account to join the conversation.
Thanks for the responses guys. I can convert between joint and cartesian, however./quote]
My point was that one of the things that EMC2 is good at is converting cartesian XYZABC into robot joint positions. So you can feed in cartesian G-code and have EMC2 do the hard sums.
Does the robot take cartesian G-code and convert internally, or take raw joint positions?2. Even if I use the serial port to read the actual GCode I'll still be using the robot's motion controller, so might as well just feed GCOde to the robot manually.
That would be a retrograde step. One of the strengths of EMC2 is that is can do full closed-loop control of any sort of actuator, including AC and DC servos. With a PWM input drive you can even do it direct through the parallel port (but probably not very well)My last option is to replace each AC servo with a stepper motor.
There are step/dir servo drives out there, but they are not the preferred choice for EMC2, as that leaves the PID loop hidden in hardware, rather than accessible and probe-able inside the EMC2 software.
If you can find a spec for the components of the system we can probably suggest the simplest, cheapest and best solutions. (Which is likely to be three separate things).
As a starting point, this page might give you some ideas as to EMC2s capabilities.
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?EMC2_Supported_Hardware
This video shows an industrial robot running a completely unmodified version of the EMC2 splash-screen.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.