1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

How fast does the motor have to change direction?

Discussion in 'DIY Motion Simulator Building Q&A / FAQ' started by helisfreak, Jul 30, 2015.

  1. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    I'm confused.... The rc servo and rc speed controller uses the same signal type, PWM (single cable for direction).

    This is similar to what I need.... Isn't the MM driver uses PWM ? 1 wire signal for both direction?

    Attached Files:

  2. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,573
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 39 / -0
    My Motion Simulator:
    AC motor, Motion platform
    • Informative Informative x 1
  3. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
  4. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    RacingMat is correct! RC servo pwm is completely different than h-bridge pwm. I should have thought of that before that an RC motor controller would obviously expect servo pwm since an RC receiver is normally driving it. I would try to explain the difference myself but I’ll just quote Wikipedia this time to make it easy on me.

    "The angle (of mechanical rotation of a servo) is determined by the width of an electrical pulse that is applied to the control wire. This is a form of pulse-width modulation, however servo position is not defined by the PWM duty cycle (i.e., ON vs OFF time used to drive an h-bridge) but only by the width of the pulse. The servo expects to see a pulse every 20 ms, however this can vary within a wide range that differs from servo to servo. The width of the pulse will determine how far the motor turns. For example, a 1.5 ms pulse will make the motor turn to the 90 degree position (neutral position).

    The "RC PWM" used in RC servo control acts very differently from the PWM used in any other system. (In particular, the confusingly similar-sounding direct PWM DC motor speed control works entirely differently). Most RC servos move to exactly the same position when they receive a 1.5 ms pulse every 6 ms (a duty cycle of 25%) as when they receive a 1.5 ms pulse every 25 ms (a duty cycle of 6%) -- in both cases, they turn to the center position (neutral position). The low time (and the total period) can vary over a wide range, and vary from one pulse to the next, without any effect on the position of the servo motor. With many RC servos, as long as the refresh rate (how many times per second the pulse is sent, aka the pulse repetition rate) is in a range of 40 Hz to 200 Hz, the exact value of the refresh rate is irrelevant."
    Last edited: Aug 2, 2015
  5. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
  6. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
  7. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,573
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 39 / -0
    My Motion Simulator:
    AC motor, Motion platform
    I was hoping the penny would drop :), Servo PWM is different to what a brushed DC motor requires. There is so much info about this on the web - just type 'Brushless motors and Arduino' into You Tube and all will be revealed ;).
  8. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    For the most part, RC servos are not powerful enough for motion simulators so they aren’t used. And if you were to build a big one yourself they also require additional electronics to make them position. There is code here to drive servos for dash gauges though and there may be some members who have servo code they use to drive their g-seats too. The arduino does have a servo library making it much easier to write programs to work with servos though so it is possible, but is it worth the effort is the question.
  9. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,573
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 39 / -0
    My Motion Simulator:
    AC motor, Motion platform
    I think you may be on your own, scaling what you have up to operate a sim would not be straightforward - I like to keep things simple - that will not be simple with the amount of testing required to find the right torque/speed balance (and you would have to use quite large brushless motors/gearboxes - not the RC type) - but all the power to you if you want to give it a go:thumbs.
    .
  10. Vef445

    Vef445 Active Member

    Joined:
    Jul 13, 2015
    Messages:
    125
    Location:
    Denmark
    Balance:
    597Coins
    Ratings:
    +73 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Guys, I've seen more than one person here using RC servos to build a scale reduction of their rig, so there must be a code that works, right? :)

    [Edit] yes but they drive the position of the servo. An RC brushless controller would keep the motor turning... I was a little bit fast in my conclusion, sorry

    I'm not sure what size of brushless motors our 2DOF seats checkers would require, but we usually use 250/300W DC motors, and brushless motors up to 500W are common in the RC world (helicopters, 1/5 cars...). Probably more expensive though, as well as for controllers.

    Now what would be the advantage(s) of using brushless motors for a sim? Here I'm not convinced.
    • Informative Informative x 1
  11. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    I know most of your guys are skeptical, but simple doesn't mean perfect and complicated doesn't mean expensive.

    I never said I was going to use RC servo to drive the simulator. I am not engineering, but I know this can work with some simple coding to make the Ardruino understand what it need to do. Unfortunately I am no coder either so this will make it very hard to archive. The basic is simple, Ardruino should output a signal to control the (RC speed controller both direction via 1 signal wire). Potentiometer get hook to Adruino for feedback so it can know the position of motor shaft.

    Why no one have done this before? I don't know. Why I think this will work out better? Here's why.

    * During the past 10 years the biggest change in the RC industry and BRUSHLESS motor and LITHIUM POLYMER. Everything RC is now brushless and there's a lot of reasons why.
    - The most obvious, there's no BRUSH in Brushless.
    - A lot more torque
    - Half the size and also lighter
    - The cost of brushless motor has DROPPED significantly do to increase in production.

    Just a couple of sample.
    600watts
    http://hobbyking.com/hobbyking/stor..._Brushless_Multirotor_Motor_Built_by_DYS.html

    2300watts
    http://hobbyking.com/hobbyking/stor...SK3_6354_260kv_Brushless_Outrunner_Motor.html

    * Brushless esc are cheap as well, 40amps esc 12-26volts are 20bucks

    * Most DC brushed motor are stuck on 12volts, making it required expensive and big power supply. Brushless motor you now can run much higher voltage, even at 50volts. Higher voltage mean more effeiciency and lower amps power supply.

    It may be hard for you guys to vision the changes, but I have been doing RC for 18years and I have seen so many thing people say not possible, not going to happen and look at where we are now. I fly RC Helicopter mostly and 10 years ago, people think I was crazy that I set up my helicopter to fly on 50volts DC.... but now, 50volts is STANDARD. So my goal is someday you guys will look back at this thread and laugh because you will all be using RC motor and esc for your racing sim.

    thank you for reading all my bs. :)
  12. Vef445

    Vef445 Active Member

    Joined:
    Jul 13, 2015
    Messages:
    125
    Location:
    Denmark
    Balance:
    597Coins
    Ratings:
    +73 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I think we all agree @helisfreak, and I'm sure I'm not the only one who follow your posts with interest. (And we are most likely not the only ones "coming" from the RC world ;) )

    Regarding what others replied to you, I see a few challenges:
    - writing the proper code for your Arduino. You can probably start from the one everybody here uses for DC motors
    - find the right size of motor / controller
    - find a suitable power supply. This might not be as easy (and cheap) as finding 6cells LiPo batteries ;)
    - find the right gearbox ratio. There are chances that RC brushless motors turn a lot faster than the popular DC motors people use here.


    Please keep sharing the results of your test with us. ;)
  13. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Okay, I’ve been a little slow on the uptake but now I’m finally getting my head wrapped around this. The code need to accomplish this shouldn’t be very hard to accomplish.

    Why has no one done this before? Probably because it was not necessary for them to do so! There are obvious reasons why brushless motors have advantages in the RC world, but we don’t need those when we are not powering small-scale models where power to weight is a big consideration. The only advantage that I see atm is, as you stated, there are no brushes, and so they can’t wear out. But there are also disadvantages with using brushless motors, and for motions sims, I personally think they outweigh the advantages, at least when using larger brushless motors.

    Brushed motors are stuck at 12v? That’s a new one for me! 12, 24, 36, 48, 90volts are common although controllers are harder to find for higher voltages. Also higher voltage motors are not more efficient, they simply trade voltage for amperage. But when multiplied together to get power (v * a = p) the end result is the same.

    Anyway, here is a sketch you can experiment with that should control your motor controller with a pot if it will keep you from whining for a while. :grin If this works it wouldn’t be too difficult to apply this to the XPID_Simtools1_23 sketch.

    Code:
    #include <Servo.h>
    Servo myservo;  // create servo object to control a servo
    int potpin = 0;  // analog pin used to connect the potentiometer
    int val;  // variable to read the value from the analog pin
    void setup()
    {
      myservo.attach(9);  // attaches the servo on pin 9 to the servo object
    }
    void loop()
    {
      val = analogRead(potpin);  // reads the value of the potentiometer (value between 0 and 1023)
      val = map(val, 0, 1023, 1000, 2000);  // scale it to use it with the servo
      myservo.writeMicroseconds(val);  // sets the servo position according to the scaled value
    }
    
    • Like Like x 2
    • Informative Informative x 1
  14. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    @Vef455 What's the normal range of rpm for the DC motor being used? RC Brushless motor now are anywhere from 200kv to 500kv for the direct drive motor (meaning run direct propeller, but can be put on gear box).

    @BlazingH Thank you for the code... I only mostly see DC motor at 12volts, or at least most of the one being use for motion platform I see here. If brushless motor pull same or less amp, but output more power, isn't that more effecient... ? :) That why all RC are not brushless, even the handheld camera stabilizer, if you guys have seen that, google " 3 axis brushless gimbal"
  15. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    Errr... spend two hours lastnight trying to install the driver for the Aruino board bought off ebay (probably clone). Couldn't get it to work. Luckily bought a spare one from RadioShack and plug right in and immediately driver instal and work. I manage to upload a code MM code download from here via Xloader. But now I am using Ardruino software to upload BlazzingH's code and it wouldn't work.

    Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
  16. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    Oh snap... got it to work. Motor run well, both direction ... yay! Now waiting for the Bodine motor to come and I will test some motor and give you guys some result.

    :) Thank you very much BlazingH.
  17. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    @BlazingH So I am testing it with a linear 10K pot and I notice this and probably need to change the range.

    There's about 1/8 of a turn deadband (center between two direction)
    Each direction only use about half the range of the pot to reach full throttle. Though I have no idea how to code Ardruino, but I will try to change some of this number and see what going to happen. :)

    {
    val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
    val = map(val, 0, 1023, 1000, 2000); // scale it to use it with the servo
    myservo.writeMicroseconds(val); // sets the servo position according to the scaled value
    }
  18. Vef445

    Vef445 Active Member

    Joined:
    Jul 13, 2015
    Messages:
    125
    Location:
    Denmark
    Balance:
    597Coins
    Ratings:
    +73 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Good to see some progress :) As per DC motors, mine are rated at 3600RPM (12V)
  19. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,975Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    is it written CH340 on the board?
    if yes, you have to install a specific driver
  20. helisfreak

    helisfreak Member

    Joined:
    Jul 25, 2015
    Messages:
    97
    Location:
    Phoenix, AZ
    Balance:
    579Coins
    Ratings:
    +12 / 1 / -0
    It doesn't say CH340, it just say UNO.