Home > Forum > Controllers SlimLine e Netsyst (LogicLab) > Manage stepper motors with a system SlimLine
- This topic has 12 replies, 2 participants and was last updated 1 year, 1 month ago da Sergio Bertana.
-
AuthorPost
-
September 24, 2013 at 4: 08 pm #35420LucaParticipant
Wanting to interface one SlimLine to a driver for a stepper motor what is the maximum frequency of an output card to be matched to the clock pulse generator that determines the number of steps?
September 25, 2013 at 3: 56 pm #37795Sergio BertanaAdministrator ForumForms SlimLine ARM7 IEC61131-3 CPU, have a hardware PWM output (Out 0), which can generate square wave signals with a limit of 1 Khz. Using the SysSetPWMOut function block, set PWM output (Manual extract), both the output frequency and the duty cycle can be set.
Actually the PWM generator can be programmed to generate much higher frequencies, but the output OptoMOS cuts the frequency. The value of 1 Khz is guaranteed, but by adjusting the Duty-Cycle value in order to compensate the difference between the ON time and the Off time of the OptoMOS it is also possible to reach values higher than 2 Khz.
If you connect the Out0 output with the Inp0 input using the function block SysGetCounter get counter, it is possible to use the hardware counter to count the output pulses and in this way also to manage the positioning loop of the stepping motor.
In this post another possible solution.
May 19, 2014 at 4: 11 pm #38251AuthorlessIdleGood evening, I'm a new user. I am very interested in the possibility of generating PWM signals with a module SlimLine ARM7 CPU. In the hardware manual (Download section) there are limits to the maximum values in relation to the Ton and Toff times. As for the maximum frequency of the output signal, I would like to know if it is possible to obtain precise information on how far one can go beyond the guaranteed value of 1Khz.
May 27, 2014 at 3: 43 pm #38252Sergio BertanaAdministrator ForumAs I said before you can go up to 2 Khz. However, I performed an oscillographic measurement and with a 1KOhm load on the output I got the result you see from screenshot.
As you can see I reached the frequency of 2,5Khz with a duty cycle set at 78%. In reality, due to the delays of the OptoMOS at the output, the real duty cycle of the signal is about 50%. As you can see, the closing time of OptoMOS (signal rise) is much slower than the opening time (signal descent). The active output level is 12 Vdc.
September 11, 2014 at 9: 35 am #38412AlessandroParticipantI should manage a stepping motor for positioning, I intended to use a driver connected to the PWM output of the module SlimLine. I made the connection Out0 with Inp0 on the CPU module and I made a simple ladder program but I don't understand if it is working. What is meant by Duty, the duration of the pulse?
September 11, 2014 at 9: 38 am #38413Sergio BertanaAdministrator ForumYes, of course, connecting the DO00 output with the DI00 input is possible via the FB SysGetCounter count the pulses generated by the PWM output which are sent to the clock input of the stepping motor driver (See wiring). Acting on the value of Frequency it is possible to command the motor speed, by setting the value 0.0 the motor stops.
With Duty it is possible to set the On / Off time of the output PWM signal as a percentage, since a square wave must be generated, the Duty value can be set to 50%. But remember that if you push yourself to high frequencies it may be necessary to change the value as indicated above.
There he is screenshot of a ladder program that manages the PWM output and counts the pulses generated, I also attach the source program.
May 8, 2017 at 1: 50 pm #39934StefanoParticipantReading the documentation I see that the SysSetPWMOut block manages the hardware PWM generator of the CPU module.
Only one PWM channel is available on the CPU module or also on other expansion modules.PS it would be useful to summarize the "special functions" available on the various inputs / outputs of the entire series of CPUs and expansion modules (eg PWM, counter, encoder reader, etc. etc.). This would facilitate the choice of equipment at the design stage.
May 12, 2017 at 4: 40 pm #39935Sergio BertanaAdministrator ForumThere is currently only one hardware PWM output on the CPU module. All our extension modules have in the static version a driver on the outputs which has an extremely low operating frequency, therefore not such as to allow for a PWM.
As for the mirror we are working on it ...
May 19, 2022 at 1: 21 am #65313CarloParticipantI have installed the source program in a system consisting of CPU: Mps054_XUnified_1_0 on ARMv7M with a combined I / O expansion module: PCB124B000 (serial nr: 00163).
I noticed that by changing the addresses "address = 0" and "channel = 12" of the SysGetCounter function block (those of the expansion module) the count does not occur and the "fault" output is set TRUE. I also tried with the other 3 fast inputs of the module (13, 14 and 15) without success.
Yet from the specifications, the PCB124B000 module is among those with hardware management meters. Any suggestions?
May 20, 2022 at 12: 38 am #65314CarloParticipantThe mystery revealed …… .. In the PCB124B000 module the inputs that can be used by the SysGetCounter function block are the inputs DI00 and DI01 which correspond respectively to the “channel” 0 and 1 of the block itself.
However, consulting the manual, the high-speed inputs are DI12 and DI15. I don't understand, but I'll make up my mind .......
May 23, 2022 at 10: 41 am #65322Sergio BertanaAdministrator ForumIf you look in the FB documentation SysGetCounterIn section Modules with counter hardware management, see PCB124 * 000 module indicated 2 counters that can be individually wired to any of 16 digital inputs.
In practice, the module can manage up to 2 hardware counters with the possibility of selecting by defining the parameter Mode which of the 16 digital inputs to use as clock input. The module does not manage either the hardware reset or the counting in reverse mode from digital input. But these operations are easily implemented by software.
So here is explained the mystery, the module has 16 inputs, 4 of which are fast, and it is possible to decide by appropriately setting the parameter Mode which input to use for the 2 counters.
February 25, 2023 at 7: 32 pm #70568CarloParticipantI have created an application for the management of a stepper motor (0,9°/imp) using the PWM and the Counter of a PLC SlimLine LogicLab Cortex M7 MPS054* as previously recommended and everything works regularly: supplying 400 pulses the motor shaft completes exactly 1 revolution.
Subsequently, to the same application, I had to add a second motor to be controlled with FB SysGetCounter of a PCB124B000 module using the same pulses generated by the CPU PWM. However, I realized that by providing 400 pulses, the counter reads 400, but the motor axle does not complete the revolution. At this point I made various tests by changing the PWM frequency, the Duty value, I also used the second Counter of the I/O module, I even replaced the I/O module without however resulting in any improvement. The only way to make the stepper motor work is to have it run by the CPU module.
For this purpose I recently bought 2 MPS056A310 CPUs (also with PWM and Hardware Counter). I would have preferred the MPS054* but they weren't available.
Well. As soon as we arrived, I connected a CPU to the application with the same diagram and the same program used with the CPU MPS054*, result: supplying 400 pulses the motor axis does not complete the revolution! There is the same problem seen with the I/O modules.
I have the impression that the PCB124*000 modules and MPS056* CPU counter, for some strange reason, do not count correctly the same pulses supplied to the motor drive.
Forgive me if I rambled on too much, but I wasted a lot of time on this problem. In the end I recovered some MPS054* CPUs from other applications that don't use the hardware counters and replaced them with the newly purchased ones (MPS056*). I was finally able to create an application for the management of 3 stepper motors each controlled by a separate CPU MPS054*.
Too bad, if the MPS054* CPU system with the PCB124*000 module had lived up to expectations, there would have been a clear economic saving and, certainly, a more functional and streamlined system if only for programming…
What do you think?
March 6, 2023 at 3: 28 pm #70698Sergio BertanaAdministrator ForumTo drive a stepping motor by positioning it (thus counting the pulses) you must use the diagram shown in the FB SysSetPWMOut.
In your case, it seems to me that you generate an output clock from the PWM with which you intend to drive more motors, and for the positioning you rely on the counting of the pulses via counters.
You then leave the PWM running which clocks multiple drivers and enable one or the other driver as needed. If so, you certainly have a delay problem between the driver enable command and its effective enable, which could cause you to lose the 44 pulses.
-
AuthorPost
- You must be logged in to reply to this topic.