How to control a stepper motor with a load cell setting - stepper

I am working on a project where I would like to control a stepper motor using a load cell to determine when to start and stop the motor. I want to be able to choose a "set point" such as 20lbs and after pushing start, the motor will begin running until the load cell reads the 20lbs set point. Once the load cell reads 20lbs, the motor automatically shuts off until a new set point is chosen.

Related

How can i draw a cable with touch in Unity (like vacuum cleaner plug cable)

I can drawing line with line renderer. But i want to pull that line with realistic effect like vacuum cleaner cable.
video (for 5 sec)
I want to connect all the parts to body part with drawing a line. After than, they should unite with visual effect. (like vacuum cleaner cable)
I just don't know how i can make this physics
example scene
Try this :
https://www.youtube.com/watch?v=SY2npMqaOpc
and then Position should be the middle of the object 1 and object 2 that you want to connect.
Click on one object (pos1) with raycast
click on 2 nd object (pos2) with raycast
Now you have their positions and objects selected
connect them (i don't know how you want to be the connection)
or do it manually
separate codes for every connection

Unreal4 beam particle source location moving with bone/socket

I am following this tutorial to create a very simple particle system.https://www.youtube.com/watch?v=hjgnqkLeqf0
Now I want to make the lightning source moving with my character's right hand. There is nothing in parameter instance so I'm guessing I should use blueprint.
Here is my level blueprint and my particle source settings.
What I was trying to do is
I created a socket on skeleton called weapon.
get the socket position in run time every tick.
update particle parameter "lightning source point" vector every tick.
I can see that I get updated socket location from "Get Socket Location" every tick, but my particle source won't move. I also tried add Bone/Socket module in particle cascade but not working(works fine with regular particle but not beam data I guess)
Problem solved by attaching the emitter to the socket in character blueprint, not level blueprint.

Unity - random looping idle

Here is a basic setup of locomotion.
It works this way it is connected, I have walk and run animation, and stand as idle, I added 3 new stand("Idle") animations, and cant figure a way to make them random pick after walk is finished, and loop till next destination is given.
I tried adding new substate machine, but still cant figure a way to connect it the proper way.
Here is the image of current setup, this way when agent stops, it returns to idle state, and animation loops till new destination is given.
I want the same behavior but when he returns to idle, I want it to randomly loop with 3 new states
You can use BlendTree for that.
Just set Random float using Random class and use BlendTree to blend animations using that tree.

Beginner at kinect - matlab : Kinect does not start

hello I am trying to set up kinect1 in matlab environment and I cannot get joint coordinates out of kinect even though I have a preview of the captured depth. In the preview it says " waiting to start" when I actually started the video.
There are two different features which you don't want to mix up:
There is the preview function. By calling preview(vid) a preview window is opened and the camera runs. The preview is there to help you set up your camera, point it to the right spot etc. When you're finished with that, close the preview manually or via closepreview(vid).
When you are ready for image acquisition, call start(vid). With img = getdata(vid,1) you can then read 1 frame from the camera and save it to img. When you're finished with acquisition, call close(vid) to stop the camera.
The camera itsself starts capturing images as soon as start is called, so even if you wait some seconds after calling start, the first image will be the one captured right then. There exist several properties to control the acquisition, it is best to have a look at all properties of vid.
You can manually specify a trigger to take an image by first setting triggerconfig(vid,'manual'), then starting the camera and finally calling trigger(vid) to take an image.
The number of frames that is acquired after calling start or trigger is specified by the FramesPerTrigger parameter of vid. To continuously acquire images, set it to inf. It is possible to use getdata to read any number of frames, e.g. getdata(vid,5);. Note that this only works if 5 frames are actually available on the camera. You get the number of available frames from the FramesAvailable property of vid.
You can put the image acquisition inside a for loop to continuously acquire images
n = 1000;
vid = videoinput('kinect',2);
set(vid,'FramesPerTrigger',n);
start(vid);
for k=1:n
img = getdata(vid,1);
% do magic stuff with img
end
stop(vid);

Animating a turntable using Matlab's GUIDE

I have an application where I have a stepper motor connected to a turntable. The stepper motor's driver is controlled serially via Matlab.That is, I can control the angle through which the stepper motor turns the turntable and the speed at which it is happening by sending data to the stepper motor using a serial port in Matlab. Once the stepper motor turns by the required angle, it returns its current angle back to another serial port.
I am trying to build a GUI where the user can input the speed and the angle to which the turntable must be turned.I want to be able to illustrate the rotation of the turntable on my GUI itself, using the data about the current angle that the stepper motor returns to me.
Can anyone suggest a good way to creat and animate the turntable's rotation using MATLAB's GUIDE? The animated figure must be able to display the current angle with its initial reference angle. What I have in mind looks like the figure below.
Just plot eveything with lines and update the lines accordingly, don't be afraid to start using some math to calculate the angles and line end points, and to plot the circles. This is something pretty easy to do.