Motor Control

Advert

Motor Control

Home Forums General Questions Motor Control

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #22092
    Sub Mandrel
    Participant
      @submandrel
      Advert
      #90281
      Sub Mandrel
      Participant
        @submandrel

        I'm at the stage of making a motor controller for my 3 1/2" gauge shunter. I'm aware that many small electric models like this simply use a multi-step ressistor ladder. I have the opportunity to be a bit more creative as I'm doing it electronically (with only a 7Ah battery I don't want to waste any watts!) The actual controller is made, but I need to design the handheld 'control box'.

        But with no driving experience what sort of controls do I need? I've got two SPDT relays to give reversing and back-emf braking, a 'horn' and I imagine a 'failsafe' that stops everything if handhel controller and engine part company will be essential.

        But how should I control the speed. Will an 'up and down' button be the best way, or should it be possible to rapidly go to any setting with a rotary control? If I use +/- buttons, should they respond quickly or take a whiles to ramp up and down?

        I can have up to 255 steps from off to full on, but I get the idea that most people only use a few – and fewer steps means faster reaction to the controls.

        I won't be in the position of being able to nip back and forth between track and workshop, so a solution that should work reasonable first time is what I'm hoping far!

        So , lots of ideas but NO practical experience – all suggestions welcomed.

        Neil

        #90313
        Ian S C
        Participant
          @iansc

          I wonder if a slider type pot would be better than a rotary one for speed control. Ideally I would imagine a control with foreward on the control, foreward motion, center off, back to reverse. Push button for horn, toggle switch if diesel sound effects are installed. Just my ideas Neil.

          Ian S C

          #90314
          Keith Long
          Participant
            @keithlong89920

            Neil

            Just a thought – have a look at the motor speed controllers used for RC models generally referred to as "ESC's" (electronic speed contollers). They can handle some VERY impressive currents and do it by pulsing the current to the motor rather than wasting precious battery capacity in resistors. You might have to make up a simple circuit to give it the contol signals it requires (emulating the receiver output) – or just buy a servo tester for about £2.50 and drive it from that.

            Have a look on the Model Boats website for a number of suppliers. You'll also find the makers (suppliers) of thse units are very heplful and usually respond well to an e-mail or phone call for advice.

            Keith

            #90317
            Les Jones 1
            Participant
              @lesjones1

              Hi Keith,

              My understanding is that Neil has built the speed controller. (I suspect from other posts and that he has 255 steps on the speed control he is probably using one of the Atmel range of microcontrollers to implement PWM motor control.) I think he just wants others opinions on the design of the user interface. ( Like Ian's suggestions.)

              Les.

              #90320
              AndyP
              Participant
                @andyp13730

                Neil,

                My little electric has a rotary pot for speed, DPDT switch on the loco for forward/reverse, I find the pot is really a two handed job so not ideal, it also means the youngest driver can throw the switch at full speed for some dramatic effects!

                Our club loco has a sprung lever throttle which is very nice to drive and if you drop the controller the loco stops!

                Loco looking excellent btw.

                Andy

                #90321
                Anonymous

                  Ideally one would use a slide potentiometer; but quality ones are expensive and they're vulnerable to getting crap in the works. From a practical point of view I'd use a sealed cermet rotary potentiometer.

                  I wouldn't have thought that 255 steps would be a problem vis-a-vis response time. At any decent repetition rate one should be able to keep up with the potentiometer. You don't have to use all the steps in sequence. One could always use a 'look-ahead' term to anticipate fast movement of the potentiometer – a sort of electronic turbo charger.

                  Regards,

                  Andrew

                  #90335
                  Bazyle
                  Participant
                    @bazyle

                    A rotary control is the easiest and perfectly satisfactory as uses on 90% of model loco controls. However if you have children using it then firstly a spring is sensible and secondly a sector plate on the knob that covers the reversting swtich except at zero.

                    Another consideration is a cutout linked to a breakaway cable that can also be used for disabling the loco if you need to leave it for a minute but with everything else connected.

                    #90346
                    Sub Mandrel
                    Participant
                      @submandrel

                      Thanks folks.

                      Les is right, I've built a PWM controller using an AVR that works the same way as an ESC with plenty of 'headroom'.

                      I have started playing around with toggle switches one biased to the centre up for faster, down for slower, the other forwards/off/reverse. the nice thing about filtering these through a chip is that you can make sure it waits a few seconds between direction changes. I also think an emergency stop that won't let you restart until the direction switch is put on off would be wise.

                      But I've already discovered that with a toggle switch setting the PWM speed quickly and accurately is not easy! I think some sort of cleverness where a brief click advances it slowly, hold on it goes faster, might help.

                      I like the idea of a sprung lever on a potentiometer, with a nice brass lever on it. Es[pecially like the chance to build in some engineering!

                      It means I'll have to redesign the controller with a chip with A2D on board though. I can have instant response or build in a time delay.

                      I will make it so the loco stops if the signal from the control box stops. As the loco will supply power to the box, it will always poautomatically start up in the 'safe' condition.

                      Neil

                      #90377
                      Les Jones 1
                      Participant
                        @lesjones1

                        Hi Neil,

                        In the code that looks at the switch you could have a timming loop (Or use one of the timers) that increments a counter while the switch is closed. If the counter reaches a prest value the code could then start incrementing the set speed value. ( You could even have a higher preset value that would increase the speed at a higher rate but I don't think that would be needed in your application.) If the switch opens before the preset count is reached then you would just increment the speed value by one. I think I have written code to run on a PIC for this sort of thing. Let me know if you would like me to try to find it.

                        Les.

                        Edited By Les Jones 1 on 07/05/2012 14:16:14

                        #90378
                        Skarven
                        Participant
                          @skarven

                          —–

                          It means I'll have to redesign the controller with a chip with A2D on board though. I can have instant response or build in a time delay.

                          —–

                          You could make simple AD converter with a capacitor, resistor and an IO pin switched between Output for discharging the C and threstate input for reading when it is charged to the point where the input changes from one state to the other. This is not difficult to program and uses only one pin on the micro.

                          #90380
                          Ady1
                          Participant
                            @ady1

                            Have a look at the systems they use for electric scooters and bikes

                            #90391
                            Sub Mandrel
                            Participant
                              @submandrel

                              Hi folks,

                              Some thought on the technical suggestions:

                              I have two on-off-on switches, on locking (direction) one momentary (speed +/-) and two momentary push buttons (horn, brake). Every ms an interrupt does a scan of the switches and sets various flags. Once every 250 ms an LCD display module is updated to acknowledge the various switch settings and show a bar graph and % for the PWM, it sends the flags and speed setting to the motor controller. That means a 0.25s latency, which is frequent enough for this kind of task, I feel. The motor controller will report on battery condition and adujsts PWM, direction etc. and moderates sudden changes of direction.

                              Skarven – I know the system you mean, but it would mean a new board and I don't like resoldering smt chips – at least not for a second time

                              I have come up with a neat bodge – hang a 555 of a potentiometer and time the pulses – remove the +/- switch and I have access to an external interrupt, and I have a spare 16-bit counter so getting the resolution will be OK. I can then scale the zero and 100% points in software.

                              If all that sounds very expert – I spent hours failing to get the boards to communicxate this evening. I finally checked the pin assignments in the software and found I am trying to send data out the receiver pin…

                              Neil

                              #92637
                              Sub Mandrel
                              Participant
                                @submandrel

                                I haven't done the potentiometer mod yet, but it all works so when the weather looks a bit better I'll be off to spend an evening at Burton MES to see if it will pull me along!

                                Neil

                              Viewing 14 posts - 1 through 14 (of 14 total)
                              • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                              Advert

                              Latest Replies

                              Home Forums General Questions Topics

                              Viewing 25 topics - 1 through 25 (of 25 total)
                              Viewing 25 topics - 1 through 25 (of 25 total)

                              View full reply list.

                              Advert

                              Newsletter Sign-up