logo elektroda
logo elektroda
X
logo elektroda

Lighting and socket control using a Mitsubishi FX PLC – pulse switching

phonex 18491 68
Best answers

How can I make a Mitsubishi FX PLC toggle an output on each input pulse, so one pulse turns Y001 on and the next pulse turns it off?

Yes — use a rising-edge pulse (PLS) or an equivalent previous-state bit to detect each press, then toggle the output with a latch/hold branch so the next pulse reverses it [#6931234][#6941970] If your FX model doesn’t support edge detection, emulate it with a standard counter and comparators: on count 1 turn the output on, on count 2 turn it off and reset the counter [#6933643] In the ladder shown in the thread, the first rung stores the pulse in an internal M bit for one scan, and the following rungs use that bit plus the current Y state to decide whether to set or hold Y001 [#6931234]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #61 7406050
    phonex
    Level 18  
    Posts: 364
    Help: 6
    Rate: 30
    The delay works brilliantly; I had to set the timer to 2 seconds (at 0.5 seconds the relays were cutting out)

    I’m starting to connect everything and more problems have cropped up:

    when the alarm is armed (x6 active), the lights cannot be controlled; whereas when the alarm is disarmed (x6 inactive), the roller shutters cannot be controlled using their individual buttons
  • ADVERTISEMENT
  • #62 7407842
    jestam
    Automation specialist
    Posts: 1794
    Help: 210
    Rate: 144
    Two seconds is quite a long time. What happens when controlling the blinds using the buttons, if you quickly press a button twice whilst the blind is moving in one direction (i.e. stop and then move in the opposite direction)?

    The alarm functions are triggered upon detection of a 0→1 or 1→0 edge on the alarm status input. Once the state is stable – whether it’s 0 or 1 – it shouldn’t affect the operation of the rest of the system. Check that you’re definitely using flags (m something) everywhere, rather than just the alarm state x6 itself.
  • ADVERTISEMENT
  • #63 7410100
    phonex
    Level 18  
    Posts: 364
    Help: 6
    Rate: 30
    jestam wrote:
    2 seconds is quite a long time. What happens when controlling the roller shutters with the buttons, if you quickly press a button twice whilst moving in one direction (i.e. stop and move in the other direction)?

    Stopping and immediately reversing direction could, in theory, also damage the relay.
    The inability to control the roller shutters when the system is disarmed was due to the common ‘neutral’ being connected incorrectly; I’ve connected it correctly now and it works fine – just the lights left to sort out. as you’ll recall, I’ve set it up so that when the alarm is armed, all the lights are supposed to switch off – and they do – but it’s not possible to switch them back on at that point (which is needed when arming the alarm at night whilst the family are at home)
  • #64 7410652
    jestam
    Automation specialist
    Posts: 1794
    Help: 210
    Rate: 144
    In August you wrote that the lighting was working – has anything changed in the lighting control system since then? Please paste the relevant section of the programme (make sure to label the variables!), and I’ll have a look at it.
  • ADVERTISEMENT
  • #65 7411647
    phonex
    Level 18  
    Posts: 364
    Help: 6
    Rate: 30
    In August, I only tested on the test bench whether the lights switched on individually and whether the alarm input switched them off; I didn’t check what happened after arming the system. It’s only now that I’ve got round to connecting the system at home :)
    So I think I’ll use two outputs from the alarm control panel; one will work just as it does now (arming the system turns the lights off) and I’ll programme this in the alarm control panel to be active when the whole system is armed, whilst the second I’d programme to be active when the system is armed without internal lines (i.e. at night, when the household members are at home), and then the roller shutters will also lower and raise via this input, whilst the lights remain unchanged. In my overall programme, the alarm input when the system is armed is X0; however, let’s set, for example, X70 as the alarm input when the system is armed at night with the household members present (without internal lines)

    then the lights:
    Lighting and socket control using a Mitsubishi FX PLC – pulse switching
    and can I control the roller shutters with this additional input as follows:
    Lighting and socket control using a Mitsubishi FX PLC – pulse switching
  • #66 7552410
    jazda_gazda
    Level 19  
    Posts: 266
    Help: 33
    Rate: 26
    I haven’t read the whole thread, but rather than messing about with the edges, perhaps you could use the rising edge and the ‘ALT_M’ instruction – it’s definitely in GX IEC Developer
  • #67 8647951
    phonex
    Level 18  
    Posts: 364
    Help: 6
    Rate: 30
    I’ll bring this topic back up, but we still need a lock-out mechanism like the one we used for arming/disarming when controlling via buttons, because at the moment, for example, when I arm the alarm, the roller shutter goes down, and if someone presses a button at that moment, depending on its last state – if it happens that the roller shutter is already in the ‘up’ position – the relay in the controller gets damaged (high current due to the immediate change in the roller shutter’s direction of travel)
    Where should this interlock be placed, and what needs to be added to prevent this situation from occurring?
    Could it be like this:

    ; activate output interlock for 0.5 seconds
    |---|al_uzb|---+------------------[SET lock
    | |
    |---|al_uzb|---+
    | |
    |---|weg|---+
    |
    |---|lock|--------------------(Timer_block)
    | K 5
    |
    |---|Timer_block|---------------[RES block
  • #68 8673269
    jestam
    Automation specialist
    Posts: 1794
    Help: 210
    Rate: 144
    At first glance, it doesn’t look right. Of course, you should use a gate to control each roller shutter output ---|/block|---.
  • ADVERTISEMENT
  • #69 8674290
    phonex
    Level 18  
    Posts: 364
    Help: 6
    Rate: 30
    Yes, each roller blind has its own lock, and the outputs are fused.
ADVERTISEMENT