Comments (14)
I cant think of any other situation where a mechanical link would be required. Apart from an positional encoder.
I am moving back to the idea of adding the switches as options to the stepper itself - much like the arrow etc
select one or two switches - set the limits in number of steps.
from wokwi-elements.
the encoder would be part of the motor.
For example in tinkercad you have a motor, but then you have another element with is motor with encoder
from wokwi-elements.
I'm new to Wokwi so I might be missing something, however I also wanted to simulate something with endstops and was surprised to find that there doesn't seem an easy way to do this yet.
What about the follwing general approach, which should cover pretty much any "physical simulation" case:
- Let physical elements such as motors, leds etc. publish one or several "physical state variables". In the case of the stepper here this would be the number of steps, any maybe also the current angle.
- Allow input elements, such as the PushButton or the IR Receiver, consume other "physical state variables" using a formula to represent their own state, e.g. "button pushed: $stepper1.steps >= 14000" - or something with some logic "button pushed: $stepper1.steps >= 14000 && $stepper2.steps <= 1000".
One could then also add some purely physical display elements such as linear gauges to visually represent the physical state. Some elements, such as a potentiometer which is not hooked up, could be used as source for publishing manually manipulated physical state during simulation (such as provide ambient temperature, or some other physical input).
I think this approach could cover most (if not all) physical things one might want to simulate.
One thing to consider: Some elements, such as a PushButton, may both publish a physical state, and consume physical states. In this case, there could be dependencies across multiple elements, so that a order of evaluation would have to be determined. This would be static for the duration of the simulation; loops should be disallowed.
from wokwi-elements.
from wokwi-elements.
from wokwi-elements.
Thanks! My current thought is that it'll probably make more sense to have the limit switches element separate from the stepper motor, even though I'm not sure yet how.
Do you have a specific use case for the stepper motor with limit switches in mind?
from wokwi-elements.
I was unsure if there was a method to report the number of steps the stepper unit (as a separate element) to the limit switch element if they were separate.
the reason for the limit switches is for homing and limit usage - such as with a unit like a cnc, robotic arm etc
I am doing a project at present
https://wokwi.com/projects/350617907511689812
where I am emulating a product placement machine which has a table and a shelf
this uses limit switches for home positions and calibration
from wokwi-elements.
been working on the graphics as well and looking at sideways options
from wokwi-elements.
I did end up making a limit switches "chip"
this takes the direction and steps from the controller pins and keeps score -
if its over home_threshold - it outputs on home
if its over limit_threshold - it outputs on limit
works ok but doesnt look that nice
from wokwi-elements.
I did end up making a limit switches "chip"
Good work! Mind sharing the link so people who need it can take inspiration in the future?
We'll probably have a way to customize the look of chips later this year, so it'll both work ok and look nice!
from wokwi-elements.
Working on the variables etc.
When I said messy, it was more to be on the requirement for additional wires that don't exist in real life.
since there is no "channel" to link or report steps from the stepper as we are really looking at physical not electrical.
from wokwi-elements.
since there is no "channel" to link or report steps from the stepper as we are really looking at physical not electrical.
It's a good point. I'm trying to think of other use cases for such "channels". Internally, we have something similar for the IR Receiver / IR Remote, even though for IR the channel is "global", and here we need a private channel - a way to link a stepper and its corresponding limit switch.
from wokwi-elements.
Thanks! What would a positional encoder look like?
My intuition says that it makes sense to have the graphics for the limit switches separate from the motor. Another direction, which is probably worth exploring, is some kind of a physics playground - where the simulation models (e.g. custom chips) could control the 2d position (rotation too?) of some of the elements in the diagram. This way, one could build potentially build custom setups involving several motors (#119 comes to mind). These are just some initial thoughts, and definitely much more complex than what you are proposing.
from wokwi-elements.
https://discord.com/channels/787627282663211009/1106462441048653855
yeah there was some discussion on this.
I was looking at how the IR remote unit sends commands to the ir receiver - thinking this might be an avenue
from wokwi-elements.
Related Issues (20)
- 8 segment LED bar HOT 2
- 8 resistor bussed array HOT 1
- 8-way SPST switch HOT 1
- Error: Cannot find module './ILI9341-element' or its corresponding type declarations HOT 10
- Cosmetic - ICSP programming connector on UNO
- Possible SVG enhancements HOT 1
- Tiny fix to the Arduino Uno element SVG HOT 3
- Digital multimeter HOT 1
- Power source HOT 1
- LCD V0 for contrast turns off backlight HOT 4
- Changing size of elements HOT 4
- Visual glitch in potentiometer HOT 9
- I would like to be a contributor to wokwi HOT 3
- 8 Channel Relay Module HOT 1
- Improve on the current stepper by allowing different sizes HOT 4
- Add new element - VID28-05 Dual Stepper
- Add .js extension to export/import of javascript files in npm package HOT 1
- cosmetic : buttons "shadow effect" mismatch HOT 5
- Add: Motorized sliding potentiometer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wokwi-elements.