Application to analyse mtb suspension kinematics.
Written as a project to learn Python :)
Uses the following main packages:
- Kivy - GUI
- Numpy/Scipy - Linkage Simulation
- Matplotlib - Plotting
- bikinematicsolver - A library I made to analyse bike supsensions
- Jupyter - Development/prototyping of solver eqns/maths
-
Ideally setup a Python 3.10.11 virtual environment - later python versions should work however I haven't tested.
-
Install requirements
pip install -r requirements.txt #Python reqs
python -m pip install https://github.com/kivy-garden/matplotlib/archive/master.zip #https://stackoverflow.com/questions/77910687/kivy-2-3-0-attributeerror-figurecanvaskivyagg-object-has-no-attribute-resiz
py BiKinematics.py
- Background image import
- Simulated motion of following (tested!) suspension systems - can probably handle more, solver is reasonably general (handles any system that is a single-piv or a 4-bar arrangement with slightly different placed pivots (seems like >80% of suspension despite all the different names/trademarks):
- Horst Link
- DW Link
- Split Pivot (Devinci)
- Single Pivot
- Axle Path
- Leverage ratio calculation
- Anti squat calculation
- Results Plotting
- Other suspension systems (whatever tf yeti is doing, specialised demo/canyon sender with the extra links for shock)
- Idler pulley support (solver side is almost there, not much more work to be done)
- Pedal kickback calculations
- Improved results plotting (axis ranges, data normalising to zero etc..) and graph image saving
- Slicker UI
- Write specific optimised solvers for each layout (4 bar, single piv etc)
Typical workflow for analysing bike image
- Add image
- Add points
- Click add point, then click on screen where you want to place it
- Ground points do not move relative to front triangle (usually attachment to front triangle)
- Linkage points will move relative to front triangle as suspension compresses
- Front and rear wheel should be pretty obvious...
- Note points can be dragged around after placement
- Add links between points
- Click add link, then click the points to add between in turn
- Add links between any points on the same member (rigidly connected to each other)
- Add shock between shock mountings
- Add wheelbase in User Parameters
- Allows scaling from px to mm, gives accurate travel distance in simulation
- Either get from datasheet or adjust until shock eye- eye length (mm) is correct
- Save model if desired
- Will save all geometry and wheelbase values in /SaveFiles/ in json format
- Note - there are some examples of bikes I have been testing with already in SaveFiles
- Simulate for desired travel
- The results will be saved in /Results/Filename.csv
- In plotting screen, select data and desired characteristics to be plotted
- Note all simulated results saved can be loaded in, so multiple different bikes can be compared