Driving script for brushless motors

4 years 8 months ago #29531508 by drivecontrol
Driving script for brushless motors was created by drivecontrol
Hi

We are looking for some assistance/expertise in a custom driving script for a device we are developing with brushless motors and a Roboteq controller and are wondering if someone on this forum has the time and expertise to help?

Many thanks

Please Log in or Create an account to join the conversation.

4 years 8 months ago #29531509 by niko
Hello,

What do you want to do?

Please Log in or Create an account to join the conversation.

4 years 8 months ago #29531512 by drivecontrol
Replied by drivecontrol on topic Driving script for brushless motors
Hi

The default open loop setting only allows for setting of acceleration or deceleration rates.

We need different rates for forward/reverse and left/right.

We also need a way for the controller to limit the speed if the device goes downhill, so it does not exceed the speed that has been set.

Please Log in or Create an account to join the conversation.

4 years 8 months ago #29531513 by niko
You need different acceleraton deceleration rates for forward and different for backwards? If so you can check the speed of the motor and accordingly set accel and decel. For example see the script below (untested):

Accelf = 1000
Decelf = 1000
Accelr = 2000
Decelf = 2000
top:
Speed = getvalue (_S, 1) 'or BS depending on the sensor you use
if Speed > 0 then
setconfig (_MAC, 1, Accelf)
setconfig (_MDEC, 1, Decelf)
else
setconfig (_MAC, 1, Accelr)
setconfig (_MDEC, 1, Decelr)
endif
wait(10)
goto top

You can use closed loop speed in order to control the speed of the motor. You need a motor with sensor (hall ,encoder) that will be used for motion and for feedback in order to measure the speed. The command you give will be the desired speed.

Please Log in or Create an account to join the conversation.

4 years 8 months ago #29531514 by drivecontrol
Replied by drivecontrol on topic Driving script for brushless motors
Hi Niko

Thank you for this, I have emailed you the exact problem

Please Log in or Create an account to join the conversation.

Time to create page: 0.523 seconds