06-17-2011 11:23 AM
Solved! Go to Solution.
06-21-2011 01:22 AM
Hi bikekowal,
I'd like to look into your problem, but I see no VI attached to your post, could you please provide it, so that we can see your actual implementation?
Thank you very much!
06-21-2011 01:42 AM
Sorry for my mistake. File attached.
06-21-2011 03:57 AM
Thank you bikekowal,
I went through the page you attached but the mentioned Mobot transporter is not there, neither is a users manual or list of commands (if you have both of them, this would be a real help)
Let's look at the actual problem - In principle (if the robot is using a DC motor) you have two ways of controlling the speed: either use a pulsed signal, and by changing the PWM change the actual speed of the motor, or if you have direct control of the voltage, you can raise the voltage slowly to raise the speed. I do not know how the controler of this robot works, so I'm just making assumptions at this point.
There is the question about the speed of writing of the commands, but it might be possible to simulate the PWM by shutting on/off the motor for defined periods of time - say having "wait untill next ms multiple" wired to 50 ms (something like 20x per second might be doable, depending on the hardware) inside a while loop and sending the command:
- slow speed 1x on; 2x off
- medium speed 2x on; 1x off
- fast speed just on
As a sidenote: are you aware, that at this point, you are writing the commands just once, and won't be able to update them?
06-21-2011 04:30 AM
Maybe this website is not uptodate - it looks similiar to explorer but is bigger. This MOBOT is a mobile platform in which wheels can't turn. Turning the platform can be done by steering wheels in differential mode - one pair of wheels (on one side of mobot) is going forward, another - backward. We can only control the speed of pairs of DC motors.The steering frame looks like this:
tx_data[0] = 0xFC;
tx_data[1] = 10;
tx_data[2] = 100 + (100 - speed); - speed of one side wheels
tx_data[3] = 100 - (100 - speed); - speed of another side wheels
where speed range is 0 to 100.
You wrote:
As a sidenote: are you aware, that at this point, you are writing the commands just once, and won't be able to update them?
Yes, I am aware, and this is problem for me. Can you suggest anything?
06-21-2011 09:16 AM
As far as the repetition is concerned, you can put a while loop around your structure and wire a stop control to it.
Actually what I see you doing is inserting the commands as a hexadecimal string, which confuses me a little (you provided the text ones liketx_data[1] = 10). Is there some way to translate the comands?
If yes, you could put together the function and feed the actual speed values into the VI - those can be incremented in different ways, but for example a shift register might be quite good for this kind of use.
06-21-2011 09:38 AM
Adrent, thank you for your reply.
I will try to use while loop, it can be helpful.
I wrote:
tx_data[0] = 0xFC;
tx_data[1] = 10;
tx_data[2] = 100 + (100 - speed); - speed of one side wheels
tx_data[3] = 100 - (100 - speed); - speed of another side wheels
where speed range is 0 to 100.
but as you've already found frames are being sent as a hexadecimal strings - it is normal translation between hexadecimal and decimal data types. Two first parts of strings are constant, last ones - tx_data[2] and tx_data[3] are responsible for controlling wheels on both sides.I'll see how can I use shitft register in my project.
regards,
Marcin
06-22-2011 01:50 AM
Hi Marcin,
I'm not completely sure if your problem is solved, so if you have any other questions on LabVIEW programming or other, don't hesitate to ask.
Cześć 🙂
06-26-2011 10:52 AM
OK, thanks a lot for your help.
Cześć 🙂
06-28-2011 03:20 PM
I have another problem. I tried to build a .vi that allows mi to control a speed of mobot. A .vi is enclosed. The problem is that the string is not as it should be. I don't know where exactly the problem is, data types seems to be OK but the output string is wrong. To compare - there is a example string below the speed steering structure. Can you help me?
regards,
Marcin