controlling coolant w/serial port

More
14 Jul 2009 06:14 #538 by jerrybaca
i just swithed over to emc2 motors setup ok but my coolant is on com1 and is controlled by sending the the string RMAA1 to turn on and RMAA0 to turn off to serial port 1 at 2400, 8,n,1 have no clue how to do this any help would be apprieated

Please Log in or Create an account to join the conversation.

More
14 Jul 2009 06:48 #540 by cmorley
Need a little more info. Do you know if the coolant control you are controlling is actually decoding the serial message
or is it just sensing one of yhe serial pins changing from hi to low?
There is a userspace serial port driver (serport) but it is only for turning specific serial pins on or off.
If it is actually decoding the serial message then AFAIK there is no available driver.
There is a couple of modbus components that use the serial port.....

Please Log in or Create an account to join the conversation.

More
14 Jul 2009 22:15 #541 by jerrybaca
it decodes the string so all i need to do is send the string to the serial port
it is conected to a relay matrix w 8 high curent relays
RMA adrteses relay matrix a there can be 16
A is for the first relay and a 1 turns it on and a 0 turns it off

Please Log in or Create an account to join the conversation.

More
15 Jul 2009 00:40 #542 by cmorley
Well then one would need to write a HAL component to write the string to the serial port.
I assume none of the devices run by the serial port need 'realtime performance'
meaning basically they have nothing to do with actually positioning the axis.
If you don't know how to do this you might try and ask on the EMC mail list or IRC and
see if anyone is interested in helping you get it working.

Please Log in or Create an account to join the conversation.

More
16 Jul 2009 18:03 #548 by mozmck
Hi jerrybaca,

I think I can write a component for you that will do what you need. I'll make it so you can control all the relays. I presume the second relay is B, third is C and so on? Also, you say there are 8 relays but that there can be 16? So I guess the letter for the last one would be P?
Please confirm when you can.

Moses

Please Log in or Create an account to join the conversation.

More
16 Jul 2009 21:41 #550 by jerrybaca
that would be nice

i had made a small error in the string it should have read RM1A1 TO TURN ON and RM1A0 to turn off

the charActers need to be sent 1 at a time here is a example from my last set up

REM COOLANT ON
SERIAL.OUPUT "R"
SERIAL.OUPUT "M"
SERIAL.OUPUT "1"
SERIAL.OUPUT "A"
SERIAL.OUPUT "1"



REM COOLANT OFF
SERIAL.OUPUT "R"
SERIAL.OUPUT "M"
SERIAL.OUPUT "1"
SERIAL.OUPUT "A"
SERIAL.OUPUT "0"



THE RM1 DENOTES RELAY MATRIX 1 THERE CAN BE 16 MATRIX EACH HAVING 8 RELAYS INDIVIDUAL RELAYS ARE INDEXED AS A THROUGH H

A 1 TURNS A RELAY ON AND A 0 OFF

SO THE WAY IT SHOULD WORK IS M8 TURN ON COOLANT M9 TURN COOLANT OFF


THE REASON YOU SEND EACH CHARACTER AT A TIME IS IF SENT TO FAST IT DROPS A CHARACTER IT HAS A PIC ONBOARD ITS A LTTLE SLOW ON RECIEVING

ANY HELP WOULD BE APPRECIATED

Please Log in or Create an account to join the conversation.

More
16 Jul 2009 22:18 #551 by mozmck
That's a lot of relays! One thing I forgot is what baud rate does this use? Is there documentation on this board on the web somewhere that I can look at?

I'll make it so you can attach any function to any relay using hal.

Thanks,
Moses

Please Log in or Create an account to join the conversation.

More
16 Jul 2009 22:40 #552 by jerrybaca
2400 ,8,n,1

no docs on the web as its my project i do a lot w/pics and am quite proficient at windows programing and interfacing but cant make heads or tails of emc2

Please Log in or Create an account to join the conversation.

More
16 Jul 2009 22:43 #553 by jerrybaca
also i only have one matrix hooked up at this time

Please Log in or Create an account to join the conversation.

More
19 Jul 2009 19:39 #580 by mozmck
Hi Jerry,

I've attached the component I wrote in python. I tested it by connecting my laptop via a null modem cable and making sure it actually sent the correct data.
You will need to install the python-serial package: type "sudo apt-get install python-serial" in a terminal to do that.

To use it I put the following in custom.hal which was generated by stepconf, but will not be overwritten if you change the configuration later.
loadusr ./serial-relays.py

net coolant-mist <= iocontrol.0.coolant-mist
net coolant-flood <= iocontrol.0.coolant-flood

net coolant-mist => serial-relays.relay1A
net coolant-flood => serial-relays.relay1B

That attaches two relays to different coolant functions, and you can change it to what you need. I'm not exactly sure what all is involved in using the other relays from gcode, but they can be attached to any hal pins like I did above. You can see from the top of the component code that there are pins defined for relay1A through relay1H. There are also some time.sleep(...) functions in between sending each character that are commented out. If the data is being sent too fast just uncomment those lines and adjust the time (currently .01 seconds) until it works properly.

Anyhow, hope it works, and let me know if you have any problems or more questions!

Moses

Please Log in or Create an account to join the conversation.

Time to create page: 0.130 seconds
Powered by Kunena Forum