1. 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!
  2. 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
  3. 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

Folding 2DOF No Weld Build w/ Wheelchair Motors for VR Racing

Discussion in 'DIY Motion Simulator Projects' started by Stephen Berke, Dec 16, 2019.

  1. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Forgot to mention. The power supply was clicking during some of the more extreme direction changes. It sounded like a relay firing. I didn't notice any issues with the power feeding the motor, but it does have me concerned. Wondering if I need to wire up a diode between the IBT-2 drivers and the power supply.

    Also wondering if folks have any tips for reducing noise. The motors make a fair amount of noise when they're seeking position, especially at lower speed. Also the gear backlash creates quite a lot of rattle. I played with PWM frequency, which helped a bit. And deadzone helped a bit more for the motor noise when the arm is static. But not sure how to fix the rattle beyond doing some kind of mechanical damping. It seemed better when I sat in the chair, so maybe it won't be as bad as I think.
  2. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,045
    Location:
    Marseille - FRANCE
    Balance:
    18,703Coins
    Ratings:
    +1,945 / 17 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    ultrasonic PWM will remove the humming sound only if above 20kHz
  3. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Thanks. I’m gonna have to play more today but I wasn’t noticing a huge difference with the PWM frequency. I think I’m hearing more of the motor seeking when it’s at rest. I saw in the faq an article for how to help that. I think it’s also the gear backlash making a lot of noise and rattle. So I’m hoping that when I’m in the chair it’ll have a bit of preload. I saw dofreality is offering dampers on their rigs now. I’m guessing the backlash is the reason. I may also need to play with my ctc arm length. Maybe 3.5 inches is exaggerating the backlash too much. The chair seems to already have more range of motion than I really need.

    Is there a downside to raising the frequency? Less power to the motor?
  4. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Here's the current state of the SMC3 PWM sensor input code. Basically it uses the PinChangeInterrupt library to allow more of the UNO pins to act as interrupts. Since the library reads the change on a whole port, you have to have your PWM inputs going to different ports on the Uno. When I tried two inputs on the same port, they interfered with each other. At the moment this limits you to two PWM inputs. It looks like you could free up one more port for a total of three PWM inputs. But it would take some reworking of the existing outputs to free up a pin.

    If you want to do more reading about it you can check out the github for the library:
    https://github.com/NicoHood/PinChangeInterrupt


    Here's the code for PWM interrupts:
    #include <PinChangeInterrupt.h> //Includes pinchanginterrupt library for reading PWM

    #define HALL1_PIN 11 // Motor 1 feedback interrupt PIN ID for Analog pin 3
    volatile int hall1_value = 0;
    volatile int hall1_time = 0;

    #define HALL2_PIN 0 // Motor 2 feedback Interrupt PIN ID for Digital pin 8
    volatile int hall2_value = 0;
    volatile int hall2_time = 0;

    // Setup for motor feedback PWM inputs
    void setup()
    pinMode(HALL1_PIN, INPUT); digitalWrite(HALL1_PIN, LOW); //Sets pin 'low' to begin
    attachPCINT((HALL1_PIN), hall1rising, CHANGE);

    pinMode(HALL2_PIN, INPUT); digitalWrite(HALL2_PIN, LOW); //Sets pin 'low' to begin
    attachPCINT((HALL2_PIN), hall2rising, CHANGE);

    void hall1rising() {
    attachPCINT((HALL1_PIN), hall1falling, CHANGE);
    hall1_time = micros();
    }
    void hall1falling() {
    attachPCINT((HALL1_PIN), hall1rising, CHANGE);
    hall1_value = micros()-hall1_time;
    }
    void hall2rising() {
    attachPCINT((HALL2_PIN), hall2falling, CHANGE);
    hall2_time = micros();
    }
    void hall2falling() {
    attachPCINT((HALL2_PIN), hall2rising, CHANGE);
    hall2_value = micros()-hall2_time;
    }

    And here's a sample of how I changed the SMC3 code to use the PWM values.
    // Feedback1 = analogRead(FeedbackPin1);
    Feedback1 = hall1_value; //Read the PWM value for motor 1 feedback
    if (Feedback1 > 1024){ //prevents PWM value from exceeding 1024, which is largest analog value
    Feedback1 = 1024; //prevents PWM value from exceeding 1024, which is largest analog value
    }

    My understanding is limited on this subject. But at the moment both interrupts are basically acting independently of each other. It might be more efficient to have one trigger the other and vice versa.

    Anyway, not sure who is interested but here's the current version in case anyone else wants to play with this. To be completely honest, I have no idea if this effects the code in any other ways. So far it's mostly been working for testing, but I haven't compared the code with PWM vs analog reads. I have experienced one bug where a sensor started reading in reverse. SO CHECK YOUR DIRECTIONS with SMC Utils.

    Attached Files:

  5. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,045
    Location:
    Marseille - FRANCE
    Balance:
    18,703Coins
    Ratings:
    +1,945 / 17 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    It makes your drive (motomonster) hotter but heat sink will cope

    IMO there is a flaw in the design if a commercial rig needs dampers or spring...
    springs will help half of the time and go against the other half (less speed probably)
    dampers will erase details, induce delays...
    • Like Like x 1
  6. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Good to know. I’m running IBT-2 at 24v. The heat sink gets pretty warm during testing. But not alarmingly so. I’m gonna add some active cooking for a bit of insurance. Tried 35khz and did see some improvement with the noise.

    I’m not gonna worry too much about it until I start tuning it with a passenger. In my short motion tests while sitting in the chair, I noticed it quieting down quite a bit. So I’m thinking having no load is exacerbating the issue.
  7. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Did a bunch more testing yesterday. I’m able to read from the two sensors just fine. But the bug that reverses direction continues to persist. Rebooting the arduino sometimes fixes the problem, but at this point it seems like both sensors will just occasionally swap direction. Up becomes down, etc.

    Obviously this is a serious problem. I’ve played with making a simple rc filter to read the pwm as analog. First testing looks ok so I might give that a go. Otherwise, I think I need to experiment with the way the PWM is being read and try to see if I can figure out what the heck is going on!
  8. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    So did a little more research on how other folks have implemented PWM reads for their projects. I really want to get this working as opposed to going the RC filter route. I think my problem was stemming from when I was triggering the interrupt. The original code used CHANGE whereas now I'm triggering on the rise and fall for each routine.

    So:
    void hall1rising() {
    attachPCINT((HALL1_PIN), hall1falling, CHANGE);
    hall1_time = micros();
    }
    void hall1falling() {
    attachPCINT((HALL1_PIN), hall1rising, CHANGE);
    hall1_value = micros()-hall1_time;
    }

    Becomes:
    void hall1rising() {
    attachPCINT((HALL1_PIN), hall1falling, FALLING);
    hall1_time = micros();
    }
    void hall1falling() {
    attachPCINT((HALL1_PIN), hall1rising, RISING);
    hall1_value = micros()-hall1_time;
    }

    Anyway, made a few other tweaks to the code for clarity and efficiency, but so far have done about 10 reboots and the sensor directions have remained stable. So MAYBE this version will work for me to continue onward with my testing.

    In other news, I'm waiting for my vibration isolating feet to arrive. Propping the rig up on 2x4s isn't cutting it.

    Attached Files:

    • Like Like x 1
  9. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Some updates. I installed the anti vibration feet. This has made the platform much more stable. [​IMG]
    [​IMG]

    Also printed up a mount for the electronics and a 24v fan. Man is that sucker loud. Gonna have to put a speed control on it I think. Doing some more permanent wiring now, still need to make it all neat and tidy. And debating whether or not I need to do 2 power supplies. My current one is 1000w. The motors are spec’d at 275w each but have like 950w peak draw.

    [​IMG]
    [​IMG]
    [​IMG]

    Attached Files:

    • Like Like x 1
  10. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Some new weirdness.

    After wiring everything up, and rewiring multiple times. I'm only able to get one of the motors to consistently turn on in the SMC utility. Motor 1 works perfectly fine. I see the feedback and the motor will turn on and follow all the the test patterns just fine. Motor 2 however keeps turning itself off after a second or two. For the time it does remain enabled the motor seems to work fine. I can see the feedback which looks good. And the motor will follow the test patterns for a second or two before it shuts motor 2 down. It even does this when the motor 2 IBT-2 bridge isn't powered up. Again doing this for the motor 1 driver works fine.

    All I can think of is that something strange is happening with the feedback on motor 2 causing the software to turn off the motor. Not sure if this is a problem with the PWM code or something else with the hall sensor. I guess next step is to try swapping the sensors on the motors and see if the problem follows the sensor.

    I also checked with running the PWM code on another UNO. Weirdly this other board seems to run at half the speed of the other. Don't have any idea why. They have the exact same sketch uploaded to them. The first board runs around 4000 calcs/sec. This one is hovering around 2000. So weird!
  11. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Figured out the second issue I was having. The Fpid setting was at 2. This reduced the calcs/sec to 2000 or so. So at least that explains why the two arduinos were running at different speeds. I uploaded the sketch multiple times and it didn't seem to rewrite settings, so that's a little odd. But at least I've got one mystery solved. Now to figure out why motor 2 keeps turning off.
  12. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Well some progress and some backtracking. The PWM code is just not working consistently. For one thing it’s a lot noisier than it should be. And it was going crazy when both motor drivers were enabled.

    Ironically the original as5600s that I ordered arrived yesterday. They only took a month in post. From LA. These ones haven’t been burned yet and are default analog. I decided to use those for now since I really want to get a working sim. So I reflashed the arduino with the original smc3 code. And now I’m back to square one.

    Here’s the new as5600 board from seeed.
    [​IMG]

    This meant printing up a new mount. I decided I might as well print up a mount for the other side of the bracket as well. This now gives me a perfect air gap for the hall sensor.
    [​IMG]
    [​IMG]
    Also beefed up the CTC arm too.

    Hooked everything up to the first motor driver and the arduino and noticed that the range from the sensor wasn’t covering the full feedback range in the SMC utility. Basically it’s flipping to the low side too early.

    I can reprogram the ranges and the voltage range on the AS5600. But I’m wary to burn it permanently right now and I wanted a faster solution.

    So I did a few measurements modified the SMC3 code to add a multiplier to the analog feedback.

    Feedback looks really good now. And a lot cleaner than the pwm was. So that’s great. Except the motor drivers are totally freaking out.

    Attached Files:

  13. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    I’m an idiot. When I reflashed the code I forgot to change to mode 2. Now when I turn on the motor it responds correctly. Guess it helps to check your work twice. The multiplier seems to be working fine. I’m not sure if this reduces the resolution of the sensor though. I’m thinking it might. I’ll have to experiment with the different analog modes on the sensor and see if I can get the range to match better without the multiplier.

    Ultimately, it makes sense to me to interface with the as5600 over i2c. This bypasses a round of D to A conversions and would probably provide the most accurate and cleanest signal. But because of the fixed address on the chip, I think this would require a multiplexer. Or multiple Arduinos I guess.

    So I hooked up the second sensor and the motor driver. And... nothing. God this is frustrating.

    The second sensor seems to work fine though. So I’m guessing I have a bad motor driver. I’m gonna swap it out in the morning and see if that sorts everything out. It does make me wonder if the PWM code was entirely the culprit the first time around. I guess I should have troubleshoot that a little further. But I was frustrated by the constant holdups. And honestly the analog signal is a lot cleaner. So for now, I’m just gonna stick with what works and not try to break any new ground.

    I’m happy enough to have low profile, non contact sensors. Hopefully more updates tomorrow after I try the new driver out.
  14. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Almost forgot. In all my experimenting I had noticed that the 24v fan would run at low speed whenever the Arduino was powered up without the power supply. This didn’t make a ton of sense since the fan is hooked up directly to the power supply and the Arduino is powered off USB. So the motor driver was feeding back 5v towards the power supply. I remember seeing that the ibt2 has internal 5v so I removed the 5v line coming from the Arduino and sure enough the fan stopped running. The driver seems to run fine on mains power alone so I’m gonna leave it. This does really remind me that I need to get some kind of protection in place for the power supply though.
  15. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Well a day of victory and ultimate frustration. I swapped out the ibt2 and low and behold both motors are working. I finally was able to connect to Simtools and after some initial frustrations, started to dial in some settings.

    I’m using No Limits 2 as my initial testing. I figure the motions there will be far larger than most of the other games I play. After some confusion with the direction of the axis and such I seemed to get it roughly working.

    I tried a few ride ons and was experiencing some rough rides and some overshoots and such. So I dove deep into the smc utilities and found some settings that were getting me closer.

    The backlash on the gear box is killing me right now. I don’t know if backlash is just particularly bad on these motors or if the ctc arms are too long. I’m guessing they are. The range of motion is far more than I think I need at this point and the motors really seem to struggle when trying to recover from fast big moves. Especially the roll axis.

    I found myself overshooting the safety limits a few times and really hearing some whining from the motor drivers. Not sure if that’s bad.

    In any case when transitioning over the CG it is very violent and jarring and I can really feel the jolt when the free play runs out. I’m guessing shortening the arm will greatly reduce this. I’m at approx 3.5 inches right now. Do I go down to 2.5?

    So testing continued.

    Then tragedy. After a particularly violent move the motors seemed to stall out and then die. I heard a loud snapping sound and immediately killed power. It sounded like something mechanical, but I examined everything and didn’t notice any damage.

    So I powered up again. At this point I noticed the right hand motor was acting funky. I could press down on it and apply weight and it would hold. But it would vibrate and grind. When I lift up on the motor arm it moves freely though. Basically it seems like only direction is working. This was confirmed in the utility when I could manually move the arm up. But not down.

    I checked all my connections and they seem solid. I examined the motor drivers and that’s when I noticed. On the replacement ibt2 there is a millimeter sized hole in one of the motor driver chips. I’m positive this wasn’t there before. I’m not exactly sure what happened here. But all I can think of is that something overloaded and popped within the ic.

    So I’m wondering. Does each motor driver ic on the ibt2 only drive one direction? And did I just blow one?

    That was my last spare. I’ll have to order some new ones I guess. I may attempt to replace and reflow the ic from one of the other dead IBT-2s but I don’t have much hope for that. I may also try to troubleshoot the one that wasn’t working yesterday. But I really have no idea what’s wrong.

    Maybe this motor driver just isn’t cutting it. Except the left hand one seems to be working just fine so far.

    Another bumpy day on the road to my diy sim.
    • Like Like x 1
  16. PairRoc

    PairRoc New Member Gold Contributor

    Joined:
    Jan 21, 2020
    Messages:
    24
    Location:
    China
    Balance:
    168Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    2DOF, SCN5, SimforceGT
    Wow congrats for your work. Thats it. Perfect low budget solution. Both thumps up.
    • Like Like x 1
  17. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Lots of updates. I have a working sim!



    Here’s me playing a bit of iRacing (badly). I’m still in need of a lot of tuning but it’s a start!

    Here are some of the updates. The motors were really straining to do big fast moves with a 3.5” ctc. So it’s been reduced to 2.5”. This should still give me about 15 degrees in all directions.
    [​IMG]


    I also realized that I could lower the seat in regards to the pivot. I figured it would increase leverage the lower I am. So the pivot has been sucked up to within a few inches of the bottom of the seat. [​IMG]

    This gives me just enough clearance for the pitch axis. It also has the added benefit of raising the linkage on the platform to a more rigid point on the frame. The attach point is still more or less in line with the pivot point. I know this reduces leverage, but I’m still trying to maintain a maximum range of movement.

    Got the replacement Ibt2 and it seems to be working well. Also got a 24v fan controller so the sound issues are much more manageable.

    Bonus. Also picked up a 4 point harness on sale. Luckily it’s fairly subtle design wise. I want the extra immersion and cues. And as you can see at the end of the video, I get thrown around a lot when I crash. At some point I’d love to do a tensioner system as I could see that really adding to the effect.
    [​IMG]

    Still have more tuning to do and I’ve done a lot since this video. But I’m slowly getting there. One thing I will say is that I’ve been getting really simulator sick in VR. I was not expecting that. Not sure if it’s bad motion, lack of motion canceling (using Rift S),or if I’m just out of practice. I took a few months off and maybe I need more time to acclimate. But just wasn’t expecting that. Dirt rally 2 never made me sick on a desktop vr rig. But it had me (and my girlfriend) green in about 10 minutes.

    Attached Files:

    • Winner Winner x 2
  18. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Ah and another video showing NoLimits 2.


    I think she had a pretty good time! The roller coasters make me feel ill in VR. If you get to the end you can see the left hand motor get stuck in the up position towards the end of the run. I think this was due to overrun and tripping the clip limits.

    I’ve done a lot more work on the PIDs since this video and have gotten much fewer of those.

    Side note. No Limits 2 loops are the worst. Not sure why, but there is some crazy roll motion added in there that just makes no sense.

    Final notes for now. I really can’t stand the gearbox play. It makes the the motors quite loud when they are unloaded as they seek position. It also makes a big mechanical racket as the loading hops back and forth. And I can tell it’s robbing me of a lot of fine detail. I can hear the clacking of the free play for a lot of subtle movement that isn’t getting translated to the seat. I’ve got some forward loading from where I’ve placed the pivot but maybe I should try more? I just don’t wanna stress the engines.

    I know @RacingMat said there was a design flaw if you needed em. But I think I want to experiment with some gas springs anyway. I just don’t see what other options I have, short of replacing my drive units. $$$$

    DOF reality seems to have adapted motorcycle steering dampers for their purposes. But I think those might rob details and are expensive to play with.

    My idea is to put two gas struts in the front that will compress when you pitch forward. I’ll slightly bias the weight forward to let gravity help with compressing. Hopefully there will be enough spring strength to more or less always keep the load towards the back. Not sure if I’m making sense, but in my head it could work.

    Anyway, back to building up my anti vomit tolerance!
  19. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    14,982
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    110,520Coins
    Ratings:
    +8,958 / 43 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Great to see your rig in action.

    Keep in mind the larger the lever CTC distance the more it will exacerbate gearbox play, and strain the motors.

    Also try larger Tuning Center values so that the motion is not so jerky.

    In VR it is more important the motion be fast and precise, rather than laggy large axis movements, so refine you motion profile by initially taming everything down a bit in terms of large axis movement and instead aim at precise movement. You may find it better to first get your VR/motion legs in something other than NL2.
  20. Stephen Berke

    Stephen Berke Member

    Joined:
    Oct 19, 2019
    Messages:
    30
    Balance:
    - 57Coins
    Ratings:
    +18 / 0 / -0
    Thanks! I totally see what you’re saying and could definitely try experimenting with the shorter ctc arm. If it gives me better resolution for the finer moves then maybe it’s worth sacrificing more range. I do see how a little can go a long way with regards to immersion. It’s just that all these videos with gigantic ranges of motion are so enticing!!

    And no! Haven’t done any VR tuning in NL2. Tried it once and no thanks! Girlfriend loved it though so wanna keep a good profile for her.

    I’m gonna experiment with the gas springs for fun. And also gonna play with the ctc arm length some more.

    I’m really thinking linear drive is the way to go in the future. But $$ and they all seem loud.