- Posts: 1018
- Thank you received: 0
RS232 Spindle control
- Mike_Eitel
- Offline
- Platinum Member
-
Best would be to find somebody that could help you to get a hal module.
Second I would use normal pwm and send that puls stream to an pwm/0-xV on an arduino analog input. Plus the hal start and eventually direction digital signal.
= 3 outputs from linuxcnc via lpt - > 2 digital inputs plus 1 analog input of Arduino.
Inside Arduino you have to transform the voltage to number. Than you have to write a "gluing" soft that decides in dependance of the inputs which stream is send to the VFD.
I think you can keep it simple and ignore the responses.
Mike
Please Log in to join the conversation.
- marq_torque
- Topic Author
- Offline
- Elite Member
-
- Posts: 171
- Thank you received: 0
I got direction now, Will now start figuring arduino to work with 0-10v output of EMC
Thanks
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
- Posts: 1018
- Thank you received: 0
I think this can be easier for a not (jet) specialist
Mike
Please Log in to join the conversation.
Forget the analog signal control loop or Arduino, as that looks like trying to travel from Paris to London by stopover in Vladivostok. (And it's just clear nonsense.)
Sorry, I didn't understand: Are you able to connect the drive to your computer via serial port and successfully communicate with it? So are you able to start the spindle, set speed and stop the spindle with the help of some serial communication software?
Please Log in to join the conversation.
- marq_torque
- Topic Author
- Offline
- Elite Member
-
- Posts: 171
- Thank you received: 0
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
- Posts: 1018
- Thank you received: 0
Please Log in to join the conversation.
marq_torque wrote: Yes i am able to start stop set speed via RS232 software, i have attached command list in first post but dont know how to append them with other softwares.
Great. And that RS232 software was something from the producer (i.e. it has only GUI with buttons) or was it something like RealTerm ?
Mike_Eitel wrote: I agree with your judgment tower, but are you the guy who helps him out in giving him a helping hand to write a component that "jumps" between real-time hal and serial communication with its non real-time (eventually) jittering character interface?
It does not need to be deterministic real-time. It is just a drilling machine for PCBs. My version has start/stop Proxxon on it. Basically what marq_torque needs is userspace (loaded by loadusr) component in python like this doc page describes (and I say it as a person who doesn't like Python).
The drive can be polled only for example every half second. I don't know if the author is on friendly terms with at least basic programming but it should not be hard with some googling and reading a few introduction tutorials to Python. Then it's needed to look at the PySerial library or similar and try to communicate with the drive from Python.
As a basic way of action, I would recommend creating a python HAL module with one boolean input pin and one output boolean pin. The input will be for start/stop command and the output will be status running/not running. Then from the main loop, it would every 0.5s send start command if the input pin is true (drive needs at least every 4s to receive any command when running, otherwise will shut itself down) and will send stop command once on a crossing of the command pin from true->false. Will receive a response (all aforementioned communication is request-reply) and write status pin.
When this is working, adding speed command and other whistles would be pretty straightforward.
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
- Posts: 1018
- Thank you received: 0
Have never read that doc. ;-( Will keep it in mind if I ever want to do something unusual.
It's really what I would call a starter. Unhazels all kind of real-time problems.
And I also agree to your not very positive judgment towards python. A language that does not force you to make declarations is bitting you sooner or later
Mike
Please Log in to join the conversation.
Use the arduino with a pot to set speed and have arduino send out rs232 message depending on where the pot is set at or even a switch with preset speeds 10 for example. Surely you don't need that much rpm control, its just a drilling machine unless you want to use it for something else.
Who cares if you have to go to Germany before heading back to France. You will get there either way.
Just my 2 cents.
Bob
Please Log in to join the conversation.
And I also agree to your not very positive judgment towards python. A language that does not force you to make declarations is bitting you sooner or later
Mike[/quote]
Yes, I'm much more comfortable with C, but with Python you can get done in 50-100 lines in Python can take over 1000 in C. Particularly if you start playing with API's out there on cloud based systems.
Please Log in to join the conversation.
