Hi, am a student doing my final year in university
Ssomehow got myself into a robotics project and I know nuts about programming
Am considering getting the SSC32 servo controller to control my quad.
I’ve tried previously to control the gait with a PIC18F252 BUT failed miserably as I can’t update the servos fast enough to maintain control over the servos: Keep overflowing the 20ms and the servos loses power.
Now I am stuck and hope can clarify some questions:
I got 4 DI input as foot sensors, 2 PWM inputs from accelerometer (Memsic2125), and a main processor (PIC18F4550)
The Question is:
Do I connect ALL the inputs to the microP and let the SSC32 control the gait
OR
do I have ALL the sensors connected to the SSC32, and query from the microP?
I understand that I need to send commands (ASCII) to the SSC32 to move the servos. Is there examples for quad/hex so I can get a rough idea of how I should program the walking gait?
I somehow need to get my bot to walk and sense the ground (something like micromagicsystems Hexapod V4)
Am quite lost already, can someone point me a direction?
I roughly understand that I need to send a query for the servo position once the foot sensor senses the ground, and send that specific servo position to that leg to hold it’s position. The whole cycle repeats for each leg, WHILE still maintaining the walking gait
Programming the ZPIC18F4550 won’t be much different then the '252. Are you programming in C or ASM?
You should consider just sending commands to the SSC32 to move the servos, and not try to wait for sensors initially. Much too complicated! Get the quad walking first!
Look up the code for a CH3 'bot. It’s a hexapod, but it will show you how to update the servos in a big main loop.
You can probably read the sensors from either. If they are on the 'bot computer, then their service takes up time. If they are on the SSC32, then you have to read through the RS-232 to get the info. Takes time in either case!
It would be nice to query the servo position at the exact time the foot switch closes, but you don’t need to do all of that initially! Just get the 'bot to walk on level ground!
Had a talk with my professor and am kinda in a deadend…
My programmers have disappeared, and my project is due in 1.5mths and counting down… I’ve gone through the program, and have serious doubt if I can even make it to walk a few steps if I chose to run the quad via my PIC chip.
Pls bear with me with these questions:
I intend to buy the SSC-32 squencer to run the quad, as I am running on a tight schdule with reports and presentations and a demo session…
If I wish to run my quad independently, I can place a 24LC512 EEPROM to store the sequence? Thus removing the need for a serial cable linking to my com?
Is possible for me to query the 4 digital/analogue/ inputs via the sequencer as I intend to link my foot switches to the SSC-32 so that my quad will not walk blindly
If you get the SEQ program, you can develop walking sequences with it, then save in the EEPROM of the SSC32 (example 1). You’d need some simple commands from the PIC board to tell the SSC32 to start playing back the saved sequence.
You could also write a simple program for the PIC, and have it “play back” the same sequence TO the SSC32 (example 2), which might be more useful.
You’d be using your PIC controller board, and the SSC32 in both above cases.
The PIC program would have to be able to send ASCII strings (in either case) to the SSC32. Not hard to do. See Microchip for com examples.
The new 2.nn version of the SSC32 would be needed, as it supports the EEPROM (an old one might also, but verify first. A recent topic for the SSC32 thread).
Commands to the SSC32 can read the A/D channels. These would have to be read back by the PIC, and then you could probably read the current position of the servos, and command them to that point. This should stop them.
Or, simply stop the sequence being sent to the SSC32 (2nd example above). You’d get a little more travel after the sensor detection, but works. Possibly easier to program.
It might also be possible to stop the EEPROM sequence from being executed (1st example above).
I was thinking if I can simply run the playback sequence from the EEPROM without any other interfacing
OR run SSC32 from the PC with the sequencer and read the inputs from the ABCD input pins, store the squences in the EEPROM and let my quad walk autonomously.
From what you’ve mention regarding sending ASCII to the SSC32, instead of characters??
example: "#5 P1600 T1000 "
The example will move servo 5 to position 1600. It will take 1 second to complete the move regardless of how far the servo has to travel to reach the destination.
Is this it?
As you can see I’m quite confused with regards to sending ASCII thus the reason why I initially plan to run directly from the computer using the sequencer. But my professor requested I have some sensors to further develop for presentation/demo.
I’ve made a walking (forward) sequence with 10+ steps, still need fine tuning AND kinda jerky in certain steps. At least it’s no longer dragging a foot
A new questions: I keep encountering the following type of errors:
Sequence : 000001 Step : 000007 Servo : 9
Can’t be moved to a new position ! => Busy : 300mS
Sequence : 000001 Step : 000007 Servo : 17
Can’t be moved to a new position ! => Busy : 300mS
Sequence : 000001 Step : 000008 Servo : 17
Can’t be moved to a new position ! => Busy : 600mS
Sequence : 000001 Step : 000009 Servo : 17
Can’t be moved to a new position ! => Busy : 900mS
There wasn’t any error (box turning yellow) when i was framing the steps, but once I try to run the sequence once, the above errors popped out. And I can’t run the seqence
I think this happened to me when playing with the Expert Step Parameters options (top-right of the SEQ screen). I unchecked Expert and it stopped erroring.
Expert mode allows to use different Time values for each servos during a step AND using a different “Step” time.
so, a servo can stop before the step ends and another servo can continue moving after the step ends.
there’s two reasons for a servo to be busy :
you are trying to move it in a step but the previous step time is < to this servo time…so it’s still moving (busy).
you are trying to move it in a step but the previous step time is < to the time needed to move the servo to its new position at “max rate”…so it’s still moving (that’s the boxes going yellow issue).
When moving a servo using expert mode you can choose to lock the rate or the time :
-When locking the time, if you move the servo it will adjust the speed to keep the time constant => but moving too far will exceed “Max rate” forcing it to finish after the step time, making it busy for a while.
-When locking the rate, if you move the servo it will adjust the Time to keep the rate constant => but moving too far will make the servo move to finish after the “step time”, making it busy for a while.
you can solve overlapping issues :
by increasing the previous step “step time” by the time needed
by decreasing the busy servo “time” or increasing it’s “rate”
by uncheking the expert mode checkbox and choosing a "global time for the step and its servo (all servos will ends within the step time)
Yup, I was fiddling around with the expert timing, since some steps can be faster than others. Didn’t realise the timing collision there
Got my quad to walk forward, and turn Left/Right FINALLY!! I can show something for my FYP demostration
Another NEW question:
May I know if it is possible to reverse the steps i’ve made?
eg. I’ve programmed the forward gait; all i need is to reverse the gait to make the robot walk backwards.
===> Is there some way I can mirror the program, and save as another sequence? So I have a forward/ reverse gait sequence. Instead of keying in a whole new sequence…
Thanks
** Am making a vidz, will post a link once I am done. hopefully by this week
the best way to use sequences is to use the GP Firmware/sequencer + a 24LC256 or 512 external EEPROM.
so you don’t need to use the Botboard+Chip to store and handle sequences, you just need it to control what sequence to play according to sensors input etc…
the GP sequencer allows to control speed from -100 to +100, so you just need to build a forward sequence then use a negative speed ratio to go backward.
there’s no mirror feature in SEQ, i think i will add this.