Announcement

Collapse
No announcement yet.

Control a timer in a click with a Potentiometer, Rheostat?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Control a timer in a click with a Potentiometer, Rheostat?

    Can I control a timer register in a click with a Potentiometer, Rheostat? Is there some kind of interface circuit that can be used to control the value in a click timer register with a Potentiometer, Rheostat?

  • #2
    If the click has an analog input, maybe.

    Is there some kind of interface circuit
    Rube Goldberg options are always available:

    -A pot connected from 0V to 5V with the wiper attached to an LM3914 and the outputs of the LM3914 tied to the inputs of one or more C0-08ND3-1
    -A pot connected to an embedded microcontroller that writes (ModbusRTU) to a register in the click.
    Last edited by kewakl; 03-16-2017, 03:32 AM.

    Comment


    • #3
      I believe the FC-P3 could be hooked up to a CLICK analog input.

      https://www.automationdirect.com/adc...er_Input/FC-P3

      Comment


      • #4
        Originally posted by Szarman View Post
        I believe the FC-P3 could be hooked up to a CLICK analog input.

        https://www.automationdirect.com/adc...er_Input/FC-P3
        That would require an analog input.

        Comment


        • #5
          Originally posted by bdog1955 View Post
          Can I control a timer register in a click with a Potentiometer, Rheostat? Is there some kind of interface circuit that can be used to control the value in a click timer register with a Potentiometer, Rheostat?
          Warning this is a hack, but it does work.

          I once built a control system for a lumber siding paint line. The operators needed to adjust a timer but their hands were always covered with paint, so a HMI could not work. I used a panel mount ice cube relay with a rotary dial. The timer was a zero to one second timer, but the time delay needed in the program was between 2 to 5 seconds. I used an output to start the icecube relay and an input to monitor the output of the relay. I used some math to scale the time the icecube was on for use in the program. I continuously cycled the output waiting for the input to change so I could detect when the operators made a change to the icecube timer
          Futti Utu

          Comment


          • #6
            Originally posted by Anvilsoup View Post

            Warning this is a hack, but it does work.

            I once built a control system for a lumber siding paint line. The operators needed to adjust a timer but their hands were always covered with paint, so a HMI could not work. I used a panel mount ice cube relay with a rotary dial. The timer was a zero to one second timer, but the time delay needed in the program was between 2 to 5 seconds. I used an output to start the icecube relay and an input to monitor the output of the relay. I used some math to scale the time the icecube was on for use in the program. I continuously cycled the output waiting for the input to change so I could detect when the operators made a change to the icecube timer
            Clever hacks are so much fun, especially vicariously!

            They are somewhat less fun when you wind up duplicating it as best you can in a retrofit because you have no idea why it was done that way in the first place, (but there must have been a good reason...)

            Comment


            • #7
              I just did an interesting experiment.
              I have an arduino uno with a protoboard mounted on it.
              On the protoboard, I wired in an ADM485 RS-232 to RS-485 transceiver and a pot with the wiper attached to analog pin A0.
              The uno program uses this modbus library .
              I used 485 so I wouldn't have to fiddle trying to level-convert the CLICK serial port voltages to match the uno serial voltages.
              I turn the pot and the CLICK's appropriate DS register value changes.
              Some amount of Goldberg BUILT-IN!

              DS values are from 0 to 1012 with the setup/averaging in my uno program -- as read from CLICK dataview

              Code:
              #include <SimpleModbusMaster.h>
              
              /*
                 The example will use packet1 to read a register from address 0 (the adc ch0 value)
               from the arduino slave (id=1).
              
               //THIS EDITED EXAMPLE DOES NOT USE THE VALUE THAT WILL BE READ FROM THE SLAVE (packet 1)
              
               It will then use packet2 to write a register (its own adc ch0 value) to address 1
               on the arduino slave (id=1).
               */
              
              //////////////////// Port information ///////////////////
              #define baud 9600
              #define timeout 1000
              #define polling 200 // the scan rate
              #define retry_count 10
              
              // used to toggle the receive/transmit pin on the driver
              #define TxEnablePin 2
              
              //ADD THE ANALOG PIN TO WHICH YOU WILL CONNECT THE POT WIPER
              #define AnaPotIn A0
              
              
              // The total amount of available memory on the master to store data
              #define TOTAL_NO_OF_REGISTERS 1
              
              // This is the easiest way to create new packets
              // Add as many as you want. TOTAL_NO_OF_PACKETS
              // is automatically updated.
              enum
              {
                PACKET1,
                PACKET2,
                TOTAL_NO_OF_PACKETS // leave this last entry
              };
              
              // Create an array of Packets to be configured
              Packet packets[TOTAL_NO_OF_PACKETS];
              
              // Masters register array
              unsigned int regs[TOTAL_NO_OF_REGISTERS];
              
              long mb_val = 0; //ACCUMULATE ANALOG POT SAMPLES (TO AVERAGE)
              
              
              void setup()
              {
              
                /*
                The library documentation seems to have incorrectly described function modbus_construct param 5 description
                 modbus_construct(packet, id, function, address, register count, localRegister
                 In the click, Address DS4490 is at Modbus 404490, but within the modbus realm, you usually need to massage the address
                 to ONE more or ONE less than specified, so send to Modbus 4489 in the modbus_construct function
                 Write ONE SLAVE register at 4489 from MASTER register 0
                 */
              
                // Initialize each packet
                modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS,4489,1, 0);
                modbus_construct(&packets[PACKET2], 1, PRESET_SINGLE_REGISTER, 4489, 1, 0);
              
                // Initialize the Modbus Finite State Machine
              
                //THE CLICK DEFAULT PORT3 SETTING DO NOT MATCH THIS PROGRAM MODBUS SETTINGS. MODIFIY EITHER TO MAKE THEM MATCH
              
                modbus_configure(&Serial, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);
              }
              
              void loop()
              {
                uint8_t i = 0; //declare 'i' here. IF we declare it in the for loop, it will be OUT OF SCOPE when we need it to divide the accumulated samples by sample count
                modbus_update();
                //average 100 samples
                mb_val = 0;
                for( i = 1; i <= 100; i++ )
                {
                  mb_val += analogRead(AnaPotIn);
                }
                mb_val = mb_val / i;
                regs[0] = mb_val; // update data to be written to arduino slave --ON THE NEXT modbus_update()
              }
              EDIT: ADM485 is NOT specifically marketed as RS232 to RS485 transceiver.
              Last edited by kewakl; 03-17-2017, 01:59 PM.

              Comment


              • #8
                Code:
                5V                                                                                 0V
                --+--                                                                              --+--
                  |                                                                        10uF      |
                  +--------------------------------------------+-----------------+----------|(-------+
                  |                                            |                 |                   |
                  |                                ADM485      |                 |                   |
                  |          [10K]                +--\/--+     |                 |         10nF      |
                  +----------#####-------+--------|R   5V|-----+-----------------)----------|(-------+
                  |                      | +---+--|/RE D-|-------+               |                   |
                  |                      | |   +--|DE  D+|-----+ |               |                   |
                  |                      | | +----|D   0V|-----)-)---------------)---------+---------+
                  |                      | | |    +------+     | |               |         |         |
                  |                      | | |                 | |               # ~500R   # ~500R   # ~100R
                  |                      | | |                 | |               # 1/2 W   # 1/2W    # 1/2W
                  |                      | | |                 | |               #         #         #
                  |                      | | |                 | |               |         |         |
                  |                      | | |                 | |               |         |         +----CLICK Port3 (LG) -opt
                  |                      | | |                 | |               |         |
                  |                      | | |                 | +----+----------)---------+--------------CLICK Port3 (-)
                  |                      | | |                 |      # ~100R    |        
                  |                      | | |                 |      # 1/2W     |        
                  |                      | | |                 |      #          |        
                  |                      | | |                 +------+----------+------------------------CLICK Port3 (+)
                  |                      | | |      
                  |                      | | |      
                  |                      | | |      dots indicate UNO board                
                  |                      | | |      ...............              
                  |                      | | |      .  +--\/--+   .            5V
                  +----------------------(-(-(------.--|  uno |   .          --+--
                   RX   0  PD0 (Pin 2)   +-(-(------.--|atMega|   .            |
                   TX   1  PD1 (Pin 3)     | +------.--| 328p |   .            |
                   TXEN 2  PD2 (Pin 4)     +--------.--|      |   .            #
                                                    .  |      |   .            # ~10K
                                                    .  |      |---.-----------># multi-   A0   PC0 (Pin 23)
                                                    .  |      |   .            # turn
                                                    .  |      |   .            #
                                                    .  |      |   .            |
                                                    .  |      |   .            |
                                                    .  |      |   .          --+--
                                                    .  |      |   .            0V
                                                    .  |      |   .
                                                    .  +------+   .
                                                    ............... 
                ---will correct ascii art if needed.
                EDIT:Corrected bias resistor connections

                IF I COULD POST FILES OR PICTURES, THIS ASCII WOULD NOT BE NECESSARY
                Last edited by kewakl; 03-17-2017, 09:15 AM.

                Comment


                • #9
                  Click test program for the experiment:

                  Code:
                                                               +--------------------------+
                           T2                                  | T1                       |     T1
                  --------]/[----------------------------------+                          +----( )
                                                               | Setpoint  DS4490         |
                                                               |                          |
                                                               | Current    nnn           |
                                                               +--------------------------+
                  
                                                               +--------------------------+
                           T1                                  | T2                       |     T2
                  --------] [----------------------------------+                          +----( )
                                                               | Setpoint  DS4490         |
                                                               |                          |
                                                               | Current    nnn           |
                                                               +--------------------------+
                  
                          C1           T1                                                       Y1
                  --------] [---------] [------------------------------------------------------( )
                  Spin the pot and the Y1 clickety-clickety goes faster or slower -- If C1 is true.

                  Comment


                  • #10
                    How about a Time Delay Relay such as a MS4SA-AP-ADC ? It has multiple time ranges, is panel mountable, and is easy to adjust and read. Turn it on with an output, wait for the TDR to activate an input.
                    ADEN ENGINEERING
                    Automation & Electronic Controls

                    Design, Build, Repair, Training

                    Comment

                    Working...
                    X