- Posts: 1018
- Thank you received: 0
RS232 Spindle control
- Mike_Eitel
- Offline
- Platinum Member
-
More than once we found that python had his own way of understanding. Especially when you are near to the os.
Me personally, I do not code a lot anymore, and I do not care the language, but if then I prefere iec61131. Or of it is simple avr, I love Mark Albert's compiler Bascom.
Mike
Please Log in to join the conversation.
Yeah, reading the docs tends to be fundamental when trying to solve problems. But I also started studying source codes (of Machinekit) first and it was infinite loop of Go to definitions and I have seen this 50 Go to definitions ago, what does this do again, so I get you.Mike_Eitel wrote: Hi tower. I completely agree with your way.
Have never read that doc. ;-( Will keep it in mind if I ever want to do something unusual.
Mike_Eitel wrote: 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
Python has huge problems, the versioning is complete (...obscene and profane expletive...). But for this, it is the right tool for the job. With the existence of HAL bindings library and the Serial communication library, it will make the task easier.
The task doesn't look that hard, it should be doable even for a beginner (in a week or so). A nice introduction to problem-solving machine setup.
rodw wrote: 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.
That doesn't really matter. What matter is access to general functionality ready-made libraries with the right licenses. In the aerospace field, where one cannot use non-in-house library even if it is completely free and open, you won't do it in 50 lines even if you stood on your head.
Please Log in to join the conversation.
What I don't understand is how it can be easier? You still have to implement the serial communication protocol, but this time on Arduino. And then you have to implement the digital input, the potentiometer input and transformation function for resistance-to-speed, error digital output for communication error and maybe more.bevins wrote: The easiest would be to energize a relay on spindle on and send that into an arduino.
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.
bevins wrote: Who cares if you have to go to Germany before heading back to France. You will get there either way.
Well, if you are on foot (you have to program all of it yourself), then I would care.
Please Log in to join the conversation.
- marq_torque
- Topic Author
- Offline
- Elite Member
-
- Posts: 171
- Thank you received: 0
Thanks everyone for your inputs
Ankit
Please Log in to join the conversation.
so there is a pretty good chance that all the standard VFD can run it
Please Log in to join the conversation.
- marq_torque
- Topic Author
- Offline
- Elite Member
-
- Posts: 171
- Thank you received: 0
Sir, its 44V 1000HZ spindle.... VFD support team from my country's authorized stockist said we cant go down this low voltage and this high frequency, VFD supply voltage is 240V single phase and output is 1000HZ max
Please Log in to join the conversation.
Tower wrote:
What I don't understand is how it can be easier? You still have to implement the serial communication protocol, but this time on Arduino. And then you have to implement the digital input, the potentiometer input and transformation function for resistance-to-speed, error digital output for communication error and maybe more.bevins wrote: The easiest would be to energize a relay on spindle on and send that into an arduino.
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.
bevins wrote: Who cares if you have to go to Germany before heading back to France. You will get there either way.
Well, if you are on foot (you have to program all of it yourself), then I would care.
Maybe I should have said easier for me. I do not have experience in the areas of linuxcnc this covers, but if it is anything like some of the black holes that no one can explain, sometimes the easiest route would be to do it the fastest way possible. You can get caught up for weeks at a time trying to figure something out when it can be done a different way, maybe not the most efficient way but one that works, why not? I don't know if this is for a customer or for him, but I know what I would do. sometimes a customer doesn't want to wait an extra 2 weeks or maybe months. Just saying.
Please Log in to join the conversation.
- marq_torque
- Topic Author
- Offline
- Elite Member
-
- Posts: 171
- Thank you received: 0
After long struggle i am successful to figure out Terminal command from Termite application in windows
A can send start stop signal and speed command in hex format.
Now can someone guide me how to connect python with Ini, Hal files so it can communicate with this driver.
Thanks in advance
Ankit,
Please Log in to join the conversation.
linuxcnc.org/docs/2.8/html/hal/halmodule.html
Create pins to accept the spindle speed and (potentially) on/off commands, and to supply any data back from the drive that you might get. Then inside the Python code format the command strings and output them to the chosen serial port.
That last bit is a bit handwavey, I haven't tried sending data to the serial port from Python, but the internet can probably help.
www.google.com/search?q=python+linux+serial+example
Please Log in to join the conversation.
I made a tool changer controller for my lathe with an atmega88 (little brother to atmega 328 used in Arduino). The controller accepts normal Tx and M6 commands on serial line and responds with OK or ERROR (timeouts, etc).
This is driven from linuxcnc/AXIS with a python module.
Just in case someone is interested I'll attach the code as an example.
ini:
hal:
And the python toolchange controller (.txt added to be able to attach):
Attachment not found
Please Log in to join the conversation.
