will VSM do what I need?

Tzi

New Member
I just installed the demo of Picaxe VSM.. no start menu item, no shortcut on the desktop.. nothing. Obviously something went wrong there....:confused:

Anyway I found the executable and now I find the demo is so locked down that it cant even run its own sample circuits without generating licensing errors.

What I need to know is this... Is there a component in picaxe vsm to simulate an input from a R/C car receiver?
Basically I am writing a program for a pixaxe chip that will sit between the Reciever and the servo, and it would be nice to develop that on the PC before making the circuit.
 

BeanieBots

Moderator
The problems associated with RC/servo software is how they work in REAL time. This can be VERY difficult and sometimes IMPOSSIBLE to get right using simulation software. Additionally, I very much doubt that you will find a servo signal simulation within VSM. You could quite easily create one though. There is a signal generator which could do the job and you could even write your own in another PICAXE.

For RC work, I genuinely beleive it would be quicker and easier to do the sums by hand than it would be to create a full working VSM model. If you have lots of other interactive components and wish to demonstrate how the circuit works, then VSM would be a good choice. If you just want signal in and signal out then VSM will do very little for you.

Maybe if you expanded on your RC problem, we could either solve it for you or let you know if it's not possible on a PICAXE.
 

Tzi

New Member
I am planning on developing a channel expander for RC radios.
Basically using 2 channels to control a large amount of outputs...1 channel to select the device, and the other channel to operate it.
The 4ch radio I have (Nomadio) allows you can program any of the 13 buttons on the radio to do pretty much anything.
I want to program 1 up/down button as a 'output selector', and another up/down button to operate that output.

So, you would use Ch3, and program the up/down button to increment in units of 10... between 0 and 100, which gives 10 unique servo positions from left to right on the ch3 reciever.
All I have to do is program the Picaxe to check what position the "servo" is in, and select the output accordingly.

And then use Ch4 to operate that output.

I was hoping I could use VSM to create a virtual circuit so I could develop the code for this 'on screen', rather than having to test it on the actual hardware every time I make a change...:rolleyes:
 

BeanieBots

Moderator
I'd not bother with VSM for that.
Simply read each channel using pulsin.
Then you have several options:-
A bunch of if/then statements, a select case structure or a branch statement.
That's pretty much all there is to it.
You will need to do some experimentation anyway unless you already know in which order your Rx decodes the channels.
Read in the inputs in the correct order (depends on your Rx) or you will miss alternate pulses.
Then test and jump accordingly.
You've got about 18mS (roughly 30 lines of code) to do whatever you need to do before the next pair of pulse arrive.

You'll also need a few extra lines of code to exclude glitches and/or out of spec pulses which will always be present on an RC system.

Assuming your Tx puts out pulses in the normal range, pulsin will return a value between 75 and 225.
Subtract 75 and divide by 15 to get that to a range 0 to 10.
Then "branch" or whatever depending on the value and "toggle" or whatever if the other channel is in the correct range to do that task.
 
Last edited:

Tzi

New Member
sounds like a plan. The radio is 2.4ghz so glitches and stuff shouldn't be a problem.
I was just hoping to use VSM to develop code while I was traveling around.. but I guess I'll just make up a small test rig with tiny servos ;)

Thanks for your help.
 
Top