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

Vellemen K8055 and PWM

Discussion in 'SimTools compatible interfaces' started by matt_tighe, Jan 2, 2008.

  1. matt_tighe

    matt_tighe New Member

    Joined:
    Jan 2, 2008
    Messages:
    21
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    Hi All,

    I have been developing some designs for a 2DOF motion seat using DC motors. For research purposes I build a small model platform using RC servos and a Velleman K8055 as the PC interface.

    I've followed the development of X-sim for a while and after playing around it's a really cool piece of software! :)

    After hooking up my servos to and H-bridge IC and firing up x-sim and lfs I had motion quite easily the results are on youtube somewhere!

    The x-sim software doesn't seem to attempt to follow the actuator target that closely... are there settings for this, what is the algorithm used to dampen the latency induced vibration ( I would assume this is the problem)?
    Also the whole 10-250 pot range was an issue for me.. is there a reason why any pot range can't be used?

    Anyway I decided to hook up the PWM channels of the Velleman to my motor controllers and I hack the LFS outsim driver to use my own code to drive the servos proportionally using the velleman directly. I was pretty impressed with the results. It needs some tuning and at the moment it ignores inertia from the current motor speed.

    I will upload some more videos to youtube tonight showing the diff between digitial and pwm driving.

    I'm using a windows multimedia timer in my code, but it looks like X-sim force profiler has much lower latency that my quick hack ;-)

    I have heard there is a new x-sim version with proportional support would it cover my setup? Any plans to make x-sim open source? I'd love to get involved with the dev.
  2. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +7 / 1 / -0
    Hi Matt

    Welcome!

    To be honest, I'm not very familiar with the Velleman interfaces. But I have doubts that they are very usefull for using it to drive and position motors fast and accurat.
    Imho you'll need a fast microcontroller, because Windows works too slow to be able to position actuators fast and precise.
    Thanos controller just works that good, because it operates completely independent from Windows and the X-Sim Software.
    It does positioning and position feedback by itself.


    But regarding the pots I can tell you, that it is really important to achieve at least those 8 bit resolution that the Profiler1 uses currently. Devide the travel lenght of each of your simultators axes. If you just use 45deg of a 250deg pot, you have only have ~45 Positions for the full simulator axis movement instead of the 250^^
    We are struggling with the low resolution of 8 bit in Profiler1 recently. Thanos compensated this handicap very good by using proportional code in his AVR controller.
    The next Profiler will have 16 and 32 bit resolution in positioning. Therefor you should better make yourself familiar with encoders.


    Let's see your vids. Perhaps they'll change my opinion ;)

    Would be nice to see your projects in our DIY simulators section!

    regards
    ego
  3. matt_tighe

    matt_tighe New Member

    Joined:
    Jan 2, 2008
    Messages:
    21
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    Thanks for the welcome!

    I have been following Thanos thread for a while and his controller looks very good. There is no doubt that realtime pwm control of the actuators by a microcontroller will produce a more stable output.

    My original plan was to try to build a sim using as many off the shelf parts as possible. Thats why I started using the velleman interface. I didn't realise it too contained a PIC16xxx microcontroller with usb interface.

    I plan to devise my own controller using the PIC18xxx series in a similar vain to what Thanos has done.

    Anyway my first video (using x-sim digital output) is here:

    http://www.youtube.com/watch?v=pxMxnaVhsUo

    You can see it responds to small movements quite fast but the positioning is not accurate (at one point the right actuator gets stuck for a little while ;-) )

    My PWM experiment is here (using my own outsim driver hack):

    http://www.youtube.com/watch?v=sXh_3_sT8Z4

    It's much smoother with much better final positioning. By no means perfect tough especially as the proprtional algorithm is not tuned. The trouble is the latency of the Velleman I/O. Meaning you have to damp the motor control to stop jittering.

    However I don't think it is too bad. I had an idea for creating a dynamic calibration using speed vs. distance to lookup the correct pwm setting which would give much higher final resolution (at the expense of constant speed), compensate for the lag of the i/o.

    However... I think I will abandon that in favour of microcontroller approach as there is no benefit in keeping the code on the host machine (as all the usb interfaces are microcontrollers anyway ;-) ).
    I want to make sure that my interface is capable of handling positioning at different speeds alowing us to simulate larger g-forces by mixing accel and final position effects. I wonder if x-sim will support this in future?

    I've order some proper (larger) motors now so I will soon see how my controller stands up to the real current demands!!
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi matt_tighe,

    Nice job!

    Your try, looks good, especially on the second video. But you should lower much more the Kp (proportional constant) to have faster positioning!

    As you can see a controller that depends on the computer process to update thru USB is slow! Thats way I used the serial interface (USO) and keep my hardware update standalone!


    Some questions:

    -Are you using simple servos as actuators on the model?

    -In the second video are you controlling them with R/C commands or stipped their RC electronics and used just PWM on the raw motors?

    I'd like to see your approach to this using a PIC controller, even if I don't know anything about them... :)

    Good luck on your progress!

    Regards, Thanos
  5. matt_tighe

    matt_tighe New Member

    Joined:
    Jan 2, 2008
    Messages:
    21
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    Hi Tronicgr,

    Yes I need to adjust the proportional algorithm like you suggest. I had an idea where it could calibrate itself... Each timer tick it would use the error in position to adjust the pwn in a calibration array that was speed vs distance desired. Using an algorithm like that the the software could adjust to different motors without requiring hand tuning. But as I switch to microcontroller positoining now it's probably not that necessary.

    The servos are simple RC servos I purchase from Maplin (an electronics supplier in the uk). I gutted the electronics from them so I just use the motor and pot.

    The Velleman board is connected to a dual h-bridge IC which has inputs for each side of the bridge and an enable line. I attach the pwm to the enable line to regulate speed and control direction from the bridge inputs.

    As I was saying to egoexpress my goal is to produce a platform with fairly small motors... it seems to me that the Frex SCN5's only take 2-25 amps maximum?!?. We must be able to achieve something nearer that? What do you think?
  6. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Matt_tighe,

    You can take ideas on how to implement simple proportional servo control by looking the source code of my older Basic Stamp2 interface:

    http://www.x-simulator.de/forum/tronics ... -t495.html

    Then you can adjust it to your needs!

    My current motor controllers are capable of output 10 to 25 amp! And the car wiper motors, I use, consume 8 to 15 amp currents under load.

    Its just that Frex SCN5's are stepper motors and need less current by each step. DC motors on the other side need much more current to keep rotating under load!

    Regards, Thanos
  7. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +7 / 1 / -0
    You'll never be able to drive a platform with 10kgf actuators like SCN5! You'll need much more power than 2-Amps motors. A platform has to handle way more masses!

    Btw, nice, what you have achieved with the Velleman and PWM :)

    regards
    ego
  8. matt_tighe

    matt_tighe New Member

    Joined:
    Jan 2, 2008
    Messages:
    21
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    Hi Ego,

    When I said platform it's a bit misleading. The idea is that it's a small platform (just for the seat like the Frex design). I want to create something that is compact and doesn't have the t-bar protruding from the base.

    I just got some larger 24v electric motors hooked up to my motor driver but it get's pretty hot!!! so I think I might need to beef it up a bit.

    The more I read about stepper motors though, the more I want to switch. I remember reading something in the forums about people finding steppers un-usable. But they look ideal for our purposes?
  9. Renoboss

    Renoboss Member SimAxe Beta Tester Gold Contributor

    Joined:
    Nov 8, 2006
    Messages:
    75
    Occupation:
    Work, Motion Simulator and High Tech Fishing
    Location:
    Netherlands (Frisian)
    Balance:
    297Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    2DOF, SCN5
    The manufactors of the SCN5 also make heavier ones !
    The aren't as fast !

    If I remember corectly we have tried to obtain them .
    We didn't even get a priceqoute!
  10. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +7 / 1 / -0