Start a new topic

Guidance on controlling a simple trike


I am new to vortex studio and making a tricycle with two front wheels and hub motors on the front. So far I have done the youtube tutorials on making a mechanism and I learned how to use my joystick to set a speed for the wheels. I need to step it up and make the joystick equal an input voltage/rpm which then uses a torque curve to apply torque to the wheel. When the joystick is let go the motors become free and slow down just from motor and ground resistance. I also need to use a button to apply some brake torque.

Can someone point me in the direction of an explanation on the simplest way to do this?

1 Comment

Hi Camilla,

It sounds like what you want to do is directly control the torque in the wheel constraint. You could write a script that incorporates a lookup table for your motor model. It would have an input from the joystick and perhaps current motor speed, and some calculation or lookup table that calculates the desired torque, which is then written to an output. This output would then be connected to the wheel constraint to control the torque on the wheel. 

It is simple to set up a constraint to act as a torque source, using the Motorized mode in most constraints. Basically, in Motorized mode, you specify the desired speed and maximum torque, and the solver determines the actual force and velocity based on the whole mechanical system. But you can use this to model a torque source just by setting the velocity higher than you expect to see (such as the max speed of the motor) and specifying the actual torque you want to apply.

Assuming you're using a Hinge constraint at the wheel:

- Set the control mode to Motorized under Inputs -> Controller Axes -> Angular -> Control

- Connect the Minimum Force and Maximum Force values from your script, which is calculating the torque values you want applied to the positive or negative directions of the wheel.

- Connect the Desired Velocity value from your script. If the motor is being driven forward, it should be set to some positive speed faster than you expect the wheel to move, or negative to drive it backwards. 

Login to post a comment