1. Hundreds of coffees, endless nights of debugging and coding, and countless feedback by our beta testers led to this new major release. SimTools 2.4 is probably the version with the most upgrades and improvements in a single release ever. Look at everything Dustin has included:
    SimTools 2.4 all features.
    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 Download Package Now!
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

MMOS controller with cheap servo drive and motor

Discussion in 'Direct Drive Wheels' started by sikjar, May 22, 2017.

  1. Carlo_Labati

    Carlo_Labati New Member

    Joined:
    Jan 10, 2018
    Messages:
    18
    Location:
    italy
    Balance:
    128Coins
    Ratings:
    +2 / 0 / -0
    Wath NM Torque for this motors ?
  2. Ultrawipf

    Ultrawipf New Member

    Joined:
    Jan 12, 2019
    Messages:
    7
    Balance:
    72Coins
    Ratings:
    +3 / 0 / -0
    Okay little update on stepper drive wheels.
    I might have an idea how we could build one better and probably even cheaper than with these old drivers that don't even work for that application.

    Its a shame that mmos is closed source. It would make the project so much easier if it wasn't.
    I plan on making a similiar standalone controller -open source- with a more modern stepper driver that can drive inexpensive high power steppers instead of hard to get servos with super expensive drivers.

    The biggest problem is currently to get any kind of documentation on usb hid descriptors with force feedback. Tell me if anyone has more info about that subject.

    Attached Files:

    • Like Like x 1
  3. OZHEAT

    OZHEAT Member

    Joined:
    Oct 26, 2015
    Messages:
    146
    Location:
    Australia
    Balance:
    1,800Coins
    Ratings:
    +78 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @Ultrawipf
    I have always had my reservations regarding using stepper motor as a steering wheel, you will not get rid of the cogging from the motor although a large steering wheel will minimize the feeling.

    As for MMos, I believe the project was started with good intentions but pretty much stopped developing it when he got an industrial drive controller(granite) and partly rewrote the program to cater for the drive and left it like that.
    Yes he did develop the ffb effects more but he did drop any ideas on directly driving motors from mmos.
    Granite servo drives are NOT the only servo drives that you can use with MMOS, in fact most can be used.
    So you do not need to limit yourself to an expensive "Granite servo drive", a second hand or new industrial servo motor and drive can be used instead.
  4. Ultrawipf

    Ultrawipf New Member

    Joined:
    Jan 12, 2019
    Messages:
    7
    Balance:
    72Coins
    Ratings:
    +3 / 0 / -0
    This is probably true that steppers are not the best choice. But afaik the simxperience accuforce uses a "hybrid stepper drive" too which is also just a stepper with a closed loop drive. Maybe they have some advanced regulation to make it smoother.
    If they can do it i am sure there could be demand for an open version.

    If it does not work out at all there might be some other options.
    The choice of motor and how it is driven can also greatly reduce the cogging feeling of a stepper so it does not always feel like you are grinding phantom gears.
    My test setup currently only features a nema23 which feels pretty smooth when freerunning with something wheel sized but a nema42 would be the ultimate goal and that could become a bit rougher.

    Maybe someone with an accuforce can confirm how it feels.
  5. Ultrawipf

    Ultrawipf New Member

    Joined:
    Jan 12, 2019
    Messages:
    7
    Balance:
    72Coins
    Ratings:
    +3 / 0 / -0
    I am currently working an a foc control loop for steppers.
    The good news is the driver has a lot of power and allows voltage and current mode regulation and has a fast step clock input and a constant torque foc driver was done before with the powerstep01 by some researchers.
    The slightly bad news is that modulating the power by sending spi commands is not perfectly timed and enabling highZ mode for freerunning also is probably too slow in the main control loop. But i am working on a solution.

    The challenge i am facing right now is dealing with aligning the encoder and motor phase perfectly at startup either by measuring an offset or aligning it while homing.

    Here is little video showing constant torque being applied in current mode with FOC: https://streamable.com/fwrur
    This is at 0.4A at 15V with a nema23 3Nm motor as my test setup. Of course when it works completely i will test it on bigger motors.

    I gues it is at least something that shows the idea might be possible ;)
    Cogging is way less than i feared and i hope it will not get too much worse with bigger motors. Keep in mind a real steering wheel would be a lot larger and would reduce the feeling further.

    More progress will come. Might have to make a new thread or document elsewhere when it gets more advanced so i don't hijack this topic.
  6. Ultrawipf

    Ultrawipf New Member

    Joined:
    Jan 12, 2019
    Messages:
    7
    Balance:
    72Coins
    Ratings:
    +3 / 0 / -0
    As i don't want to spam this thread further until some real discussion about it can happen, the project is now active and will be documented here: https://hackaday.io/project/163904-ohsc-hybrid-stepper-motor-controller

    Current stage: HID Input is working (16bit steering, 12bit for adc channels and 16 buttons), foc and basic position control is working. Force Feedback via USB Physical Interface has to be implemented yet.

    Which effects are normally used by the usual games? Constant torque and "spring to position" can be implemented easily and would make sense but virtually no documentation about this topic is available.

    This would be my next stage before designing a pcb and making the final prototype for further development.
    It is also planned to implement a general purpose stepper interface as servo alternative for other tasks.
    I am almost certain that the final interface will be based on an stm32f4 microcontroller and the powerstep01 stepper driver as this combination seems to make sense and currently works well enough. The encoder must have sub-microstep resolution for the foc part to work. 8-10k pulses seem work fine.

    A new more powerful nema34 motor and a better steering wheel will be used later to test the full capabilities.

    Small teaser with "steering action": https://streamable.com/qjpzb

    I hope we can make this happen as an alternative to expensive servos. :grin
    • Like Like x 1
  7. 卡尔黄森

    卡尔黄森 New Member

    Joined:
    Feb 9, 2019
    Messages:
    1
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    DC motor
    非常完美的力反馈
  8. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    13,151
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    100,051Coins
    Ratings:
    +8,339 / 42 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  9. Ultrawipf

    Ultrawipf New Member

    Joined:
    Jan 12, 2019
    Messages:
    7
    Balance:
    72Coins
    Ratings:
    +3 / 0 / -0
    One update here to say that i have succeeded in making a basic FFB stepper direct drive wheel.
    The torque resolution must still be improved with a different motor driver and of course all the usability features are still missing.
    But FFB is working, most motor features are implemented, gamepad polling runs at 1khz and 16 bit and it feels very direct.

    With a different motor driver circuit it will get more expensive but it should still be way under most other options and even with hardware less than a higher quality consumer wheel.
    Compared with a thrustmaster TX it comes close but the effects are still very noisy because of the 7 bit current control in the stepper driver.

    Source will be published once it is cleaned up and the next hardware is planned so anyone could use it as a reference for future ffb projects as i was a bit shocked to see almost no examples on how to make a usb PID device... That was a lot of work.

    Here is a short video of the current status:

    All updates will be posted on hackaday.io: https://hackaday.io/project/163904-ohsc-hybrid-stepper-motor-controller

    But i also want to see if the community is interested in the project and if i should make a new thread.
    • Like Like x 1
  10. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    548
    Location:
    london uk
    Balance:
    6,538Coins
    Ratings:
    +697 / 4 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi @Ultrawipf thanks for posting this update , all knowledge is good, and always great to see another possible option for the guys with lets say, " restricted Monetary means for what will be a great addition to the sim fraternity. keep at it in the end we all benefit by learning something new or another way of looking at an design challenge :)
  11. llluis

    llluis Active Member Gold Contributor

    Joined:
    Mar 30, 2017
    Messages:
    126
    Location:
    Quebec
    Balance:
    1,520Coins
    Ratings:
    +95 / 1 / -0
    My Motion Simulator:
    6DOF
    I have a working unit from RufusDufus ("Son of OSW") on a Nema34 13Nm (5A) and a full sized wheel and can do comparative tests if needed.
    (encoder is a 2000ppr (8000cpr)).
    Controller is the standard STM32F4 running MMos. Did you write another firmware to replace the MMos?
  12. Ultrawipf

    Ultrawipf New Member

    Joined:
    Jan 12, 2019
    Messages:
    7
    Balance:
    72Coins
    Ratings:
    +3 / 0 / -0
    I am using 10k and 8192cpr encoders without issues.
    Yes the firmware is completely new for this as mmos did not have the speed and features needed and was not open source.
    If mmos was open source... well. that would have been easy to adapt.
    My firmware is currently running on a STM32F103RC because the F4 support only 4 usb endpoints and this is not enough to open a bidirectional HID and CDC device at the same time but the F1 family allows 8 endpoints.
    I first used the F411 but then you would have to configure it via HID or external uart controllers and i don't want that. I will write a simple config gui that will send commands via COM/CDC and you should also be able to send these commands via any terminal instead of custom HID reports like mmos does. A bit easier this way and maybe someone does not want to build a wheel but something else entirely. Then only the HID part has to be removed and it will be a universal motor controller.
  13. Luis Miguel

    Luis Miguel New Member

    Joined:
    Jun 10, 2019
    Messages:
    1
    Balance:
    18Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    Arduino
    Hello, I have the same components you have. HBS86H, the NEMA 34 8.5 Nm, I am using an Arduino UNO and a 60V Power Supply.

    How do you wire from the Arduino to the driver?

    For me this seems to work, except whem I change the steps per revolutions. This just work for some of them.
    Pul + to 5V
    pUL - to Pin 2
    Dir + to 5V
    Dir - to Pin 3

    When I asked in other forums I was told to wire in a different way, but didn't work for me?

    I was told to connect:
    Pul+ to Pin 2
    Dir + to Pin 3
    GND to Pul -and Dir -

    But this connection doesn't work for me.

    Thank you.
  14. BiT0

    BiT0 New Member

    Joined:
    Mar 13, 2019
    Messages:
    28
    Balance:
    166Coins
    Ratings:
    +3 / 0 / -0
    I do not completly understend the math in the OP code.
    Logic is clear and the smoothing function with the summed pulses too.
    But why does it assume a max 55 torque value from MMOS?
    The PWM pulse lenght is the force coming from MMOS and in his guide the PWM freq in MMOS is set to 5.6Khz. To me that do not match to a max duty cycle of 55.
    Anybody can clarify to me?