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

News Open source force feed back

Discussion in 'DIY peripherals' started by Hoantv, Oct 2, 2019.

  1. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    07FE6720-963C-4577-BDC0-074C2CC69F66.jpeg I will use like this. Dont know is it correct or not :)!


    http://www.datasheetdir.com/LT1013CN8+Precision-Amplifiers
  2. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    that is nothing like the circuit I gave you and all you can get is ov - 4.5v
    You can't get -ve voltage out of thin air.
    What are you scared of? if you think you don't have a bipolar power supply available go look at your desktop pc, it has 3v3 5v 12v -5v -12v & 0v(gnd). plenty of junked pcs that you can pull the power supply from.

    You cannot also just put the output to the servo drive, as I said put the output to a voltage follower then to servo drives Ain

    220px-Op-Amp_Unity-Gain_Buffer.svg.png voltage follower, voltage buffer, unity gain amp or 1x amplifier all the same thing.


    You don't need an instrumentation opamp a standard opamp would be ok.

    Let me assure you. You will not get a bipolar output without using a bipolar power supply.
  3. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
  4. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    hhh.png
    Just looking at the control diagram that you posted earlier and it does show 3 wires for the analog torque control. First time I have seen Analog+- 10v interface like that all the ones I have used are like the above one which only uses 2 wires.

    Would you care to post the manual for your drive and was the teco servo drive the same?

    hh.png

    Attached Files:

    • hh.png
      hh.png
      File size:
      36.7 KB
      Views:
      260
    Last edited: Jul 4, 2020
  5. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino

    Attached Files:

    Last edited: Jul 4, 2020
  6. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @Hoantv
    well did you rtfm?
    A quick look shows this for torque mode
    gg.png
    I know that it shows in position & speed mode as three connections, why you need to have different torque limits for CW & CCW is a bit beyond me. Maybe you want higher torque to unjam a conveyer belt or when you want to unspool a winding machine????
    gs.png

    I always thought TECO was a better Taiwanese brand but their manual is a bit woeful.
    No wonder you have ground problems with the teco.
    Last edited: Jul 4, 2020
  7. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    With the Mige drive once again a bit woeful but it does spell it out for you.
    gp.png
    but it shows that AT- is tied to gnd making it a 2 wire connection.
    gy.png
    gr.png this seems to have been cropped on the left and missed the connection to gnd.
    this pic must of been done in windows paint as the text wipes out the gnd connection.
    jj.png
    None the less the analog torque connection is really 2 wires.
  8. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @Hoantv
    I think I miss posted the formula.
    R1=R2=Rf=Rg = 2x amplification
    R1=R2 Rf=Rg= (R1*2) = 3x amplification

    R1=R2 Rf=Rg amplification = (Rf/R1) +1

    It is actually a bit more complicated than that but it does work out.

    So for R1=R2=100k and Rf=Rg=300k will result in 4x multiplication.

    You do need to make sure if you amplify the differential voltage that the bipolar power to the opamp has to be able to swing that high/low. ie if you have 4x and have +-5v to the opamp you will not get +-6v out it will top out at around 4.6v.
    • Like Like x 1
  9. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I will investigate what you wrote.
  10. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @Hoantv
    I see that you have released a v0.19.1 of your software, while it is better you still have the 0-50-100 mode incorrect.

    I will go through all the modes in what I have measured both using analog and digital pins.
    Note the voltage values are the values I get and will probally be different, it is given as reference.
    Format is full CCW torque - no torque - full CW torque.

    MODE Pulse + Dir
    Digital
    PE9 2.938-0.048-2.943 PWM signal
    PE11 2.943-0.002-0.002 Dir signal
    Analog
    PA4 2.900-0.048-2.900 Analog torque signal
    PA5 0.048-0.048-0.048 Analog signal not used, this is ok.
    PE11 2.948-0.002-0.002 Digital direction signal, this is also ok.

    MODE PWM +/- (H-Bridge)
    Digital
    PE9 0.002-0.002-2.943 CW signal
    PE11 2.948-0.048-0.048 CCW signal
    Analog
    PA4 0.048-0.048-2.948 CW signal
    PA5 2.948-0.048-0.048 CCW signal

    MODE 0-50-100%
    Digital
    PE9 0.002-0.296-0.591 scaling seems to be incorrect as it looks like only ~15% of range of PWM.
    Analog
    PA4 2.900-0.048-2.900 this is incorrect and would correspond to 100-0-100 rather than 0-50-100.
    PA5 1.465-1.465-1.465 Ref 50% signal, which is correct as it is the ref idle signal.
    For PA4 to be in 0-50-100 it should correspond to 0.002-1.465-2.948 or in DAC values 0-2048-4095.


    I should note that if @Peacemaker105 or anyone with a servo driver wanted to try your software using the stm32's built in DAC that they would use Pulse and Dir mode and connect as follows
    PA4 to Ain (analog torque signal) If using thanos board do not go through the thanos DAC, it will not work.
    PE11 to Dir signal
    which simply means that instead of the PE9 digital signal you would instead connect PA4.

    Keep up the good work.
    BTW did you try using your Teco drive using single analog torque signal and dir signal?
    • Like Like x 2
    Last edited: Jul 19, 2020
  11. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    AASDP_sm.jpg
    If using Thanos board and you want to use the STM32's DAC remove the shorting selector and use a jumper cable as shown in pic.
    • Like Like x 1
    • Agree Agree x 1
  12. Peacemaker105

    Peacemaker105 Active Member Gold Contributor

    Joined:
    Jul 18, 2017
    Messages:
    197
    Location:
    Perth, Aus
    Balance:
    1,976Coins
    Ratings:
    +352 / 2 / -0
    My Motion Simulator:
    6DOF
    Is there any reason you would want to use onboard stm32 DAC via pe4 instead of the LTC2645 on the thanos board via pe9, though?

    I'm assuming you'd just use the same pe9 as it's already setup for. But this is good for people running the discovery board that want to avoid purchasing and setting up an external DAC.
  13. sedesa tatasa

    sedesa tatasa Member

    Joined:
    Jun 16, 2018
    Messages:
    60
    Balance:
    497Coins
    Ratings:
    +15 / 0 / -0
    Does stm32's dac become sink when it is 0v?
    If so, you can make +-analog just by connecting pa4 and pa5.
    (pa4,pa5)=(0v,0v-3.3v)~(0v-3.3v,0v)
    In this case,you need to isolate the encoder and servo driver power supply from stm32.

    Why are you not using the analog and dir type servo?
  14. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    1,346
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,692Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    Using the PA4 and PA5 pins on the TDD as Dac analog out, you will lose ability to use g27 shifter as the Pe4 is used by the SPI interface on that pin... but then again Hoantv firmware doesn't support any G27 shifter or pedals, so...
    Last edited: Jul 20, 2020
  15. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @Peacemaker105

    It is PA4 not PE4 as there are only 2 DAC pins available PA4 & PA5
    Yes you would use PE9 as the direction signal.

    What advantage would you get? well, it would be 1 less conversion. Instead of outputting the signal in PWM in MMOS, then using the LTC2645 to convert to an analog voltage and then finally outputting to the servo drive.
    It is simply just faster and maybe more accurate to just use the stm32's built in DAC to output an analog val;ue to the servo drive.

    You may need to actually cut the track to pin 25 due to the way thanos routed the LTC2645 output, it is always connected even if you change the jumper in to "direct" or "DAC" as it only changes the input. It also means that without a signal to the LTC2645 it would output a 0v to the output pin, so if you try "direct" mode the LTC is trying to pull the MMOS PWM signal down to ground.

    If you want to try the STM32's DAC the easiest way would be to scrape off a section masking on the straight part of the track and then cut the track in the middle and then solder your jumper to the left side.
    You can restore the track if you want by bridging the cut track with solder if you want to go back to using MMOS PWM & the LTC DAC.

    I personally would try get away from using MMOS as for some reason it is programmed to only use less than a third of the DXinput's range, its probally why you found MMOS firmware to be "grainy" in your DAC video.
    Out of all the different FFB firmware including the ardinuino leonardo it is the only one that does this.
    • Like Like x 1
  16. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @sedesa tatasa
    Yes, if you connect a multimeter to PA$ & PA5 you do get +-3v but it is still referenced to ground.
    I would be very wary to suggest isolating the servo drive as that would involve removing protective ground, not something i'd be comfortable doing considering ~310vdc is involved.
  17. OZHEAT

    OZHEAT Active Member

    Joined:
    Oct 26, 2015
    Messages:
    208
    Location:
    Australia
    Balance:
    2,458Coins
    Ratings:
    +105 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor
    @Thanos
    pacemaker wrote the wrong pinout for the DAC.
    Yes you are correct that @Hoantv firmware doesn't look like it will support the G25/G27 shifter directly using SPI but it is really an analog joystick and not hard to interface using it as a secondary xy joystick, you would lose the buttons as thay are using the SPI to multiplex.

    I'm pretty sure you can just leave the logitch's usb connection and still use the pedals and shifter without plugging in the power supply... not real sure maybe it needs power to initialise the wheel when windows boots up.

    Just remember Hoan's firmware is a "work in progress" and has a higher chance of being improved on than MMOS firmware.
    There are quite a few things that I have found that are buggy/incorrect with his firmware but he doesn't seem to be around.
  18. sedesa tatasa

    sedesa tatasa Member

    Joined:
    Jun 16, 2018
    Messages:
    60
    Balance:
    497Coins
    Ratings:
    +15 / 0 / -0
    LTC2645 is also sink at 0v. And it has 4 channels.
    Connecting LTC2645 to stm32 with isolators,2pwm from stm32 to LTC2645.
    you can make +-analog in the same way.
    You will need one isolated power(eg AC adapter).
    Protective grounds do not have to be removed.

    @OZHEAT -a third of the DXinput's range
    Did you enter 4 times the encoder resolution in the mmos settings?
  19. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Hi @OZHEAT,
    So pwm and Dac with pulse/dir and hbrigde now ok, (but still set offset on ac servo to remove 0.002v)
    As, as you said, when using dac with pulse dir mode, must connect dir to pe11. I will change to 2 options in future, user only choose one option:
    - use DAC: use PA4,5 (with pulse dir PA5 0-1)
    - use Pwm: pe9,11
    I will check 0..50..100, it dont have tool to test (i just ordered logic analyzer but it is clone saleae, i think so because it is obly $10 :d) and check DAC too.
    Currently i dont use Teco driver, I ordered mige driver with bissc encoder but now i haven’t received yet. Mige sent them last Friday. It takes me around one month to receive :(!
    With mige, i will try your solution with DAC 0–50–100 and PA5 as v-ref. I ordered some opam lt1013 and lm358 and bipolar +-12v too.
  20. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Yes, myfirmware will add features, but i dont support g27 pedal/shifter. I will add loadcell/potentionmeter (base on user config), xy shifter, and wireless button for wheel.