horwich Posted October 7, 2016 Report Share Posted October 7, 2016 Hi all Just starting a fight with a M90-TA2-CAN PLC. I need to control a stepper motor driver with this. I see there is no PWM output available on this model, so I will try the approach of using a timer to flip the port status and create the pulse stream. I only find a 10ms timer as best, and I´m worried that is not fast enough to drive at the speed required. Most likely I´m not using the right approach here. Any other ideas? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted October 8, 2016 MVP 2023 Report Share Posted October 8, 2016 Any reason why you're using an M90 in a new application? This is an ancient model, and it's not suited for what you're trying to do. You could improve your speed with an Interrupt routine, but only to 2.5 ms per operation. There are several V130s that have hardware level stepper control. I would HIGHLY recommend switching platforms. What other I/O requirements do you have? Joe T. Link to comment Share on other sites More sharing options...
horwich Posted October 10, 2016 Author Report Share Posted October 10, 2016 On 08/10/2016 at 11:58 PM, Joe Tauser said: Any reason why you're using an M90 in a new application? This is an ancient model, and it's not suited for what you're trying to do. You could improve your speed with an Interrupt routine, but only to 2.5 ms per operation. There are several V130s that have hardware level stepper control. I would HIGHLY recommend switching platforms. What other I/O requirements do you have? Joe T. Hi Joe Thanks for your quick reply. I,m just retrofitting an old dough lamination machine. The stepper motor just controls the lamination roller height, so precision or speed is not paramount. I had this M90 stuck on a shelf for years, and when the machine controller broke down last week, it was the most suitable thing at hand for a quick fix. I,m about to finish the program. Worst case scenario I will use the analog out linked to an arduino to provide the pwm, and read the pulses with the high speed input. As I told precision is not key here, so some missing steps up or down during the program doesn't make a difference. I will send the roller to the home position after every complete cycle to reset the position. If it goes OK, with more time I will implement into a SM70-J-T20 , so I can retrofit all the three machines on site. Other I/Os are just some sensors and relays, no rocket science here. What about that interrupt routine? Do you have any example? Thanks in advance for your help. Is something like this: Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted October 14, 2016 MVP 2023 Report Share Posted October 14, 2016 I don't have an example handy, but if you get a program started I can help. You'll be using one of the Special Functions to get it. Open the U90 Help and type "interrupt" under the Search tab. Something to consider is the interrupt is rather slow - 2.5 ms. Check your scan time online (SI 0) and see if you even need it, especially if you're not worried about response time. If creating steps with a couple of timers set to 0.01 seconds will do then that is much easier. Joe T. Link to comment Share on other sites More sharing options...
horwich Posted October 15, 2016 Author Report Share Posted October 15, 2016 On 14/10/2016 at 1:08 AM, Joe Tauser said: I don't have an example handy, but if you get a program started I can help. You'll be using one of the Special Functions to get it. Open the U90 Help and type "interrupt" under the Search tab. Something to consider is the interrupt is rather slow - 2.5 ms. Check your scan time online (SI 0) and see if you even need it, especially if you're not worried about response time. If creating steps with a couple of timers set to 0.01 seconds will do then that is much easier. Joe T. Thanks a lot for your reply. You were pretty right on your first reply about using this such model... Now I just found that the backup battery does not retain the variable data after a power cycle.... and I only realised at the very end of the project. Obviously is my complete fault as I only did a quick check on the online help and lost the detail about the database not being backed up. Now that I'm really screwed, does the Samba models do retain all the variable and database parameters? Which model will be the Samba alternative with a proper PWM output? Thanks again for your help. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted October 16, 2016 MVP 2023 Report Share Posted October 16, 2016 Yes, the Visions remember variable values. Except the actual high speed counter value which always resets to zero, but you can program around that with a last value buffer. The M90 fits in a 1/4 DIN hole, so I'd stick with something the same size. You haven't specified what output speed you need, though. If you've got your heart set on a Samba, use an SM35-J-T20. It technically has stepper driving built in but is limited to 1 KHz on a sourcing output. I know the specs say .5 KHz, but I've run it faster. If you want a real stepper drive, you'll need one with the NPN high speed sinking outputs. Entry level with this functionality is a V130-x-TR20, and the outputs are rated to 200 kHz. You can also get this I/O board in the V350. Joe T. Link to comment Share on other sites More sharing options...
horwich Posted November 6, 2016 Author Report Share Posted November 6, 2016 On 17/10/2016 at 0:10 AM, Joe Tauser said: Yes, the Visions remember variable values. Except the actual high speed counter value which always resets to zero, but you can program around that with a last value buffer. The M90 fits in a 1/4 DIN hole, so I'd stick with something the same size. You haven't specified what output speed you need, though. If you've got your heart set on a Samba, use an SM35-J-T20. It technically has stepper driving built in but is limited to 1 KHz on a sourcing output. I know the specs say .5 KHz, but I've run it faster. If you want a real stepper drive, you'll need one with the NPN high speed sinking outputs. Entry level with this functionality is a V130-x-TR20, and the outputs are rated to 200 kHz. You can also get this I/O board in the V350. Joe T. Joe. Thanks a lot for your help and advice into this. Sorry I didn't replied before, but after finishing the M90 coding I had a loads---t of due tasks to complete. The M90 is doing OK now, had to install an encoder to feedback the position and install a separate 24v line with a backup battery to keep the programs alive. At least the machine is up and running now. I'm ordering next week a SM70-J-T20 to have a definitive solution. 400hz is the most I need to drive the motor at the desired speed. I'm very pleased I found unitronics PLCs time ago. By far they have the most intuitive coding platform. Developing applications with them is very swift. Again thanks a lot for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now